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

Hoss Man commented on SOLR-9352:
--------------------------------

See linked issue for justification of this behavior.

My comments from recent mailing list thread that evidently sparked the creation 
of this jira...

{noformat}

that behavior was intentionally added becaus most users kept getting 
really confused by the older default behavion (which was previously a 
0-length prefix against hte default search field)

        https://issues.apache.org/jira/browse/SOLR-2996

if you do in fact whant a 0-length prefix query against hte default search 
field...

* use the prefix parser:  q={!prefix f=$df v=''}
* use an explicit field name: q=yourDefaultField:*

...if you just want all fields that contain any terms in your default 
field, use the "fieldName:[* TO *]" range syntax (which should be more 
efficient ... although it's possible "fieldName:*" was also optimized to 
be as efficient ... i can't remember)


{noformat}


In my opinion this jira should be "Won't Fixed"


> 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: 4.10, 5.4
>            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