You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Juan Grande (Updated) (JIRA)" <ji...@apache.org> on 2012/03/27 23:22:26 UTC

[jira] [Updated] (LUCENE-3833) Add an operator to query parser for term quorum (ie: BooleanQuery.setMinimumNumberShouldMatch)

     [ 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org