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