You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "André (JIRA)" <ji...@apache.org> on 2013/02/13 18:10:13 UTC

[jira] [Updated] (LUCENE-4777) NPE in MultiFieldQueryParser

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

André  updated LUCENE-4777:
---------------------------

    Description: 
The method getRegexpQuery() in MultiFieldQueryParser is not overridden.
That leads to RegexpQueries where field=null (see example below).


{code}
QueryParser qp = new MultiFieldQueryParser(Version.LUCENE_41, new String[]{ "content" }, new StandardAnalyzer(Version.LUCENE_41)) 
qp.parse("path:foo/bar/foo"); // no ParseException thrown here
Assert.assertNotNull(((RegexpQuery)((BooleanQuery)q).getClauses()[1].getQuery()).getField())
{code}

  was:
The method getRegexpQuery() in MultiFieldQueryParser is not overridden.
That leads to RegexpQueries where field=null (see example below).

{code}
QueryParser qp = new MultiFieldQueryParser(Version.LUCENE_41, new String[]{ "content" }, new StandardAnalyzer(Version.LUCENE_41)) 
qp.parse("path:foo/bar/foo"); // no ParseException thrown here
Assert.assertNotNull(((RegexpQuery)((BooleanQuery)q).getClauses()[1].getQuery()).getField())
{code}

    
> NPE in MultiFieldQueryParser
> ----------------------------
>
>                 Key: LUCENE-4777
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4777
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/queryparser
>    Affects Versions: 4.1
>            Reporter: André 
>
> The method getRegexpQuery() in MultiFieldQueryParser is not overridden.
> That leads to RegexpQueries where field=null (see example below).
> {code}
> QueryParser qp = new MultiFieldQueryParser(Version.LUCENE_41, new String[]{ "content" }, new StandardAnalyzer(Version.LUCENE_41)) 
> qp.parse("path:foo/bar/foo"); // no ParseException thrown here
> Assert.assertNotNull(((RegexpQuery)((BooleanQuery)q).getClauses()[1].getQuery()).getField())
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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