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 shai deljo <sh...@gmail.com> on 2007/03/15 21:28:52 UTC

Multiple Fields syntax

A question about the syntax:
Does it support  the exclude (-) syntax ?

e.g.

q=title:photoshop+OR+description:photoshop;score+desc&version=2.2&start=0&rows=170&indent=on&fl=*,score

Will return documents with photoshop in the title and/or description.

will this query:
q=title:photoshop-adobe+OR+description:photoshop;score+desc&version=2.2&start=0&rows=170&indent=on&fl=*,score

return documents that have photoshop but NOT adobe in the title and/or
photoshop in the description?

Thanks,

Re: Multiple Fields syntax

Posted by Chris Hostetter <ho...@fucit.org>.
: will this query:
: q=title:photoshop-adobe+OR+description:photoshop;score+desc&version=2.2&start=0&rows=170&indent=on&fl=*,score
:
: return documents that have photoshop but NOT adobe in the title and/or
: photoshop in the description?

"-" and "+" are only treated special if they are at the start of a string
or preceeded by whitespace.  more info on this can be found by clicking
the "Query Syntax" link at the bottom of hte Solr admin screen.

the *best* way to udnerstand how a query will be parsed, is to add
"debugQuery=true" to your query url (there is a checkbox forthis on the
full search form) and look  at the debugging info at the bottom where you
see all the details about how your query is parsed and what the resulting
structure is.



-Hoss