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 John Powers <jp...@configureone.com> on 2005/11/22 00:01:14 UTC

Custom sort/basic question

If I add keywords to a document at the same time, will they stay in that
order?


Create New doc A
doc.add(Field.Text("category", "toys"));
doc.add(Field.Text("sequence", "235"));

doc.add(Field.Text("category", "bears"));
doc.add(Field.Text("sequence", "63"));

doc.add(Field.Text("category", "trucks"));
doc.add(Field.Text("sequence", "56"));



Create New doc B
doc.add(Field.Text("category", "computers"));
doc.add(Field.Text("sequence", "7"));

doc.add(Field.Text("category", "bears"));
doc.add(Field.Text("sequence", "12"));

doc.add(Field.Text("category", "trucks"));
doc.add(Field.Text("sequence", "772"));

I want to sort on the right sequence number, so I need to find the right
category.   If I iterator through doc.getFields( category) and find the
category I want is #2, then can I get sequence #2 and know its the right
one?

Or does everything get jumbled up in the indexing process?


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