lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: QueryParser implicit conjunction
Date Sat, 25 Jun 2005 15:57:00 GMT

On Jun 25, 2005, at 7:59 AM, John Fereira wrote:
>> Aha!  Look at the method signature of your parse() call.  That is the
>> culprit.  To call the non-static method so that you use the
>> *instance* of QueryParser rather than the default settings, change to
>> this:
>>
>>     query = qp.parse(searchterms);
>>
>
> Thanks, that fixed it.
>
>   Was there someplace that I should have looked to determine that  
> qp.parse(String) would call the non-static method but qp.parse 
> (String, String, Analyzer) would not?

Besides Daniel's comment about IDE's warning of this (calling a  
static method from an instance variable is usually a warning), you  
can also glean this information from Lucene's Javadocs.  The static  
parse method is more trouble than its worth, actually.  We should  
probably deprecate that for 1.9 and remove it in 2.0 and only allow  
QueryParser instances - this allows more flexibility with things like  
MultiFieldQueryParser and such too.

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message