[ 
https://issues.apache.org/jira/browse/SOLR-1384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Preetam Rao updated SOLR-1384:
------------------------------

    Attachment: SOLR-1384.patch

Modified LuceneQParserPlugin.parse() to check if the Query is BooleanQuery and 
if so apply "minMustMatch" using code from SolrPluginUtils as used in 
DisMaxQParser.getUserQuery().

My requirementss were below which are working fine.
Usage that works now is:
q="{!minMustMatch=3}one two three four"
fq="{!minMustMatch=50%}one two three four"

For testing from browser change % to "%25" to prevent exception.Added test case 
in TestQueryUtils. Also, "ant clean test" succeeds.

Should it need to handle all cases or is it fine to handle those two simple 
cases for those who need it ?

> Allow fq or q to specify boolean query min must match like dismax's mm 
> parameter
> --------------------------------------------------------------------------------
>
>                 Key: SOLR-1384
>                 URL: https://issues.apache.org/jira/browse/SOLR-1384
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>    Affects Versions: 1.4
>            Reporter: Preetam Rao
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: SOLR-1384.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Dis max query provides "mm" parameter that can be set on the underlying 
> Lucene Boolean OR query using setMinimumNumberShouldMatch()  method.
> It will be great if we can have the same support on any fq or q that 
> specifies more than one term. This means we don't need to switch to dis max 
> query just for this one use case.
> Example might look like this:
> fq={!minMustMatch=75%}street:"917 Z st NW Washington DC"
> Full supported syntax for the value allowed should be this:
> http://lucene.apache.org/solr/api/org/apache/solr/util/doc-files/min-should-match.html
> This is the underlying lucene facility:
> http://www.netlikon.de/docs/javadoc-lucene/lucene_1_9/org/apache/lucene/search/BooleanQuery.html#setMinimumNumberShouldMatch%28int%29

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to