Skip to content

Commit d7e9595

Browse files
committed
HSEARCH-3909 Fix confusing field names in AbstractHighlighterIT
1 parent a6fe09f commit d7e9595

File tree

1 file changed

+19
-19
lines changed
  • integrationtest/backend/tck/src/main/java/org/hibernate/search/integrationtest/backend/tck/search/highlight

1 file changed

+19
-19
lines changed

integrationtest/backend/tck/src/main/java/org/hibernate/search/integrationtest/backend/tck/search/highlight/AbstractHighlighterIT.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ static void setup() {
9999
d.addValue( "string", "<body><h1>This is a Heading</h1><p>This is a paragraph</p></body>" );
100100
} )
101101
.add( "9", d -> {
102-
d.addObject( "nested" )
103-
.addValue( "nestedString", "The quick brown fox jumps right over the little lazy dog" );
102+
d.addObject( "objectFlattened" )
103+
.addValue( "string", "The quick brown fox jumps right over the little lazy dog" );
104104
d.addValue( "notAnalyzedString", "The quick brown fox jumps right over the little lazy dog" );
105105
d.addValue( "multiValuedString", "The quick brown fox jumps right over the little lazy dog" );
106106
d.addValue( "multiValuedString", "This string mentions a dog" );
@@ -496,7 +496,7 @@ void noMatchSizeMultiField() {
496496
SearchQuery<List<String>> highlights = scope.query().select(
497497
f -> f.highlight( "multiValuedString" )
498498
)
499-
.where( f -> f.match().field( "nested.nestedString" ).matching( "dog" ) )
499+
.where( f -> f.match().field( "objectFlattened.string" ).matching( "dog" ) )
500500
// set to max possible value so that all highlighters can return something:
501501
.highlighter( h -> highlighter( h ).noMatchSize( Integer.MAX_VALUE ) )
502502
.toQuery();
@@ -634,13 +634,13 @@ protected List<String> multivaluedFieldResult() {
634634
}
635635

636636
@Test
637-
void nestedField() {
637+
void inObjectField() {
638638
StubMappingScope scope = index.createScope();
639639

640640
SearchQuery<List<String>> highlights = scope.query().select(
641-
f -> f.highlight( "nested.nestedString" )
641+
f -> f.highlight( "objectFlattened.string" )
642642
)
643-
.where( f -> f.match().field( "nested.nestedString" ).matching( "fox" ) )
643+
.where( f -> f.match().field( "objectFlattened.string" ).matching( "fox" ) )
644644
.highlighter( h -> highlighter( h ) )
645645
.toQuery();
646646

@@ -653,13 +653,13 @@ void nestedField() {
653653
}
654654

655655
@Test
656-
void nestedFieldWildcard() {
656+
void inObjectFieldFieldWildcard() {
657657
StubMappingScope scope = index.createScope();
658658

659659
SearchQuery<List<String>> highlights = scope.query().select(
660-
f -> f.highlight( "nested.nestedString" )
660+
f -> f.highlight( "objectFlattened.string" )
661661
)
662-
.where( f -> f.wildcard().field( "nested.nestedString" ).matching( "fo?" ) )
662+
.where( f -> f.wildcard().field( "objectFlattened.string" ).matching( "fo?" ) )
663663
.highlighter( h -> highlighter( h ) )
664664
.toQuery();
665665

@@ -773,10 +773,10 @@ void multipleIndexesScopeIncompatibleTypes() {
773773
}
774774

775775
@Test
776-
void multipleIndexesScopeIncompatibleTypesNested() {
776+
void multipleIndexesScopeIncompatibleTypesInObjectField() {
777777
assertThatThrownBy(
778778
() -> index.createScope( notMatchingTypeIndex ).query().select(
779-
f -> f.highlight( "nested.nestedString" )
779+
f -> f.highlight( "objectFlattened.string" )
780780
).where( f -> f.matchAll() )
781781
.toQuery()
782782
).isInstanceOf( SearchException.class )
@@ -926,10 +926,10 @@ private List<List<String>> phraseMatchingResult() {
926926
private static class IndexBinding {
927927
final IndexFieldReference<String> stringField;
928928
final IndexFieldReference<String> anotherStringField;
929-
final IndexFieldReference<String> nestedString;
929+
final IndexFieldReference<String> objectFlattenedString;
930930
final IndexFieldReference<String> notAnalyzedString;
931931
final IndexFieldReference<String> multiValuedString;
932-
final IndexObjectFieldReference nested;
932+
final IndexObjectFieldReference objectFlattened;
933933
final IndexFieldReference<String> stringNoTermVectorField;
934934
final IndexFieldReference<Integer> intField;
935935
final IndexFieldReference<String> stringNotProjectableField;
@@ -947,10 +947,10 @@ private static class IndexBinding {
947947
.termVector( TermVector.WITH_POSITIONS_OFFSETS )
948948
).toReference();
949949

950-
IndexSchemaObjectField objectField = root.objectField( "nested" );
951-
nested = objectField.toReference();
950+
IndexSchemaObjectField objectField = root.objectField( "objectFlattened" );
951+
objectFlattened = objectField.toReference();
952952

953-
nestedString = objectField.field( "nestedString", f -> f.asString()
953+
objectFlattenedString = objectField.field( "string", f -> f.asString()
954954
.highlightable( Collections.singletonList( Highlightable.ANY ) )
955955
.analyzer( DefaultAnalysisDefinitions.ANALYZER_STANDARD_ENGLISH.name )
956956
).toReference();
@@ -1017,15 +1017,15 @@ private IndexFieldReference<String> createString(String name, IndexSchemaObjectF
10171017
private static class NotMatchingTypeIndexBinding {
10181018
final IndexFieldReference<Integer> stringField;
10191019
final IndexObjectFieldReference nested;
1020-
final IndexFieldReference<LocalDate> nestedString;
1020+
final IndexFieldReference<LocalDate> objectFlattenedString;
10211021

10221022
NotMatchingTypeIndexBinding(IndexSchemaElement root) {
10231023
stringField = root.field( "string", f -> f.asInteger() ).toReference();
10241024

1025-
IndexSchemaObjectField objectField = root.objectField( "nested" );
1025+
IndexSchemaObjectField objectField = root.objectField( "objectFlattened" );
10261026
nested = objectField.toReference();
10271027

1028-
nestedString = objectField.field( "nestedString", f -> f.asLocalDate()
1028+
objectFlattenedString = objectField.field( "string", f -> f.asLocalDate()
10291029
.projectable( Projectable.YES )
10301030
).toReference();
10311031
}

0 commit comments

Comments
 (0)