SolrCloud模式下的Solr建议者 [英] Solr suggester in SolrCloud mode

查看:64
本文介绍了SolrCloud模式下的Solr建议者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在以三个碎片在CloudSolr模式下运行solr.数据已被索引到solr中.现在,我已经在solrconfig.xml中配置了solr提示器.这是来自solrconfig文件的配置.我正在使用solr 4.10版本.

I am running the solr in CloudSolr mode with three shards. The data is already indexed into solr. Now I have configured the solr suggester in solrconfig.xml. This is the configuration from solrconfig file. I am using solr 4.10 version.

<searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
        <str name="name">mysuggest</str>
        <str name="lookupImpl">FuzzyLookupFactory</str>
        <str name="storeDir">suggester_fuzzy_dir</str>
        <str name="dictionaryImpl">DocumentDictionaryFactory</str>
        <str name="field">businessName</str>
        <str name="payloadField">profileId</str>
        <str name="weightField">businessName</str>
        <str name="suggestAnalyzerFieldType">text_general</str>
        <str name="buildOnStartup">false</str>
    </lst>
</searchComponent>

<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
        <str name="suggest">true</str>
        <str name="suggest.count">10</str>
    </lst>
    <arr name="components">
        <str>suggest</str>
    </arr>
</requestHandler>

这是我用来获取结果的命令:

Here is the command I am using to fetch the result:

http://shard1:8900/solr/core/suggest?suggest=true&suggest.build=true&suggest.reload&suggest.dictionary=mysuggest&wt=json&indent=true&suggest.q=sale

这是命令的输出:

{
"responseHeader":{
"status":0,
"QTime":1490},
"command":"build",
"suggest":{}
}

没有任何提示结果.我有1万条记录索引到solr中.

Nothing is coming into suggest result. I have 10K records indexed into solr.

我在日志文件中看到以下内容:

I am seeing the following into log file:

org.apache.solr.handler.component.SuggestComponent; http://shard1:8983/solr/core/ : null
org.apache.solr.handler.component.SuggestComponent; http://shard2:8900/solr/core/ : null
org.apache.solr.handler.component.SuggestComponent; http://shard3:7574/solr/core/ : null

我无法理解这里缺少什么.谢谢.

I am not able understand what is missing here. Thanks.

推荐答案

它不起作用,因为solr在SolrCloud模式下运行.有两种方法可以在solrCloud模式下执行建议:

It was not working because solr was running in SolrCloud mode. There is two ways to perform suggestion in solrCloud mode:

  • 使用 distrib = false 参数.这将仅从您在命令中访问的一个分片中获取数据.您可以将以下内容添加到组件定义本身中.

  • Use the distrib=false parameter. This will fetch the data from only one shard which you are accessing in the command. You can add the following into Component definition itself.

<bool name="distrib">false</bool> 

  • 使用碎片 shards.qt 参数搜索所有碎片. shards参数将包含您要包括在查询中的所有分片的逗号分隔列表. shards.qt参数将定义您要访问的reat API.

  • Use the shards and shards.qt parameter for searching all the shards. The shards parameter will contain comma separated list of all the shards which you want to include in the query. The shards.qt parameter will define the reat API you want to access.

    shards.qt::向Solr发出信号,要求将对分片的请求发送到此参数给定的请求处理程序.如果您的请求处理程序为"/spell",则在发出请求时使用shards.qt =/spell.

    shards.qt: Signals Solr that requests to shards should be sent to a request handler given by this parameter. Use shards.qt=/spell when making the request if your request handler is "/spell".

    碎片: shards = solr-shard1:8983/solr,solr-shard2:8983/solr 分布式搜索

    shards: shards=solr-shard1:8983/solr,solr-shard2:8983/solr Distributed Search

    请查看此处以获取更多详细信息.

    Please check Here for more details.

    这篇关于SolrCloud模式下的Solr建议者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆