lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter M Cipollone" <...@bihvhar.com>
Subject Re: Browse by Letter within a Category
Date Mon, 12 Jul 2004 15:58:27 GMT
You can use
http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/spans/SpanFirstQuery.html

Pete

----- Original Message ----- 
From: "O'Hare, Thomas" <tohare@akamai.com>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>;
<daniel.naber@t-online.de>
Sent: Monday, July 12, 2004 11:48 AM
Subject: RE: Browse by Letter within a Category


Thank you for the suggestion. I implemented what you recommended and now
having it working. I'm sorting on the first word in the title.

Does Lucene have a "beginning of line" query syntax, like the regular
expression ^ symbol? For example,

title:^A*


What is the best way to sort by a date? I currently have a date field
that is used for searching in the format YYYYMMDD as a Field.Keyword.

Thanks,
Tom

  _____

From: Daniel Naber [mailto:daniel.naber@t-online.de]
Sent: Friday, July 09, 2004 4:34 AM
To: Lucene Users List
Subject: Re: Browse by Letter within a Category



On Friday 09 July 2004 04:27, O'Hare, Thomas wrote:

> Searcher.search("category:\"Products\" AND title:\"A*\"", new
> Sort("title"));

You can only sort on fields which are not tokenized I think. So add an
extra
field with the title, but untokenized, just for sorting. Also, "A*"
might
slow down the query execution so you might want to add another field
which
just contains the first letter so there's no need for the asterisk.

Regards
 Daniel


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





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


Mime
View raw message