lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Problem with ResponseBuilder
Date Thu, 03 Sep 2009 23:04:22 GMT

: DocListAndSet results = new DocListAndSet();
: Hits h = searcher.search(rb.getQuery());
	...
: Is this the correct way to obtain the docs?

Uh.... not really.  why are you using the Hits method at all?  why don't 
you call the searcher.search method that returns a DocListAndSet instead?  
(Hits is a deprecated method in Lucene, and in Solr it doesnt' take 
advantage of any of hte caches)

: I'm receiving a null java.lang.NullPointerException with this code.

FYI: that's because results.docList is null until something assigns a new 
DocList to it ... if you want to build you'r own from scratch, you've got 
to instantiate it.



-Hoss


Mime
View raw message