Thanks Chris.  That worked.. just one correction instead of *df -> qf *

On Tue, Jun 18, 2013 at 2:05 PM, Chris Hostetter-3 [via Lucene] <
ml-node+s472066n4071423...@n3.nabble.com> wrote:

>
> : query something like
> :
> :
> http://localhost:8983/solr/select?q=(category:lcd+OR+category:led+OR+category:plasma)+AND+(manufacture:sony+OR+manufacture:samsung+OR+manufacture:apple)&facet.field=category&facet.field=manufacture&fl=id&mm=2
>
> Here's an example of something similar using the Solr 4.3 example data...
>
> http://localhost:8983/solr/collection1/select?debugQuery=true&q=%2B{!dismax+df%3Dfeatures+mm%3D2+v%3D%24features}+%2B{!dismax+df%3Dcat+mm%3D2+v%3D%24cat}+&wt=xml&indent=true&cat=electronics+connector+XXXX&features=power+ipod+YYYY
>
>
> the important (un url encoded) params here are...
>
>   q = +{!dismax df=features mm=2 v=$features} +{!dismax df=cat mm=2
> v=$cat}
>   features = power ipod YYYY
>   cat = electronics connector XXXX
>
> This takes advantage of the fact that the (default) "lucene" parser in
> solr can understand the "{!parser}" syntax to create subclauses using
> other parsers -- but one thing to watch out for is that if your entire
> query starts with "{!dismax}..." then it's going to try and use the dismax
> parser for the whole thing, so this won't do what you expect...
>
>   q = {!dismax df=features mm=2 v=$features} AND {!dismax df=cat mm=2
> v=$cat}
>
> ...but this will...
>
>   q = ({!dismax df=features mm=2 v=$features} AND {!dismax df=cat mm=2
> v=$cat})
>
> This is a realtively new feature of the solr, in older versions you would
> need to use the _query_ parsing trick...
>
>   q = _query_:"{!dismax df=features mm=2 v=$features}" AND
> _query_:"{!dismax df=cat mm=2 v=$cat}"
>
>
> The important thing to remeber about all of this though is that it really
> doesn't matter unless you truly care about getting scoring from this
> resulting BooleanQuery based on the two sub-queries ... if all you really
> care about is *filtering* a set of documents bsaed on these two criteria,
> it's much simpler (and typically more efficient) to use filter queries...
>
>   q = *:*
>  fq = {!dismax df=features mm=2}power ipod YYYY
>  fq = {!dismax df=cat mm=2}electronics connector XXXX
>
>
>
> -Hoss
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/mm-Minimum-Should-Match-tp4071197p4071423.html
>  To unsubscribe from mm (Minimum 'Should' Match), click 
> here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4071197&code=a3JlY21lY2hAZ21haWwuY29tfDQwNzExOTd8LTYxNTk4OTAxNQ==>
> .
> NAML<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://lucene.472066.n3.nabble.com/mm-Minimum-Should-Match-tp4071197p4071465.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to