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/05 19:24:45 UTC

[jira] [Created] (LUCENE-5491) Flexible StandardQueryParser fails on boost field

André  created LUCENE-5491:
------------------------------

             Summary: Flexible StandardQueryParser fails on boost field
                 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é 


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