siddharthteotia commented on a change in pull request #5177: Lucene DocId to 
PinotDocId cache
URL: https://github.com/apache/incubator-pinot/pull/5177#discussion_r400574934
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/segment/index/readers/text/LuceneTextIndexReader.java
 ##########
 @@ -142,18 +152,17 @@ public MutableRoaringBitmap getDocIds(Object value) {
    *
    * TODO: Explore optimizing this path to avoid building the second bitmap
    */
-  private MutableRoaringBitmap getPinotDocIds(MutableRoaringBitmap 
luceneDocIds) {
+  private MutableRoaringBitmap 
getPinotDocIdsFromMappingFile(MutableRoaringBitmap luceneDocIds) {
     IntIterator luceneDocIDIterator = luceneDocIds.getIntIterator();
     MutableRoaringBitmap actualDocIDs = new MutableRoaringBitmap();
     try {
       while (luceneDocIDIterator.hasNext()) {
         int luceneDocId = luceneDocIDIterator.next();
-        Document document = _indexSearcher.doc(luceneDocId);
-        int pinotDocId = 
Integer.valueOf(document.get(LuceneTextIndexCreator.LUCENE_INDEX_DOC_ID_COLUMN_NAME));
+        int pinotDocId = _docIdReaderWriter.getInt(luceneDocId * 
Integer.BYTES);
         actualDocIDs.add(pinotDocId);
       }
     } catch (Exception e) {
-      throw new RuntimeException("Error: failed while retrieving document from 
index: " + e);
+      throw new RuntimeException("Error: failed while retrieving pinot doc id 
from mapping file: " + e);
 
 Review comment:
   done

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to