@@ -76,10 +76,8 @@ public void parseFieldWithChildren(
76
76
int totalDocs = fieldValueMaps .size ();
77
77
List <Document > childDocuments = new ArrayList <>(totalDocs );
78
78
79
- for (int i = 0 ; i < totalDocs ; i ++) {
80
- // Calculate offset as n-i (total docs minus current index)
81
- int offset = totalDocs - i ;
82
- childDocuments .add (createChildDocument (fieldValueMaps .get (i ), facetHierarchyPaths , offset ));
79
+ for (Map <String , Object > fieldValueMap : fieldValueMaps ) {
80
+ childDocuments .add (createChildDocument (fieldValueMap , facetHierarchyPaths ));
83
81
}
84
82
85
83
documentsContext .addChildDocuments (this .getName (), childDocuments );
@@ -91,18 +89,15 @@ public void parseFieldWithChildren(
91
89
*
92
90
* @param fieldValue the field value to include in the document
93
91
* @param facetHierarchyPaths facet hierarchy paths
94
- * @param offset the offset value to set for this document (n-i)
95
92
* @return lucene document
96
93
*/
97
94
private Document createChildDocument (
98
- Map <String , Object > fieldValue , List <List <String >> facetHierarchyPaths , int offset ) {
95
+ Map <String , Object > fieldValue , List <List <String >> facetHierarchyPaths ) {
99
96
Document document = new Document ();
100
97
parseFieldWithChildrenObject (document , List .of (fieldValue ), facetHierarchyPaths );
101
98
((IndexableFieldDef <?>) (IndexState .getMetaField (IndexState .NESTED_PATH )))
102
99
.parseDocumentField (document , List .of (this .getName ()), List .of ());
103
100
104
- ((IndexableFieldDef <?>) (IndexState .getMetaField (IndexState .NESTED_DOCUMENT_OFFSET )))
105
- .parseDocumentField (document , List .of (String .valueOf (offset )), List .of ());
106
101
return document ;
107
102
}
108
103
0 commit comments