use of org.hibernate.search.integrationtest.backend.tck.testsupport.types.FieldTypeDescriptor in project hibernate-search by hibernate.
the class FieldSearchSortTypeCheckingAndConversionIT method multiIndex_withMissingFieldIndex_nested.
/**
* Test the behavior when even the <strong>parent</strong> field of the field to sort on is missing,
* and that parent field is <strong>nested</strong> in the main index.
*/
@Test
@TestForIssue(jiraKey = "HSEARCH-4173")
public void multiIndex_withMissingFieldIndex_nested() {
assumeTrue("This backend doesn't support sorts on a field of type '" + fieldTypeDescriptor + "' that is missing from some of the target indexes.", TckConfiguration.get().getBackendFeatures().supportsFieldSortWhenFieldMissingInSomeTargetIndexes(fieldTypeDescriptor.getJavaType()));
assumeTrue("This backend doesn't support field sorts on a nested field that is missing from some of the target indexes.", TckConfiguration.get().getBackendFeatures().supportsFieldSortWhenNestedFieldMissingInSomeTargetIndexes());
StubMappingScope scope = mainIndex.createScope(missingFieldIndex);
SearchQuery<DocumentReference> query;
String fieldPath = getFieldInNestedPath();
query = matchNonEmptyQuery(f -> f.field(fieldPath).asc().missing().use(getSingleValueForMissingUse(BEFORE_DOCUMENT_1_ORDINAL)), scope);
/*
* Not testing the ordering of results here because it's not what we are interested in:
* we just want to check that fields are correctly detected as compatible,
* that no exception is thrown and that the query is correctly executed on all indexes
* with no silent error (HSEARCH-4173).
*/
assertThatQuery(query).hasDocRefHitsAnyOrder(b -> {
b.doc(missingFieldIndex.typeName(), MISSING_FIELD_INDEX_DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_2);
b.doc(mainIndex.typeName(), DOCUMENT_3);
});
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.types.FieldTypeDescriptor in project hibernate-search by hibernate.
the class FieldSortTypeCheckingAndConversionIT method multiIndex_withMissingFieldIndex_nested.
/**
* Test the behavior when even the <strong>parent</strong> field of the field to sort on is missing,
* and that parent field is <strong>nested</strong> in the main index.
*/
@Test
@TestForIssue(jiraKey = "HSEARCH-4173")
public void multiIndex_withMissingFieldIndex_nested() {
assumeTrue("This backend doesn't support sorts on a field of type '" + fieldTypeDescriptor + "' that is missing from some of the target indexes.", TckConfiguration.get().getBackendFeatures().supportsFieldSortWhenFieldMissingInSomeTargetIndexes(fieldTypeDescriptor.getJavaType()));
assumeTrue("This backend doesn't support field sorts on a nested field that is missing from some of the target indexes.", TckConfiguration.get().getBackendFeatures().supportsFieldSortWhenNestedFieldMissingInSomeTargetIndexes());
StubMappingScope scope = mainIndex.createScope(missingFieldIndex);
SearchQuery<DocumentReference> query;
String fieldPath = getFieldInNestedPath();
query = matchNonEmptyQuery(f -> f.field(fieldPath).asc().missing().use(getSingleValueForMissingUse(BEFORE_DOCUMENT_1_ORDINAL)), scope);
/*
* Not testing the ordering of results here because it's not what we are interested in:
* we just want to check that fields are correctly detected as compatible,
* that no exception is thrown and that the query is correctly executed on all indexes
* with no silent error (HSEARCH-4173).
*/
assertThatQuery(query).hasDocRefHitsAnyOrder(b -> {
b.doc(missingFieldIndex.typeName(), MISSING_FIELD_INDEX_DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_2);
b.doc(mainIndex.typeName(), DOCUMENT_3);
});
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.types.FieldTypeDescriptor in project hibernate-search by hibernate.
the class FieldSearchSortTypeCheckingAndConversionIT method multiIndex_withMissingFieldIndex_dslConverterDisabled.
@Test
@TestForIssue(jiraKey = "HSEARCH-4173")
public void multiIndex_withMissingFieldIndex_dslConverterDisabled() {
assumeTrue("This backend doesn't support sorts on a field of type '" + fieldTypeDescriptor + "' that is missing from some of the target indexes.", TckConfiguration.get().getBackendFeatures().supportsFieldSortWhenFieldMissingInSomeTargetIndexes(fieldTypeDescriptor.getJavaType()));
StubMappingScope scope = mainIndex.createScope(missingFieldIndex);
SearchQuery<DocumentReference> query;
String fieldPath = getFieldPath();
query = matchNonEmptyQuery(f -> f.field(fieldPath).asc().missing().use(getSingleValueForMissingUse(BEFORE_DOCUMENT_1_ORDINAL), ValueConvert.NO), scope);
/*
* Not testing the ordering of results here because it's not what we are interested in:
* we just want to check that fields are correctly detected as compatible,
* that no exception is thrown and that the query is correctly executed on all indexes
* with no silent error (HSEARCH-4173).
*/
assertThatQuery(query).hasDocRefHitsAnyOrder(b -> {
b.doc(missingFieldIndex.typeName(), MISSING_FIELD_INDEX_DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_2);
b.doc(mainIndex.typeName(), DOCUMENT_3);
});
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.types.FieldTypeDescriptor in project hibernate-search by hibernate.
the class FieldSearchSortTypeCheckingAndConversionIT method multiIndex_withMissingFieldIndex_dslConverterEnabled.
@Test
@TestForIssue(jiraKey = "HSEARCH-4173")
public void multiIndex_withMissingFieldIndex_dslConverterEnabled() {
assumeTrue("This backend doesn't support sorts on a field of type '" + fieldTypeDescriptor + "' that is missing from some of the target indexes.", TckConfiguration.get().getBackendFeatures().supportsFieldSortWhenFieldMissingInSomeTargetIndexes(fieldTypeDescriptor.getJavaType()));
StubMappingScope scope = mainIndex.createScope(missingFieldIndex);
SearchQuery<DocumentReference> query;
String fieldPath = getFieldPath();
query = matchNonEmptyQuery(f -> f.field(fieldPath).asc().missing().use(getSingleValueForMissingUse(BEFORE_DOCUMENT_1_ORDINAL)), scope);
/*
* Not testing the ordering of results here because it's not what we are interested in:
* we just want to check that fields are correctly detected as compatible,
* that no exception is thrown and that the query is correctly executed on all indexes
* with no silent error (HSEARCH-4173).
*/
assertThatQuery(query).hasDocRefHitsAnyOrder(b -> {
b.doc(missingFieldIndex.typeName(), MISSING_FIELD_INDEX_DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_2);
b.doc(mainIndex.typeName(), DOCUMENT_3);
});
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.types.FieldTypeDescriptor in project hibernate-search by hibernate.
the class FieldSortTypeCheckingAndConversionIT method multiIndex_withMissingFieldIndex_dslConverterDisabled.
@Test
@TestForIssue(jiraKey = "HSEARCH-4173")
public void multiIndex_withMissingFieldIndex_dslConverterDisabled() {
assumeTrue("This backend doesn't support sorts on a field of type '" + fieldTypeDescriptor + "' that is missing from some of the target indexes.", TckConfiguration.get().getBackendFeatures().supportsFieldSortWhenFieldMissingInSomeTargetIndexes(fieldTypeDescriptor.getJavaType()));
StubMappingScope scope = mainIndex.createScope(missingFieldIndex);
SearchQuery<DocumentReference> query;
String fieldPath = getFieldPath();
query = matchNonEmptyQuery(f -> f.field(fieldPath).asc().missing().use(getSingleValueForMissingUse(BEFORE_DOCUMENT_1_ORDINAL), ValueConvert.NO), scope);
/*
* Not testing the ordering of results here because it's not what we are interested in:
* we just want to check that fields are correctly detected as compatible,
* that no exception is thrown and that the query is correctly executed on all indexes
* with no silent error (HSEARCH-4173).
*/
assertThatQuery(query).hasDocRefHitsAnyOrder(b -> {
b.doc(missingFieldIndex.typeName(), MISSING_FIELD_INDEX_DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_1);
b.doc(mainIndex.typeName(), DOCUMENT_2);
b.doc(mainIndex.typeName(), DOCUMENT_3);
});
}
Aggregations