use of org.hibernate.search.integrationtest.backend.tck.testsupport.util.ValueWrapper in project hibernate-search by hibernate.
the class FieldSearchProjectionTypeCheckingAndConversionIT method multiIndex_withCompatibleIndex_projectionConverterEnabled.
@Test
public void multiIndex_withCompatibleIndex_projectionConverterEnabled() {
StubMappingScope scope = mainIndex.createScope(compatibleIndex);
String fieldPath = getFieldWithConverterPath();
assertThatQuery(scope.query().select(f -> f.field(fieldPath, ValueWrapper.class)).where(f -> f.matchAll()).toQuery()).hasHitsAnyOrder(new ValueWrapper<>(getFieldValue(1)), new ValueWrapper<>(getFieldValue(2)), new ValueWrapper<>(getFieldValue(3)), // Empty document
new ValueWrapper<>(null), // From the "compatible" index
new ValueWrapper<>(getFieldValue(1)));
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.util.ValueWrapper in project hibernate-search by hibernate.
the class FieldSearchProjectionTypeCheckingAndConversionIT method multiIndex_withMissingFieldIndex_projectionConverterEnabled.
@Test
@TestForIssue(jiraKey = "HSEARCH-4173")
public void multiIndex_withMissingFieldIndex_projectionConverterEnabled() {
StubMappingScope scope = mainIndex.createScope(missingFieldIndex);
String fieldPath = getFieldWithConverterPath();
assertThatQuery(scope.query().select(f -> f.field(fieldPath, ValueWrapper.class)).where(f -> f.matchAll()).toQuery()).hasHitsAnyOrder(new ValueWrapper<F>(getFieldValue(1)), new ValueWrapper<F>(getFieldValue(2)), new ValueWrapper<F>(getFieldValue(3)), // Empty document
new ValueWrapper<F>(null), // From the "missing field" index
new ValueWrapper<F>(null));
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.util.ValueWrapper in project hibernate-search by hibernate.
the class FieldSortTypeCheckingAndConversionIT method multiIndex_withRawFieldCompatibleIndex_dslConverterEnabled.
@Test
public void multiIndex_withRawFieldCompatibleIndex_dslConverterEnabled() {
StubMappingScope scope = mainIndex.createScope(rawFieldCompatibleIndex);
String fieldPath = getFieldPath();
assertThatThrownBy(() -> {
matchAllQuery(f -> f.field(fieldPath).asc().missing().use(new ValueWrapper<>(getSingleValueForMissingUse(BEFORE_DOCUMENT_1_ORDINAL))), scope);
}).isInstanceOf(SearchException.class).hasMessageContainingAll("Inconsistent configuration for field '" + fieldPath + "' in a search query across multiple indexes", "Attribute 'dslConverter' differs", " vs. ").satisfies(FailureReportUtils.hasContext(EventContexts.fromIndexNames(mainIndex.name(), rawFieldCompatibleIndex.name())));
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.util.ValueWrapper in project hibernate-search by hibernate.
the class FieldProjectionTypeCheckingAndConversionIT method multiIndex_withMissingFieldIndex_projectionConverterEnabled.
@Test
@TestForIssue(jiraKey = "HSEARCH-4173")
public void multiIndex_withMissingFieldIndex_projectionConverterEnabled() {
StubMappingScope scope = mainIndex.createScope(missingFieldIndex);
String fieldPath = getFieldWithConverterPath();
assertThatQuery(scope.query().select(f -> f.field(fieldPath, ValueWrapper.class)).where(f -> f.matchAll()).toQuery()).hasHitsAnyOrder(new ValueWrapper<F>(getFieldValue(1)), new ValueWrapper<F>(getFieldValue(2)), new ValueWrapper<F>(getFieldValue(3)), // Empty document
new ValueWrapper<F>(null), // From the "missing field" index
new ValueWrapper<F>(null));
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.util.ValueWrapper in project hibernate-search by hibernate.
the class FieldSearchSortTypeCheckingAndConversionIT method multiIndex_withRawFieldCompatibleIndex_dslConverterEnabled.
@Test
public void multiIndex_withRawFieldCompatibleIndex_dslConverterEnabled() {
StubMappingScope scope = mainIndex.createScope(rawFieldCompatibleIndex);
String fieldPath = getFieldPath();
assertThatThrownBy(() -> {
matchAllQuery(f -> f.field(fieldPath).asc().missing().use(new ValueWrapper<>(getSingleValueForMissingUse(BEFORE_DOCUMENT_1_ORDINAL))), scope);
}).isInstanceOf(SearchException.class).hasMessageContainingAll("Inconsistent configuration for field '" + fieldPath + "' in a search query across multiple indexes", "Attribute 'dslConverter' differs", " vs. ").satisfies(FailureReportUtils.hasContext(EventContexts.fromIndexNames(mainIndex.name(), rawFieldCompatibleIndex.name())));
}
Aggregations