lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Itamar Syn-Hershko (JIRA)" <j...@apache.org>
Subject [jira] Created: (LUCENE-2518) Make check of BooleanClause.Occur[] in MultiFieldQueryParser.parse less stubborn
Date Mon, 28 Jun 2010 16:22:50 GMT
Make check of BooleanClause.Occur[] in MultiFieldQueryParser.parse less stubborn
--------------------------------------------------------------------------------

                 Key: LUCENE-2518
                 URL: https://issues.apache.org/jira/browse/LUCENE-2518
             Project: Lucene - Java
          Issue Type: Improvement
          Components: QueryParser
    Affects Versions: 3.0.2, 3.0.1, 3.0, 2.9.3, 2.9.2, 2.9.1, 2.9
            Reporter: Itamar Syn-Hershko
            Priority: Minor


Update the check in:

  public static Query parse(Version matchVersion, String query, String[] fields,
      BooleanClause.Occur[] flags, Analyzer analyzer) throws ParseException {
    if (fields.length != flags.length)
      throw new IllegalArgumentException("fields.length != flags.length");

To be:
    if (fields.length > flags.length)

So the consumer can use one Occur array and apply fields selectively. The only danger here
is with hitting a non-existent cell in flags, and this check will provide this just as well
without limiting usability for such cases.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message