lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sévigny <sevi...@ajlsm.com>
Subject RE : org.apache.lucene.document.Document.getFields(String name) method?
Date Tue, 07 May 2002 06:36:19 GMT
Otis and others,

> Can you really add multiple fields with the same name to the index?

Sure.

> It sounds like indexed fields are just concatenated (into a single
> field with the given name).  I'm not sure what happens with 
> non-indexed
> fields.

True for tokenized fields, but not for untokenized fields. That's one of
the great features of Lucene.

> Does Lucene store multiple values for the same field name in 
> such a way
> that you can retrieve them separately?

Exactly. If you store "Reagan, Ronald" and then "Clinton, Bill" in an
"author" field, untokenized, and if you list the author field content
with an indexreader you will get both values independantly. It just
doesn't work with a Document object, where only the last value is
returned, unfortunately. Just because the lookup stops at the first
occurrence (which seems the last one indexed).

Martin


--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message