You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Sam Hough <sa...@redspr.com> on 2004/03/16 16:00:52 UTC
order of Field objects within Document
Can anybody confirm that no guarantee is given that Fields retain
their order within a Document?
Version 1.3 seems to (although reversing the order
on occasion).
Doesnt seem likely but would be really useful for my current application ;)
Im just asking for clarification not a change of spec although a comment
in the JavaDoc for Document making it explicit might be handy.
Thanks
Sam
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
Re: order of Field objects within Document
Posted by Doug Cutting <cu...@apache.org>.
Sam Hough wrote:
> Can anybody confirm that no guarantee is given that Fields retain
> their order within a Document?
>
> Version 1.3 seems to (although reversing the order
> on occasion).
In 1.3 they're reversed as added, then reversed as read, so that hits
have fields in their added order. In 1.4 I've fixed this so that
they're always in order.
Doug
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
Re: order of Field objects within Document
Posted by Otis Gospodnetic <ot...@yahoo.com>.
I believe Document's fields() method will always give you the fields in
the same order for a given Document instance.
It may not be consistent accross multiple Document instances, though,
if you add Fields to your Document in a different order.
Otis
--- Sam Hough <sa...@redspr.com> wrote:
> Can anybody confirm that no guarantee is given that Fields retain
> their order within a Document?
>
> Version 1.3 seems to (although reversing the order
> on occasion).
>
> Doesnt seem likely but would be really useful for my current
> application ;)
> Im just asking for clarification not a change of spec although a
> comment
> in the JavaDoc for Document making it explicit might be handy.
>
> Thanks
>
> Sam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org