Hey John, My understanding is that if you add a field with the same name as a previous field added, you will be overwriting the value stored in the document.
So if you add: doc.add(Field.Text("sequence", "1")); doc.add(Field.Text("sequence", "2")); doc.add(Field.Text("sequence", "3")); Afterwards, the field sequence would hold a value of 3. I'm guessing that by now you have already tested that. -Gus -----Original Message----- From: John Powers [mailto:[EMAIL PROTECTED] Sent: Monday, November 21, 2005 3:01 PM To: java-user@lucene.apache.org Subject: 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]