lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From WolfgangTäger <wtae...@epo.org>
Subject Re: Performance problem
Date Thu, 25 Aug 2005 13:19:04 GMT
Hello again,

Since my code field does not contain strings, I've a little problem with 
using
getStrings


I probably have to use

FieldCache.StringIndex codes = 
FieldCache.DEFAULT.getStringIndex(indexReader, "code");

I however do not understand how to find the code of index i in the 
results.

I tried something like 
        codes.lookup[codes.order[hits.scoreDocs[i].doc]]

Is this correct ?

Wolfgang



If you have enough RAM, a FieldCache would make this very fast.

TopDocs hits = searcher.search(query, (Filter)null, 2000);
String[] codes = FieldCache.DEFAULT.getStrings(indexReader, "code");
for (int i = 0; i < hits.scoreDocs.length; i++) {
   String code = codes[hits.scoreDocs[i].doc];
   ...
}

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