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

Juan Grande updated LUCENE-3833:
--------------------------------

    Attachment: LUCENE-3833.patch

Hi,

I'm attaching a patch that implements this feature for the classic query parser 
in the trunk. I'm still working on a solution for the flexible.standard 
implementation.

The syntax is the same as for sloppy phrases. Some things need to be decided:
* What should happen when this is applied to something that isn't a boolean 
query? For example: ([* TO *])~3. In this case, the patch simply ignores the mm.
* Because in the grammar definition I'm using the same production as for sloppy 
phrases, decimal values are allowed by the syntax. What should we do when the 
user enters a non-integer number? Throw a ParseException maybe? Currently, the 
patch also ignores the mm value in this case.

I don't really know much about JavaCC, I just learnt the basics to do the 
patch, so feel free to correct any possible mistakes.

In this patch I'm removing a constructor that was manually added to 
ParseException, so it doesn't fail when the sources are regenerated.

-- Juan

                
> Add an operator to query parser for term quorum (ie: 
> BooleanQuery.setMinimumNumberShouldMatch)
> ----------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3833
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3833
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: core/queryparser
>            Reporter: Mike
>         Attachments: LUCENE-3833.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> A project I'm working on requires *term quorum* searching with stemming 
> turned off. The users are accostomed to Sphinx search, and thus expect a 
> query like [ A AND (B C D)/2 ] to return only documents that contain A or at 
> least two of B, C or D. 
> So this document would match:
> a b c
> But this one wouldn't:
> a b
> This can be a useful form of fuzzy searching, and I think we support it via 
> the MM parameter, but we lack a user-facing operator for this. It would be 
> great to add it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to