You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/01/05 22:39:21 UTC

[GitHub] [lucene-solr] dsmiley commented on a change in pull request #2159: SOLR-14923: Nested docs indexing performance.

dsmiley commented on a change in pull request #2159:
URL: https://github.com/apache/lucene-solr/pull/2159#discussion_r552241596



##########
File path: solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformer.java
##########
@@ -76,6 +87,37 @@ public String getName()  {
   @Override
   public boolean needsSolrIndexSearcher() { return true; }
 
+  @Override
+  public String[] getExtraRequestFields() {
+    return extraRequestedFields;
+  }
+
+  private int getPrevRootGivenFilter(LeafReaderContext leafReaderContext, int segRootId) throws IOException {
+    final BitSet segParentsBitSet = parentsFilter.getBitSet(leafReaderContext);
+    if (segParentsBitSet != null) {
+      return segRootId == 0 ? -1 : segParentsBitSet.prevSetBit(segRootId - 1);
+    }
+    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
+        "Parent filter '" + parentsFilter + "' doesn't match any parent documents");
+  }
+
+  private int getPrevRootGivenId(LeafReaderContext leafReaderContext, int segRootId,
+                                 BytesRef idBytes) throws IOException {
+    final LeafReader reader = leafReaderContext.reader();
+    final Terms terms = reader.terms(IndexSchema.ROOT_FIELD_NAME); // never returns null here
+    final TermsEnum iterator = terms.iterator();
+    if (iterator.seekExact(idBytes)) {
+      PostingsEnum docs = iterator.postings(null, PostingsEnum.NONE);
+      docs = BitsFilteredPostingsEnum.wrap(docs, reader.getLiveDocs());
+      int id = docs.nextDoc();

Review comment:
       Wrong; iterator.postings() never returns null -- so says its documentation.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org