Matteo Grolla created SOLR-9352:
-----------------------------------

             Summary: matchAllDocsQuery instead of WildCardQuery from lucene qp 
with df and *
                 Key: SOLR-9352
                 URL: https://issues.apache.org/jira/browse/SOLR-9352
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
    Affects Versions: 5.4, 4.10
            Reporter: Matteo Grolla


Hi,
    I'm surprised by lucene query parser translating this query

http://localhost:8983/solr/collection1/select?df=id&q=*

in
<str name="parsedquery">MatchAllDocsQuery(*:*)</str>
I was expecting it to execute: "id:*"

the problem seems to be in
in o.a.s.parser.SolrQueryParserBase:

the field is not set explicity but in the df, so getExplicitField returns null
// called from parser
protected Query getWildcardQuery(String field, String termStr) throws 
SyntaxError {
  checkNullField(field);
  // *:* -> MatchAllDocsQuery
  if ("*".equals(termStr)) {
    if ("*".equals(field) || getExplicitField() == null) {
      return newMatchAllDocsQuery();
    }
  }




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to