lucene - Can I know what index MultiReader got a document from? -


i have multireader connected several indexes.

after run query , results, there way know index result from?

i know it's not multireader for. still need this.

you can if 1 create multireader instance.

you can extend class , implement required functionality. basecompositereader (super type of multireader) has readerindex() , getsequentialsubreaders() methods. following code should work:

public static class mymultireader extends multireader {      public mymultireader(indexreader... subreaders) throws ioexception {         super(subreaders);     }      public indexreader getreaderfordocument(int docid) {         return getsequentialsubreaders().get(readerindex(docid));     } } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -