Puneet
Puneet

Reputation: 472

Complex queries with Solr 4

I would like to fire complex queries in Solr 4. If I am using Lucene, I can search using XML Query parser and get the results I need. However, I am not able to see how to use the XML Query Parser in Solr.

I need to be able to execute queries with proximity searches, booleans, wildcards, span or, phrases (although these can be handled by proximity searches).

Guidance on material on how to proceed also welcome.

Regards Puneet

Upvotes: 0

Views: 1075

Answers (3)

Nanda Kumar
Nanda Kumar

Reputation: 2196

you can use the query url as http://xx.xxx.xx.xx:8983/solr/collectionname/select?indent=on&q= {!complexphrase%20inOrder=true}"good*"&wt=json&fl=Category,keywords,ImageID

Upvotes: 2

Yonik
Yonik

Reputation: 2381

Solr 4.8 now has the "complexphrase" query parser built in that can construct all sorts of complex proximity queries (i.e. phrase queries with embedded boolean logic and wildcards).

Upvotes: 2

Dimitri Mestdagh
Dimitri Mestdagh

Reputation: 44665

As far as I know it's still a work in progress. More info can be found at their Jira. You can of course use the normal query language, it's also capable of doing pretty complex things, for example:

"a proximity search"~2 AND *wildcards* OR "a phrase"

As you can see you can search for phrases, boolean operators (AND, OR, ...), span, proximity and wildcards. For more information about the query syntax look at the Lucene documentation. Solr also added some extra features on top of the Lucene query parser and more information about that can be found at the Solr wiki.

Upvotes: 2

Related Questions