Johannes Baiter created SOLR-14913:
--------------------------------------

             Summary: Including non-existing field in edismax field alias 
breaks parsing of boolean query
                 Key: SOLR-14913
                 URL: https://issues.apache.org/jira/browse/SOLR-14913
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: query parsers
    Affects Versions: 8.6.2, 7.6
            Reporter: Johannes Baiter


When including a non-existing field in a {{f.<alias>.qf}} field alias, boolean 
queries are parsed incorrectly.
 For non-boolean queries the invalid field is simply ignored, but in boolean 
queries only the first search term is resolved to the fields from the alias, 
while the second term is resolved to the {{_text_}} field.
 This parse is identical to the parse obtained from the same query with 
brackets removed, i.e. {{<alias>:(<termA> <termB>) }}returns the exact same 
parse as{{ <alias>:<termA> <termB>}}.

I was able to reproduce this with the demo index in the latest Docker setup:

{{$ docker run --name solr_demo -d -p 8983:8983 solr:8 solr-demo}}

*Query:*
{code:bash}
$ curl "http://localhost:8983/solr/demo/select?\
debugQuery=on\
&defType=edismax\
&f.meta.qf=name+manu+cat+features+idontexist\
&q=meta%3A%28samsung+noiseguard%29"
{code}
*Expected Parse:*
{code:json}
{ "debug":
  { "parsedquery_toString": "+((name:samsung | manu:samsung | features:samsung 
| cat:samsung)) (name:noiseguard | manu:noiseguard | features: noiseguard | 
cat:noiseguard))" }
}
{code}
*Actual Parse:*
{code:json}
{ "debug":
  { "parsedquery_toString": "+((name:samsung | manu:samsung | features:samsung 
| cat:samsung) (_text_:noiseguard))" }
}
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to