lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: sort on a searchable field
Date Wed, 10 Jan 2007 21:17:11 GMT
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 <moraleslos@hotmail.com> 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: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message