lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Rowe <sar...@syr.edu>
Subject Re: Lucene searching class
Date Thu, 25 Oct 2007 18:13:52 GMT
Hi Pooja,

poojasreejith wrote:
>   I am using lucene2.2.0 for my application. I have a searcher.java class.
> The problem I am facing is, it is not supporting 
> 
> Query query = QueryParser.parse(q, "contents",new StandardAnalyzer());  it
> shows error; the method parse in the type QueryParser is not applicable for
> the (String, String ,StandardAnalyzer).

Your code uses an obsolete static version of QueryParser.parse().  That
method was deprecated in Lucene Java release 1.9.0, and was then removed
in release 2.0.0.

You should instead instantiate a QueryParser instance, supplying the
field name and analyzer to the constructor, and then call the
parse(String query) instance method.

Here is the 2.2.0 javadoc for QueryParser:

<http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/queryParser/QueryParser.html>

Steve

-- 
Steve Rowe
Center for Natural Language Processing
http://www.cnlp.org/tech/lucene.asp

---------------------------------------------------------------------
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