You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "James Dyer (JIRA)" <ji...@apache.org> on 2011/07/15 22:57:01 UTC

[jira] [Created] (LUCENE-3322) Disable cross-matches on multi-valued fields

Disable cross-matches on multi-valued fields
--------------------------------------------

                 Key: LUCENE-3322
                 URL: https://issues.apache.org/jira/browse/LUCENE-3322
             Project: Lucene - Java
          Issue Type: Improvement
          Components: core/search
    Affects Versions: 4.0
            Reporter: James Dyer
            Priority: Minor


When searching against a multi-valued field it is often advantageous to disable cross-matches.  For instance, if a book contains two authors:  "john smith" and "brian jones", a search for "john jones" should not match.  

Currently the best workaround is to search using a sloppy phrase query.  The drawback is that phrases are incompatible with other features such as wildcards and ranges.  Additionally, it is left up to the user to know to formulate the query differently if searching a multi-valued field.   

--
This message is automatically generated by JIRA.
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


[jira] [Updated] (LUCENE-3322) Disable cross-matches on multi-valued fields

Posted by "James Dyer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Dyer updated LUCENE-3322:
-------------------------------

    Attachment: LUCENE-3322.patch

Here is an initial patch.  Creating this was an adventure for me in learning some of Lucene's internals!  

In this approach, ConjunctionScorer verifies that all of the matches' positions fall within the range of a user-supplied positionIncrementGap.  Supported query types are: TermQuery, TermRangeQuery, PrefixQuery, PhraseQuery, WidlcardQuery, FuzzyQuery & BooleanQuery.  A unit test is included demonstrating use with each of these query types.

All unit tests pass.  However, there are some glaring inefficiencies in this initial impl attempt.  Perhaps LUCENE-2878 will ultimately provide much of the functionality otherwise implemented here (??).  Also, should LUCENE-2308 be implemented, there might be an opportunity to store a Field Type's PositionIncrementGap in the index, further lessening the burden on the user to correctly issue these types of queries.



> Disable cross-matches on multi-valued fields
> --------------------------------------------
>
>                 Key: LUCENE-3322
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3322
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 4.0
>            Reporter: James Dyer
>            Priority: Minor
>         Attachments: LUCENE-3322.patch
>
>
> When searching against a multi-valued field it is often advantageous to disable cross-matches.  For instance, if a book contains two authors:  "john smith" and "brian jones", a search for "john jones" should not match.  
> Currently the best workaround is to search using a sloppy phrase query.  The drawback is that phrases are incompatible with other features such as wildcards and ranges.  Additionally, it is left up to the user to know to formulate the query differently if searching a multi-valued field.   

--
This message is automatically generated by JIRA.
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