I'm pretty sure you can search UN_TOKENIZED fields, just be sure the analyzers you use for querying don't break your query input up.... The javadoc implies so (for the Sort class...)
************** he fields used to determine sort order must be carefully chosen. Documents must contain a single term in such a field, and the value of the term should indicate the document's relative position in a given sort order. The field must be indexed, but should not be tokenized, and does not need to be stored (unless you happen to want it back with the rest of your document data). In other words: document.add (new Field ("byNumber", Integer.toString(x), Field.Store.NO, Field.Index.UN_TOKENIZED)); ******************* Best Erick On 1/10/07, moraleslos <[EMAIL PROTECTED]> wrote:
From what I understand about Lucene, one can only sort on a field that is indexed but not tokenized (and hence not searchable). I have content that can be searched by keyword and also a date string, e.g. text:Lucene AND date:[2007-01-01 TO 2007-01-10] Since my date is searchable, I need to index + tokenize it. I would like to somehow return the hits sorted by date. Is there a workaround for this using Lucene? Thanks in advance! -los -- View this message in context: http://www.nabble.com/sort-on-a-searchable-field-tf2954961.html#a8265729 Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]