[ 
https://issues.apache.org/jira/browse/SOLR-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Smiley closed SOLR-2883.
------------------------------
    Resolution: Fixed

SOLR-9786 effectively incorporated such a hint.  {{QParser.setIsFilter}}

> Add QParser boolean hint for filter queries
> -------------------------------------------
>
>                 Key: SOLR-2883
>                 URL: https://issues.apache.org/jira/browse/SOLR-2883
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>            Reporter: David Smiley
>
> It would be useful if there was a QParser hint of some kind that indicated 
> that the score isn't needed. This would be set by Solr in QueryComponent when 
> processing the fq param, and some field types could check for this and return 
> more efficient Query implementations from FieldType.getFieldQuery(). For 
> example, a geospatial field could return a ConstantScoreQuery(Filter) 
> implementation when only filtering is needed, or return a query that returns 
> a geospatial distance for a document's score. I think there are probably 
> other opportunities for this flag to have its use but I'm not sure.
> As an example solution, a local param of needScore=false could be added.  I 
> should be functionally equivalent to fq={!needScore=false}.....
> Here is a modified portion of QueryComponent at line 135 to illustrate what 
> the change would be. I haven't tested it but it compiles.
> {code:java}
>         for (String fq : fqs) {
>           if (fq != null && fq.trim().length()!=0) {
>             QParser fqp = QParser.getParser(fq, null, req);
>             SolrParams localParams = fqp.getLocalParams();
>             SolrParams defaultLocalParams = new 
> MapSolrParams(Collections.singletonMap("needScore","false"));
>             SolrParams newLocalParams = new 
> DefaultSolrParams(localParams,defaultLocalParams);
>             fqp.setLocalParams(newLocalParams);
>             filters.add(fqp.getQuery());
>           }
>         }
> {code}
> It would probably be best to define the "needScore" constant somewhere better 
> but this is it in a nutshell.



--
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