0

我在我的 solrconfig.xml 中创建了一个自定义请求处理程序,如下所示:

<requestHandler name="/mysearch" class="solr.SearchHandler">
    <lst name="defaults">
      <str name="echoParams">explicit</str>

      <!-- Query settings -->
      <str name="defType">edismax</str>
      <str name="qf">
        title^10.0
      </str>
      <str name="pf">
        title^10.0 ph_title^5.0
      </str>
      <int name="ps">5</int>
      <str name="mm">3&lt;75% 9&lt;50%</str>
      <str name="q.alt">:</str>
      <str name="rows">10</str>
      <str name="fl">id,score</str>

      <str name="mlt.fl">state_exact</str>
      <str name="mlt.qf">
        vertical^1000.0
      </str>
      <int name="mlt.count">10</int>
      <int name="mlt.mintf">1</int>
      <int name="mlt.mindf">10</int>
      <int name="mlt.minwl">3</int>
      <bool name="mlt.boost">true</bool>
      <bool name="mlt.match.include">false</bool>

    </lst>

    <!-- append spellchecking to our list of components -->
    <arr name="last-components">
      <str>mysearch_spellcheck</str>
    </arr>
  </requestHandler>

但是当我调用这个 API 时:

http://10.24.7.13:8983/solr/docs/select?q=test&qt=/mysearch&fq=whitelist_cities:(Ghaziabad+OR+ALL_CITIES)&fq=-blacklist_states:(Uttar+Pradesh)&fq=whitelist_states:(Uttar+Pradesh +OR+ALL_STATES)&fq=-blacklist_pincodes:(201005+OR+BLOCK_ALL_PINCODES)&fq=whitelist_pincodes:(201005+OR+ALL_PINCODES)

上面的请求处理程序没有被使用,而是使用默认的 /select 处理程序,即使自定义是在 qt 中传递的。

但是,当我遇到这个时:

http://10.24.7.13:8983/solr/docs/mysearch?q=test&fq=whitelist_cities:(Ghaziabad+OR+ALL_CITIES)&fq=-blacklist_states:(Uttar+Pradesh)&fq=whitelist_states:(Uttar+Pradesh+OR+ ALL_STATES)&fq=-blacklist_pincodes:(201005+OR+BLOCK_ALL_PINCODES)&fq=whitelist_pincodes:(201005+OR+ALL_PINCODES)

正如预期的那样,它使用自定义请求处理程序。

为什么即使给出了qt,第一种情况也不采用自定义请求处理程序?

任何帮助将不胜感激,在此先感谢:)

4

0 回答 0