lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: DateFilter and NullPointerException
Date Mon, 17 Dec 2001 16:53:17 GMT
Hm, do you know which line in DateFilter.java this NPE comes from?
Could you try compiling Lucene with the -g switch so that we can see
the line numbers in the exception stack trace?

If you want you can also submit a bug report at
http://nagoya.apache.org/bugzilla/

Thanks,
Otis

--- Uroš_Jurglič <jurglic@parsek.net> wrote:
> I'm having a problem when using Query and DateFilter for a search. If
> I
> create DateFilter with DateFilter.After with current time&date as
> parameter,
> then I get NullPointerException when executing search
> (Searcher.search(Query, DateFilter)). Had anyone experienced
> something like
> that? If I set time just a bit in past, it returns empty hits which
> is how
> it should behave all the time.
> 
> code snipet:
> 	// I have java files as documents, consisting of content
> (Field.Text()) and modified (Field.Keyword())
> 	Query q = new WildcardQuery(new Term("content", "packag*"));
> 	DateFilter df = DateFilter.After("modified",
> Calendar.getInstance().getTime());
> 	Searcher searcher = new IndexSearcher(path);
> 	Hits hits = searcher.search(q, df);	// line 66
> 
> exception:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.lucene.search.DateFilter.bits(Unknown Source)
>         at org.apache.lucene.search.IndexSearcher.search(Unknown
> Source)
>         at org.apache.lucene.search.Hits.getMoreDocs(Unknown Source)
>         at org.apache.lucene.search.Hits.<init>(Unknown Source)
>         at org.apache.lucene.search.Searcher.search(Unknown Source)
>         at Search.main(Search.java:66)
> 
> Regards,
> Uros.
> 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

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


Mime
View raw message