lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: lucene3.0.3 | get correct document in case of multiple Boolean query in search criteria
Date Fri, 18 Feb 2011 16:40:46 GMT
OR is the default operator, but since you are explicitly specifying
ANDs and ORs, the default is probably not relevant anyway.

See what query.toString() says.

See also http://lucene.apache.org/java/3_0_3/queryparsersyntax.html
and http://wiki.apache.org/lucene-java/LuceneFAQ#Why_am_I_getting_no_hits_.2BAC8_incorrect_hits.3F
if you still can't match the correct docs.


--
Ian.


On Fri, Feb 18, 2011 at 4:15 PM, Ranjit Kumar
<Ranjit.Kumar@otssolutions.com> wrote:
> hi,
>
> I am using query like
>
> criteria = (sql OR sqlserver OR "sql server") AND java AND delphi .
>
> In this case when i am using default parser as code mention below:
>
> QueryParser parser = new QueryParser(Version.LUCENE_CURRENT, field, analyzer);
>
> Query query = parser.parse(criteria);
>
> I am getting same number of document when i am using QueryParser.OR_OPERATOR in code
below:
>
> QueryParser parser = new QueryParser(Version.LUCENE_CURRENT, field, analyzer); parser.setDefaultOperator(QueryParser.OR_OPERATOR);
>
> Query query = parser.parse(criteria);
>
> which is not correct. please! suggest me feasible solution.
>
> how could get correct document in case of multiple Boolean query in search criteria?
>
>
> Thanks & Regards,
> Ranjit Kumar

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