@@ -99,8 +99,8 @@ static void setup() {
99
99
d .addValue ( "string" , "<body><h1>This is a Heading</h1><p>This is a paragraph</p></body>" );
100
100
} )
101
101
.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" );
104
104
d .addValue ( "notAnalyzedString" , "The quick brown fox jumps right over the little lazy dog" );
105
105
d .addValue ( "multiValuedString" , "The quick brown fox jumps right over the little lazy dog" );
106
106
d .addValue ( "multiValuedString" , "This string mentions a dog" );
@@ -496,7 +496,7 @@ void noMatchSizeMultiField() {
496
496
SearchQuery <List <String >> highlights = scope .query ().select (
497
497
f -> f .highlight ( "multiValuedString" )
498
498
)
499
- .where ( f -> f .match ().field ( "nested.nestedString " ).matching ( "dog" ) )
499
+ .where ( f -> f .match ().field ( "objectFlattened.string " ).matching ( "dog" ) )
500
500
// set to max possible value so that all highlighters can return something:
501
501
.highlighter ( h -> highlighter ( h ).noMatchSize ( Integer .MAX_VALUE ) )
502
502
.toQuery ();
@@ -634,13 +634,13 @@ protected List<String> multivaluedFieldResult() {
634
634
}
635
635
636
636
@ Test
637
- void nestedField () {
637
+ void inObjectField () {
638
638
StubMappingScope scope = index .createScope ();
639
639
640
640
SearchQuery <List <String >> highlights = scope .query ().select (
641
- f -> f .highlight ( "nested.nestedString " )
641
+ f -> f .highlight ( "objectFlattened.string " )
642
642
)
643
- .where ( f -> f .match ().field ( "nested.nestedString " ).matching ( "fox" ) )
643
+ .where ( f -> f .match ().field ( "objectFlattened.string " ).matching ( "fox" ) )
644
644
.highlighter ( h -> highlighter ( h ) )
645
645
.toQuery ();
646
646
@@ -653,13 +653,13 @@ void nestedField() {
653
653
}
654
654
655
655
@ Test
656
- void nestedFieldWildcard () {
656
+ void inObjectFieldFieldWildcard () {
657
657
StubMappingScope scope = index .createScope ();
658
658
659
659
SearchQuery <List <String >> highlights = scope .query ().select (
660
- f -> f .highlight ( "nested.nestedString " )
660
+ f -> f .highlight ( "objectFlattened.string " )
661
661
)
662
- .where ( f -> f .wildcard ().field ( "nested.nestedString " ).matching ( "fo?" ) )
662
+ .where ( f -> f .wildcard ().field ( "objectFlattened.string " ).matching ( "fo?" ) )
663
663
.highlighter ( h -> highlighter ( h ) )
664
664
.toQuery ();
665
665
@@ -773,10 +773,10 @@ void multipleIndexesScopeIncompatibleTypes() {
773
773
}
774
774
775
775
@ Test
776
- void multipleIndexesScopeIncompatibleTypesNested () {
776
+ void multipleIndexesScopeIncompatibleTypesInObjectField () {
777
777
assertThatThrownBy (
778
778
() -> index .createScope ( notMatchingTypeIndex ).query ().select (
779
- f -> f .highlight ( "nested.nestedString " )
779
+ f -> f .highlight ( "objectFlattened.string " )
780
780
).where ( f -> f .matchAll () )
781
781
.toQuery ()
782
782
).isInstanceOf ( SearchException .class )
@@ -926,10 +926,10 @@ private List<List<String>> phraseMatchingResult() {
926
926
private static class IndexBinding {
927
927
final IndexFieldReference <String > stringField ;
928
928
final IndexFieldReference <String > anotherStringField ;
929
- final IndexFieldReference <String > nestedString ;
929
+ final IndexFieldReference <String > objectFlattenedString ;
930
930
final IndexFieldReference <String > notAnalyzedString ;
931
931
final IndexFieldReference <String > multiValuedString ;
932
- final IndexObjectFieldReference nested ;
932
+ final IndexObjectFieldReference objectFlattened ;
933
933
final IndexFieldReference <String > stringNoTermVectorField ;
934
934
final IndexFieldReference <Integer > intField ;
935
935
final IndexFieldReference <String > stringNotProjectableField ;
@@ -947,10 +947,10 @@ private static class IndexBinding {
947
947
.termVector ( TermVector .WITH_POSITIONS_OFFSETS )
948
948
).toReference ();
949
949
950
- IndexSchemaObjectField objectField = root .objectField ( "nested " );
951
- nested = objectField .toReference ();
950
+ IndexSchemaObjectField objectField = root .objectField ( "objectFlattened " );
951
+ objectFlattened = objectField .toReference ();
952
952
953
- nestedString = objectField .field ( "nestedString " , f -> f .asString ()
953
+ objectFlattenedString = objectField .field ( "string " , f -> f .asString ()
954
954
.highlightable ( Collections .singletonList ( Highlightable .ANY ) )
955
955
.analyzer ( DefaultAnalysisDefinitions .ANALYZER_STANDARD_ENGLISH .name )
956
956
).toReference ();
@@ -1017,15 +1017,15 @@ private IndexFieldReference<String> createString(String name, IndexSchemaObjectF
1017
1017
private static class NotMatchingTypeIndexBinding {
1018
1018
final IndexFieldReference <Integer > stringField ;
1019
1019
final IndexObjectFieldReference nested ;
1020
- final IndexFieldReference <LocalDate > nestedString ;
1020
+ final IndexFieldReference <LocalDate > objectFlattenedString ;
1021
1021
1022
1022
NotMatchingTypeIndexBinding (IndexSchemaElement root ) {
1023
1023
stringField = root .field ( "string" , f -> f .asInteger () ).toReference ();
1024
1024
1025
- IndexSchemaObjectField objectField = root .objectField ( "nested " );
1025
+ IndexSchemaObjectField objectField = root .objectField ( "objectFlattened " );
1026
1026
nested = objectField .toReference ();
1027
1027
1028
- nestedString = objectField .field ( "nestedString " , f -> f .asLocalDate ()
1028
+ objectFlattenedString = objectField .field ( "string " , f -> f .asLocalDate ()
1029
1029
.projectable ( Projectable .YES )
1030
1030
).toReference ();
1031
1031
}
0 commit comments