开发者

Possible to have multiple query elevation file?

I face a problem when using QueryElevation. I want to split the elevation file into several files, and be able to manage differently according to different domain (I have开发者_开发知识库 several domains to manage). Each domain belongs to the same application. How could I manage each elevation file differently?


I don't think you can do that out of the box. What you could do (it would be somewhat cumbersome, though) is declare one instance of QueryElevationComponent per domain (with its corresponding config file) and then map it to a domain-specific requestHandler, e.g.:

  <searchComponent name="elevatorExample" class="org.apache.solr.handler.component.QueryElevationComponent">
    <str name="queryFieldType">string</str>
    <str name="config-file">elevateExample.xml</str>
  </searchComponent>
  <requestHandler name="/elevateExample" class="solr.SearchHandler">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
    </lst>
    <arr name="last-components">
      <str>elevatorExample</str>
    </arr>
  </requestHandler>
  <searchComponent name="elevatorAnotherDomain" class="org.apache.solr.handler.component.QueryElevationComponent">
    <str name="queryFieldType">string</str>
    <str name="config-file">elevateAnotherDomain.xml</str>
  </searchComponent>
  <requestHandler name="/elevateAnotherDomain" class="solr.SearchHandler">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
    </lst>
    <arr name="last-components">
      <str>elevatorAnotherDomain</str>
    </arr>
  </requestHandler>

Another possibility is to mess with the source code to make the config file dynamic.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜