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