lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shailendra Mudgal" <mudgal.shailen...@gmail.com>
Subject Re: Improving Index Search Performance
Date Wed, 26 Mar 2008 09:12:32 GMT
Hi All,

Thanks for your reply. I would like to mention here is that the companyId is
a multivalued field. I tried paul's suggestions also but doesn't seem much
gain. Still the searcher.doc() method is taking almost the same amount of
time.


> you can use the FieldCache to lookup the compnayId for each doc.  on the
> aggregate this will most likely be much faster then accessing the stored
> fields.
>

As i understand the FieldCache, it will load fields for all the documents.
But in our case we want to load fields only for the matched documents.

Here is the code snippet after using the BitSet:


               *public Map getIds() {
                    MapFieldSelector selector = new MapFieldSelector(new
String[] {COMPANY_ID, ID});
                    for(int i=bitSet.nextSetBit(0); i>=0; i=
bitSet.nextSetBit(i+1)) {
                        try {
                            doc = searcher.doc(i, selector);
                            mappedCompanies = doc.getValues(COMPANY_ID);
                        } catch (CorruptIndexException e) {
                        } catch (IOException e) {
                        }
                    }
                    return results;
                }
*
Any suggestions for further optimizing the code.

Thanks and Regards,
Vipin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message