You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Sebastien X <cv...@noos.fr> on 2003/08/05 00:19:05 UTC

AND instead OR for the search

Hi everybody,

When I make a search, for example : "Jakarta lucene"

The search engine interpret the query like "Jakarta OR lucene"

I wish this could be "Jakarta AND lucene" (like the most of internet search engine) because the OR clause is not very intuitive for the users.

Could we use a method for using AND instead OR when we use Lucene?

Tanks for advance

Sébastien

Re: AND instead OR for the search

Posted by Brian Mila <bm...@iastate.edu>.
I believe what you want is to use the setOperator function:

QueryParser qp = new QueryParser("contents", analyzer);
qp.setOperator(QueryParser.DEFAULT_OPERATOR_AND);

Brian

----- Original Message -----
From: "Sebastien X" <cv...@noos.fr>
To: <lu...@jakarta.apache.org>
Sent: Monday, August 04, 2003 5:19 PM
Subject: AND instead OR for the search


Hi everybody,

When I make a search, for example : "Jakarta lucene"

The search engine interpret the query like "Jakarta OR lucene"

I wish this could be "Jakarta AND lucene" (like the most of internet search
engine) because the OR clause is not very intuitive for the users.

Could we use a method for using AND instead OR when we use Lucene?

Tanks for advance

Sébastien



Re: AND instead OR for the search

Posted by Brian Mila <bm...@iastate.edu>.
I believe what you want is to use the setOperator function:

QueryParser qp = new QueryParser("contents", analyzer);
qp.setOperator(QueryParser.DEFAULT_OPERATOR_AND);

Brian

----- Original Message -----
From: "Sebastien X" <cv...@noos.fr>
To: <lu...@jakarta.apache.org>
Sent: Monday, August 04, 2003 5:19 PM
Subject: AND instead OR for the search


Hi everybody,

When I make a search, for example : "Jakarta lucene"

The search engine interpret the query like "Jakarta OR lucene"

I wish this could be "Jakarta AND lucene" (like the most of internet search
engine) because the OR clause is not very intuitive for the users.

Could we use a method for using AND instead OR when we use Lucene?

Tanks for advance

Sébastien



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


Re: AND instead OR for the search

Posted by hui <hu...@triplehop.com>.
I tried this before with 1.3rc1. The query parser still uses "OR" rather
than "AND" as default even after I set the operator to AND.
I found this issue had been reported before but no answer for it.
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apac
he.org&msgId=710724

Any idea to solve the issue?

Regards,
Hui
----- Original Message -----
From: "Erik Hatcher" <li...@ehatchersolutions.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Monday, August 04, 2003 9:11 PM
Subject: Re: AND instead OR for the search


QueryParser, at least in Lucene's CVS, supports an attribute to toggle
this capability.

   QueryParser.setOperator(QueryParser.DEFAULT_OPERATOR_AND)




On Monday, August 4, 2003, at 06:19  PM, Sebastien X wrote:

> Hi everybody,
>
> When I make a search, for example : "Jakarta lucene"
>
> The search engine interpret the query like "Jakarta OR lucene"
>
> I wish this could be "Jakarta AND lucene" (like the most of internet
> search engine) because the OR clause is not very intuitive for the
> users.
>
> Could we use a method for using AND instead OR when we use Lucene?
>
> Tanks for advance
>
> Sébastien

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


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


Re: AND instead OR for the search

Posted by hui <hu...@triplehop.com>.
I tried this before with 1.3rc1. The query parser still uses "OR" rather
than "AND" as default even after I set the operator to AND.
I found this issue had been reported before but no answer for it.
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apac
he.org&msgId=710724

Any idea to solve the issue?

Regards,
Hui
----- Original Message -----
From: "Erik Hatcher" <li...@ehatchersolutions.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Monday, August 04, 2003 9:11 PM
Subject: Re: AND instead OR for the search


QueryParser, at least in Lucene's CVS, supports an attribute to toggle
this capability.

   QueryParser.setOperator(QueryParser.DEFAULT_OPERATOR_AND)




On Monday, August 4, 2003, at 06:19  PM, Sebastien X wrote:

> Hi everybody,
>
> When I make a search, for example : "Jakarta lucene"
>
> The search engine interpret the query like "Jakarta OR lucene"
>
> I wish this could be "Jakarta AND lucene" (like the most of internet
> search engine) because the OR clause is not very intuitive for the
> users.
>
> Could we use a method for using AND instead OR when we use Lucene?
>
> Tanks for advance
>
> Sébastien

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


Re: AND instead OR for the search

Posted by Erik Hatcher <li...@ehatchersolutions.com>.
QueryParser, at least in Lucene's CVS, supports an attribute to toggle 
this capability.

   QueryParser.setOperator(QueryParser.DEFAULT_OPERATOR_AND)




On Monday, August 4, 2003, at 06:19  PM, Sebastien X wrote:

> Hi everybody,
>
> When I make a search, for example : "Jakarta lucene"
>
> The search engine interpret the query like "Jakarta OR lucene"
>
> I wish this could be "Jakarta AND lucene" (like the most of internet 
> search engine) because the OR clause is not very intuitive for the 
> users.
>
> Could we use a method for using AND instead OR when we use Lucene?
>
> Tanks for advance
>
> Sébastien

Re: AND instead OR for the search

Posted by Erik Hatcher <li...@ehatchersolutions.com>.
QueryParser, at least in Lucene's CVS, supports an attribute to toggle 
this capability.

   QueryParser.setOperator(QueryParser.DEFAULT_OPERATOR_AND)




On Monday, August 4, 2003, at 06:19  PM, Sebastien X wrote:

> Hi everybody,
>
> When I make a search, for example : "Jakarta lucene"
>
> The search engine interpret the query like "Jakarta OR lucene"
>
> I wish this could be "Jakarta AND lucene" (like the most of internet 
> search engine) because the OR clause is not very intuitive for the 
> users.
>
> Could we use a method for using AND instead OR when we use Lucene?
>
> Tanks for advance
>
> Sébastien

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