Multiple Fields syntax

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple Fields syntax

shai deljo
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,
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Fields syntax

Chris Hostetter-3

: 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