lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien Grand <jpou...@gmail.com>
Subject Re: Multiple values for a field: Stable order?
Date Thu, 26 May 2016 07:46:42 GMT
It depends which Lucene API you are talking to. For the inverted index, the
order should be irrelevant. For doc values, Lucene will return values in
sorted order per document. Finally stored fields will return values in the
same order as they have been added to the Document at index-time (we do not
guarantee this across different field names, but for values that are
associated with the same field name, I think this is fine to assume).

Le mer. 25 mai 2016 à 22:00, Daniel Bigham <danielb@wolfram.com> a écrit :

> I've recently become aware that Lucene allows duplicate field names,
> which essentially allows multiple values to be associated with a field.
>
> A follow-up question is whether the order of the values is maintained...
> if I store the values "A", "B", and then "C" in a given field for a
> document, and then I later get the values via:
>
> IndexableField[] f = doc.getFields(fieldName);
> for (int i = 0; i < f.length; ++i)
> {
>      ...
> }
>
> ... will the values come back in the same order I added them?
>
> Thanks,
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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