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: Question on queryparser code from Lucene
Date Sun, 13 Nov 2005 18:54:43 GMT

On 13 Nov 2005, at 13:39, Eugene Ezekiel wrote:

> I got this nagging problem that I can't figure out in the source  
> code of Lucene.
>
> In the file org/apache/lucene/queryParser/QueryParser.java,
> there's a method called parse that returns a Query (see below):
>
>   public Query parse(String query) throws ParseException {
>     ReInit(new FastCharStream(new StringReader(query)));
>     try {
>       return Query(field);
>     }
>
> I don't understand the return statement,
> (i) how do we return without instantiation?
> (ii) the Query class doesn't have a constructor that is Query(String)?

:)

     Query(field) in this case is a method call.

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