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 Chris Lu <ch...@gmail.com> on 2009/07/07 21:36:19 UTC

consistent ordering of multi-values in a field

Hi,

When using org.apache.lucene.document.Document.getValues(fieldName), 
will it be the same order that I added to the document?

Suppose I add field1~value1, field1~value2, field2~value3 to a document. 
Later, maybe after several rounds of merging, will I always get an array 
of {value1,value2}?

--
Chris Lu
-------------------------
Instant Scalable Full-Text Search On Any Database/Application
site: http://www.dbsight.net
demo: http://search.dbsight.com
Lucene Database Search in 3 minutes: http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes
DBSight customer, a shopping comparison site, (anonymous per request) got 2.6 Million Euro funding!


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: consistent ordering of multi-values in a field

Posted by Michael McCandless <lu...@mikemccandless.com>.
On Tue, Jul 7, 2009 at 3:49 PM, Chris Lu<ch...@gmail.com> wrote:

> Will the ordering of fields be preserved also?

Alas, no.

This used to be true (before 2.3), but 2.3 broke it (mea culpa --
sorry!), and we're now going to fix it again in 2.9.  LUCENE-1727 is
tracking this.

So in 2.9 it will be true, but in 2.3.x & 2.4.x it isn't.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: consistent ordering of multi-values in a field

Posted by Chris Lu <ch...@gmail.com>.
That's great and thanks for the super fast answer!

Another question if not thread-hijacking:
Will the ordering of fields be preserved also?

--
Chris Lu
-------------------------
Instant Scalable Full-Text Search On Any Database/Application
site: http://www.dbsight.net
demo: http://search.dbsight.com
Lucene Database Search in 3 minutes:
http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes
DBSight customer, a shopping comparison site, (anonymous per request) got
2.6 Million Euro funding!




Michael McCandless wrote:
> Yes, order within the same field name should be preserved.
>
> Mike
>
> On Tue, Jul 7, 2009 at 3:36 PM, Chris Lu<ch...@gmail.com> wrote:
>   
>> Hi,
>>
>> When using org.apache.lucene.document.Document.getValues(fieldName), will it
>> be the same order that I added to the document?
>>
>> Suppose I add field1~value1, field1~value2, field2~value3 to a document.
>> Later, maybe after several rounds of merging, will I always get an array of
>> {value1,value2}?
>>
>> --
>> Chris Lu
>> -------------------------
>> Instant Scalable Full-Text Search On Any Database/Application
>> site: http://www.dbsight.net
>> demo: http://search.dbsight.com
>> Lucene Database Search in 3 minutes:
>> http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes
>> DBSight customer, a shopping comparison site, (anonymous per request) got
>> 2.6 Million Euro funding!
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>   

Re: consistent ordering of multi-values in a field

Posted by Michael McCandless <lu...@mikemccandless.com>.
Yes, order within the same field name should be preserved.

Mike

On Tue, Jul 7, 2009 at 3:36 PM, Chris Lu<ch...@gmail.com> wrote:
> Hi,
>
> When using org.apache.lucene.document.Document.getValues(fieldName), will it
> be the same order that I added to the document?
>
> Suppose I add field1~value1, field1~value2, field2~value3 to a document.
> Later, maybe after several rounds of merging, will I always get an array of
> {value1,value2}?
>
> --
> Chris Lu
> -------------------------
> Instant Scalable Full-Text Search On Any Database/Application
> site: http://www.dbsight.net
> demo: http://search.dbsight.com
> Lucene Database Search in 3 minutes:
> http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes
> DBSight customer, a shopping comparison site, (anonymous per request) got
> 2.6 Million Euro funding!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org