lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Bug? QueryParser may not correctly interpret RangeQuery text
Date Sun, 02 Jun 2002 09:04:16 GMT
Hello,

--- Brian Goetz <brian@quiotix.com> wrote:
> > I think we should have a Date format or formats and then convert
> them use
> > the DateField to the Lucene date format.
> 
> OK, Common date formats could include:
>   mm/dd/yy 
>   mm/dd/yyyy
>   yyyy-mm-dd (2002-05-01)
>   yyyy-mmm-dd (2002-May-01)
> 
> The latter two seem more sensible as they are non US-centric, but
> they
> use the dash character which is also used by the range brackets...
> My feeling is we should pick ONE, and stick to it.  
> 
> Maybe we should ditch - as the range operator -- if we want to
> support
> numeric ranges, that makes negative numbers more complicated too. 

Sounds like it would eliminate some headaches, yes.

> yyyy-mm-dd seems to be the most common and sensible date format.

I agree.

> How about:
> 
>  DATE = nnnn-nn-nn
>  NUMBER = n*
>  RANGE = [ DATE : DATE ] | [ NUMBER : NUMBER ]
> 
> An alternate, less parse-oriented approach would be this: 
>   RANGE = [ GOOP : GOOP ]
> where
>   GOOP = any string of letters/numbers not containing : or ].  

I'd go for the first one as it's more explicit.  However, perhaps the
second approach is more extensible?  If we come up with anything else
that can use range searches, besides dates and numbers, the latter
approach would not require query parser modification, if I understand
things correctly.

> Then we could use DateFormat to try to convert it into a date.  If
> DateFormat failed, we could try NumberFormat.
> 
> In any case, the analyzer should not be called.  
> 
> 
> Regarding Date and Number fields, I'd like to make the handling of
> indexed
> date and number fields more automatic.  Rather than calling 
>   DateField.dateToString() 
> and indexing that, I'd prefer to have appropriate static methods on
> Document
> like DateField(Date) and NumberField(int).  

DateField(Date) and NumberField(int) sounds right, but wouldn't Field
class make more sense?

Otis


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message