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 2014/03/07 17:12:47 UTC

[jira] [Commented] (LUCENE-5491) NPE in Flexible StandardQueryParser on boosting

    [ https://issues.apache.org/jira/browse/LUCENE-5491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13923999#comment-13923999 ] 

André  commented on LUCENE-5491:
--------------------------------

@[~adriano_crestani] I added a null check and it works fine.

> NPE in Flexible StandardQueryParser on boosting
> -----------------------------------------------
>
>                 Key: LUCENE-5491
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5491
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/queryparser
>    Affects Versions: 4.6, 4.7
>            Reporter: André 
>             Fix For: 4.8
>
>
> The following exception 
> {noformat}
> java.lang.IllegalArgumentException: field name should not be null!
> 	at org.apache.lucene.queryparser.flexible.core.config.FieldConfig.<init>(FieldConfig.java:36)
> 	at org.apache.lucene.queryparser.flexible.core.config.QueryConfigHandler.getFieldConfig(QueryConfigHandler.java:59)
> 	at org.apache.lucene.queryparser.flexible.standard.processors.BoostQueryNodeProcessor.postProcessNode(BoostQueryNodeProcessor.java:54)
> 	at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.processIteration(QueryNodeProcessorImpl.java:99)
> 	at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.processChildren(QueryNodeProcessorImpl.java:125)
> 	at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.processIteration(QueryNodeProcessorImpl.java:97)
> 	at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.process(QueryNodeProcessorImpl.java:90)
> 	at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline.process(QueryNodeProcessorPipeline.java:90)
> 	at org.apache.lucene.queryparser.flexible.core.QueryParserHelper.parse(QueryParserHelper.java:255)
> 	at org.apache.lucene.queryparser.flexible.standard.StandardQueryParser.parse(StandardQueryParser.java:168)
> {noformat}
> is caused by boosting a tokenizable phrase field within a group.
> {code:java}
> public void testFail() throws Exception {
>   test("(mimeType:\"text-html\")");
> }
> public void testOkay() throws Exception {
>   test("mimeType:\"text-html\"");
> }
> static void test(String qs) throws Exception {
>   Analyzer sa = new StandardAnalyzer(Version.LUCENE_46);
>   StandardQueryParser qp = new StandardQueryParser(sa);
>   qp.getFieldsBoost().put("mimeType", 1f);
>   qp.parse(qs, "content");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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