You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Sunil Sarje <su...@yahoo.com> on 2008/10/21 06:18:40 UTC

Issue with Query Parsing '+' works as 'OR'

I am working with nightly build of Oct 17, 2008  and found the issue that something wrong with Query Parsing; It takes + as OR

e.g. q=first_name:joe+last_name:smith is behaving as OR instead of AND.
Default operator is set to AND in schema.xml
<solrQueryParser defaultOperator="AND"/>


Is there any new configuration I need to put in place in order to get this working ?

Thanks
-Sunil


Re: Issue with Query Parsing '+' works as 'OR'

Posted by Walter Underwood <wu...@netflix.com>.
To pass a plus sign in a URL parameter, use %2B.

This query:

  foo +bar

Looks like this in a URL:

  q=foo+%2Bbar

wunder

On 10/22/08 11:52 AM, "Lance Norskog" <go...@gmail.com> wrote:

> URI encoding turns a space into a plus, then (maybe) Lucene takes that as a
> space. Also you want a + in front of first_name.
> 
> A AND B     -> +first_name:joe++last_name:smith
> 
> B AND maybe A     -> first_name:joe++last_name:smith
> 
> Some of us need sample use cases to understand these things; documentation
> with only technical definitions don't help much.
> 
> Lance
> 
> -----Original Message-----
> From: Sunil Sarje [mailto:sunilsarje@yahoo.com]
> Sent: Monday, October 20, 2008 9:19 PM
> To: solr-user@lucene.apache.org
> Subject: Issue with Query Parsing '+' works as 'OR'
> 
> I am working with nightly build of Oct 17, 2008  and found the issue that
> something wrong with Query Parsing; It takes + as OR
> 
> e.g. q=first_name:joe+last_name:smith is behaving as OR instead of AND.
> Default operator is set to AND in schema.xml <solrQueryParser
> defaultOperator="AND"/>
> 
> 
> Is there any new configuration I need to put in place in order to get this
> working ?
> 
> Thanks
> -Sunil
> 
> 


RE: Issue with Query Parsing '+' works as 'OR'

Posted by Lance Norskog <go...@gmail.com>.
URI encoding turns a space into a plus, then (maybe) Lucene takes that as a
space. Also you want a + in front of first_name.

A AND B     -> +first_name:joe++last_name:smith

B AND maybe A     -> first_name:joe++last_name:smith

Some of us need sample use cases to understand these things; documentation
with only technical definitions don't help much.

Lance

-----Original Message-----
From: Sunil Sarje [mailto:sunilsarje@yahoo.com] 
Sent: Monday, October 20, 2008 9:19 PM
To: solr-user@lucene.apache.org
Subject: Issue with Query Parsing '+' works as 'OR'

I am working with nightly build of Oct 17, 2008  and found the issue that
something wrong with Query Parsing; It takes + as OR

e.g. q=first_name:joe+last_name:smith is behaving as OR instead of AND.
Default operator is set to AND in schema.xml <solrQueryParser
defaultOperator="AND"/>


Is there any new configuration I need to put in place in order to get this
working ?

Thanks
-Sunil