lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <daniel.na...@t-online.de>
Subject Re: Browse by Letter within a Category
Date Mon, 12 Jul 2004 17:46:41 GMT
On Monday 12 July 2004 17:48, O'Hare, Thomas wrote:

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

If your title isn't tokenized the "^" is implicit, I think. As usual, if 
your title is tokenized you can easily add another field with the same 
value as title, but in untokenized form.

> 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. 

Lucene 1.4 added an IndexSearcher.search() method that takes a Sort() 
object which lets you sort by any field. Your date field can be used for 
that, as it has the correct format (because sorting it alphabetically will 
give you the right order already).

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
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