It might be faster to use FieldCache.DEFAULT.getStrings(reader,
"empid"), assuming empid is indexed but is not analyzed (or always
analyzes to one token).
Though, that then persists the resulting array in the FieldCache.
We are wanting to create "column stride fields" (LUCENE-1231) to make
accessing a single field's value for all docs fast... but it'll be
some time before that's in.
Mike
Donna L Gresh wrote:
Thanks-
Yes in my use-case there are never any deleted documents when the
search
is run- (deletion takes place in a pre-processing stage)
Toke Eskildsen <t...@statsbiblioteket.dk> wrote on 12/17/2008 08:16:31
AM:
On Mon, 2008-12-08 at 15:17 +0100, Donna L Gresh wrote:
public Vector getIndexIds() throws Exception {
Vector vec = new Vector();
IndexReader ireader =
IndexReader.open(directoryName);
int numdocs = ireader.numDocs();
for (int i=0; i<numdocs; i++) {
Document doc = ireader.document(i);
It's probably best to perform a check for ireader.isDeleted(i) here,
unless the index never contains deleted documents.
Field field = doc.getField("empid");
if (field==null) {
continue;
}
String contents = field.stringValue();
vec.add(contents);
}
return vec;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org