Solr: How to pass a multivalued request parameter as a “local parameter” in a nested query?

StackOverflow https://stackoverflow.com/questions/12369179

  •  01-07-2021
  •  | 
  •  

문제

I am constructing a nested Solr DisMax query of the format: _query_:"{!edismax qf=...}.... Now I need to add several boosting queries (bq-parameter), but simply writing _query_:"{!edismax qf=... bq=foo bq=bar} doesn't seem to work as only one of the bq-keys is processed and the rest are ignored. Is it possible to pass multivalued parameters as LocalParams?

도움이 되었습니까?

해결책

Multivalued local parameters turned out to be not implemented at the moment. Here's a CR for that - https://issues.apache.org/jira/browse/SOLR-2798

다른 팁

Instead of using localparams and complicating the query try using a new request handler.
The multiple bq parameters can be specified easily and should work fine and should be easier to understand.

<requestHandler name="edismax" class="solr.SearchHandler" >
    <lst name="defaults">
        <str name="defType">edismax</str>
        <str name="qf">
            title
        </str>
        <str name="bq">
            foo bar
        </str>
        <str name="fl">
            *,score
        </str>
        <int name="ps">100</int>
        <str name="q.alt">*:*</str>
    </lst>   
</requestHandler>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top