lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Goetz <br...@quiotix.com>
Subject Re: Bug? QueryParser may not correctly interpret RangeQuery text
Date Sat, 01 Jun 2002 23:26:28 GMT
> 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. 

yyyy-mm-dd seems to be the most common and sensible date format.  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 ].  

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


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