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

Nick Shanin commented on SOLR-9352:
-----------------------------------

>From code reading against apache/main b73f03976fa, 
>solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java:1275-1286 
>returns a MatchAllDocsQuery for a bare '*' when no explicit field is set, 
>which is the df case in this ticket, and builds an existence query only for an 
>explicit field such as 'foo:*'. That is the behaviour the ticket's comment 
>describes as intended under SOLR-2996. Can this be closed as not a bug?

🤖 AI-generated 🤖

> 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
>    Affects Versions: 4.10, 5.4
>            Reporter: Matteo Grolla
>            Priority: Major
>
> 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
(v10.3.26#10030026)

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

Reply via email to