Are you using the edismax query parser (which permits lower case "and" and "or" operators)? If so, there is a bug with parenthesized sub-queries. If you have a left parenthesis immediately before a field name (which you do in this case) the query fails. The short-term workaround is to place a space between the left parenthesis and the field name.

See:
https://issues.apache.org/jira/browse/SOLR-3377

-- Jack Krupansky

-----Original Message----- From: Peter Kirk
Sent: Tuesday, May 15, 2012 7:04 AM
To: solr-user@lucene.apache.org
Subject: RE: simple query help

Hi - thanks for the response. Yes I have tried with parentheses, to group as you suggest.

It doesn't make a difference. But now I'm thinking there's something completely odd - and I wonder if it's necessary to use a special search-handler to achieve what I want.

For example, if I execute
q=(skcode:2021051 AND flength:368.0)

I get no results. If I omit the parentheses, I get 1 result. (Let alone trying to combine several Boolean clauses).

/Peter


-----Original Message-----
From: András Bártházi [mailto:and...@barthazi.hu]
Sent: 15. maj 2012 12:51
To: solr-user@lucene.apache.org
Subject: Re: simple query help

Hi,

You should use parantheses, have you tried that?
q=(skcode:2021051 and flength:368.0) or (skcode:2021049 and
ent_no:1040970907)

http://robotlibrarian.billdueber.com/solr-and-boolean-operators/

Bye,
 Andras

2012/5/15 Peter Kirk <p...@alpha-solutions.dk>

Hi

Can someone please give me some help with a simple query.

If I search
q=skcode:2021051 and flength:368.0

I get 1 document returned (doc A)

If I search
q=skcode:2021049 and ent_no:1040970907

I get 1 document returned (doc B)


But if I search
q=skcode:2021051 and flength:368.0 or skcode:2021049 and ent_no:1040970907

I get no documents returned.

Shouldn't I get both docA and docB?

Thanks,
Peter



Reply via email to