Mailing List Archive

DateField issues
I managed to index according to the date field no problem, but then
when I search using a date filter, the search is slightly slower and
the results do not seem to be constraint by any date.

The following code segment shows how I'm searching :
(I basically want all the records indexed with dates after "start" )


// Current time in mills
long currInMills = DateField.MAX_DATE_STRING();
// startTime = currInMills - ( a number of days * ( length of a day in
mills) )
long start = currInMills - ( freshness * dayInMillis ) ;

Query query = QueryParser.parse(queryString, "title" , new
SuperStandardAnalyzer());
filter = new DateFilter.After("datemodified", start) ;
Searcher searcher = new IndexSearcher(indexPath);
Hits hits = searcher.search(query,filter);


I know I'm indexing the dates correctly because I encode them then I decode
them and print them
and they seem to be accurate, just to be sure time in mills is measured
since 01 01 1970 right ?

if anyone has any idea why this isn't working please feel free to contribute
, oh and if you're wondering
yes I also tried the date filter with start and end .. nada



Nader S. Henein
Bayt.com , Dubai Internet City
Tel. +9714 3911900
Fax. +9714 3911915
GSM. +9715 05659557
www.bayt.com


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: DateField issues [ In reply to ]
Nader,

I found that RangeQuery works fine with the dates. I always felt that the
DateFilter could be slow on a large file. If you think about it, it should
be fine so long as you normalize the data your putting into the high/low
terms of the RangeQuery. I also made this work with numeric fields as well.

James

-----Original Message-----
From: Nader S. Henein [mailto:nsh@bayt.net]
Sent: Thursday, June 13, 2002 9:29 AM
To: lucene-user@jakarta.apache.org
Subject: DateField issues



I managed to index according to the date field no problem, but then
when I search using a date filter, the search is slightly slower and
the results do not seem to be constraint by any date.

The following code segment shows how I'm searching :
(I basically want all the records indexed with dates after "start" )


// Current time in mills
long currInMills = DateField.MAX_DATE_STRING();
// startTime = currInMills - ( a number of days * ( length of a day in
mills) )
long start = currInMills - ( freshness * dayInMillis ) ;

Query query = QueryParser.parse(queryString, "title" , new
SuperStandardAnalyzer());
filter = new DateFilter.After("datemodified", start) ;
Searcher searcher = new IndexSearcher(indexPath);
Hits hits = searcher.search(query,filter);


I know I'm indexing the dates correctly because I encode them then I decode
them and print them
and they seem to be accurate, just to be sure time in mills is measured
since 01 01 1970 right ?

if anyone has any idea why this isn't working please feel free to contribute
, oh and if you're wondering
yes I also tried the date filter with start and end .. nada



Nader S. Henein
Bayt.com , Dubai Internet City
Tel. +9714 3911900
Fax. +9714 3911915
GSM. +9715 05659557
www.bayt.com


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

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