lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mohammad Norouzi" <>
Subject Re: searching a date range
Date Mon, 05 Mar 2007 06:51:30 GMT
you know, actually we dont indexed this field as Date. we always use string
instead of Date type because we use both Hijri date and Gregorian date so if
we put a Hijri date the DateField not work properly. that is why we index
such this field as String.

as I read the javadoc for QueryParser, it is said to inherits a class from
QueryParser and override its setQueryRange() method. I think in my case I
should do it. what do you think?

On 3/5/07, Chris Hostetter <> wrote:
> : > I even removed "/" from my query but still not working good.
> : > Do I have to index dates issues without "/"?
> : > now in the index I have 1978/05/05 should I change it to 19780505?
> :
> : Unless I'm mistaken (and it's been ages since I looked at the date stuff
> : myself) this sort of thing only works if you use DateField to format the
> : field values.
> correct ... please consult the class level javadocs for the QUeryParser
> which talk somewhat extensively about dates in range queries nad using
> DateField vs DateTools.
> in general, if searhing on "admitDate:1978/05/05" is working ofr you, then
> a range search with the same format probably won't work for you ...
> becuase when query parser sees a the range syntax on something that it can
> parse as a date, it's going to expect the indexed format to be in a very
> specific format .. you have a lot of control over what format it expects,
> but "1978/05/05" isn't one of them.
> looking at the query.toString() from the QueryParser result will help you
> understand what it's trying to search on.
> -Hoss
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:


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