lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bhavin Pandya" <bhav...@rediff.co.in>
Subject NullPointerException while sorting on INT
Date Wed, 24 Oct 2007 07:11:26 GMT
Hi friends,

I am getting NullPointerException while sorting on a field using SortField.INT
same is working for SortField.STRING

Code Snippet:
                SortField sortfield = new SortField("CURRENT_BID",SortField.INT,false); //
asceding sort on current bid value
                Sort sort = new Sort();
                sort.setSort(sortfield);
                hits = msearcher.search(bqmain,sort);  // this statement generates NullPointerException

Stack Trace:
java.lang.NullPointerException
        at org.apache.lucene.search.MultiSearcherThread.hits(ParallelMultiSearcher.java:286)
        at org.apache.lucene.search.ParallelMultiSearcher.search(ParallelMultiSearcher.java:141)
        at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:65)
        at org.apache.lucene.search.Hits.<init>(Hits.java:52)
        at org.apache.lucene.search.Searcher.search(Searcher.java:53)
        at _auctionSearcher__jsp._jspService(_auctionSearcher__jsp.java:359)

Same is working if i change "SoftField.INT" to "SortField.STRING"....

In index the field "CURRENT_BID" has no null value in any document....

I am using lucene 2.1.

Thanks.
Bhavin pandya
     


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message