lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anders Nielsen" <and...@visator.dk>
Subject RE: Null pointer error when searching with DateFilter
Date Thu, 11 Oct 2001 15:11:25 GMT
Should I ever find a suitable woman (blind or drunk), our first offspring
shall proudly bear the name Scott..

In other words: thanks

regards,
Anders Nielsen

-----Original Message-----
From: Scott Ganyo [mailto:scott.ganyo@eTapestry.com]
Sent: 11. oktober 2001 17:07
To: 'lucene-dev@jakarta.apache.org'
Subject: RE: Null pointer error when searching with DateFilter


Yes, this is the exact error that I've addressed in the patch I'm about to
check in for SegmentTermEnum.

Scott

> -----Original Message-----
> From: Anders Nielsen [mailto:anders@visator.dk]
> Sent: Thursday, October 11, 2001 9:57 AM
> To: lucene-dev@jakarta.apache.org
> Subject: Null pointer error when searching with DateFilter
>
>
> Hello all,
>
> I am trying to search using a DateFilter so I get a resultset
> that lies
> between two dates. Without the DateFilter the search works
> perfectly, but
> when I use the DateFilter I get the following error
>
>         java.lang.NullPointerException
>         at
> org.apache.lucene.index.SegmentTermEnum.clone(SegmentTermEnum.java:91)
>         at
> org.apache.lucene.index.TermInfosReader.terms(TermInfosReader.
> java:218)
>         at
> org.apache.lucene.index.SegmentReader.terms(SegmentReader.java:183)
>         at
> org.apache.lucene.index.SegmentsTermEnum.<init>(SegmentsReader
> .java:182)
>         at
> org.apache.lucene.index.SegmentsReader.terms(SegmentsReader.java:144)
>         at
> org.apache.lucene.search.DateFilter.bits(DateFilter.java:131)
>         at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:109)
>         at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:91)
>         at org.apache.lucene.search.Hits.<init>(Hits.java:81)
>         at org.apache.lucene.search.Searcher.search(Searcher.java:75)
>
> and I was just wondering if anyone who have have had or
> overcome similar
> problems, could give me the benefit of their experiences?
>
>
> When I create the Documents in the index I use the following
> code to create
> the date-field
>
>         doc.add(Field.Keyword("timestamp",
> DateField.dateToString(date)));
>
> where date is an object of type Date,
>
>
> and the DateFilter is created like this:
>
>         DateFilter dateFilter = DateFilter.After("timestamp",
> from.getTime());
>
> where from is an object of type Calendar,
>
>
> and I make the search by calling search(Query, Filter) on an
> IndexSearcher
> object:
>
>         return _indexSearcher.search(query, searchFilter);
>
> where query is an object of type Query, and searchFilter is of type
> DateFilter.
>
>
>
> Venlig hilsen
>
> Anders Nielsen
> Adm. direktør
>
> _____________
>
> Visator ApS
> Kroghsgade 1
> 2100 Kbh. Ø
> Tlf: 35 55 47 02
> Mobil: 26 71 36 63
> _____________
>
>
>


Mime
View raw message