具有多个有效负载的 Solr 建议 [英] Solr Suggestion with multiple payloads

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

问题描述

我们正在使用 Solr 建议器功能进行 businessName 查找.当用户输入查询以及匹配的名称时,我们希望 solr 发送来自个人资料的其他属性,例如 ID、地址、城市、州、国家/地区等字段.

We are using Solr suggester feature for businessName lookup. As user enters the query, along with the matched names, we want solr to send other attributes from profile like id, address, city, state, country etc. fields.

我尝试使用 payloadField 标签在 solr 建议器中配置多个字段,但它只返回第一个字段.我试过把它们以逗号分隔的方式,但没有运气.这是 solrconfig.xml 文件中的当前配置.

I tried to configure multiple fields in solr suggester using payloadField tag but it is returning only the first field. I have tried putting them in comma separated fashion, but no luck. Here is the current config from solrconfig.xml file.

<searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
        <str name="name">suggest</str>
        <str name="lookupImpl">AnalyzingLookupFactory</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="payloadField">email</str>
        <str name="payloadField">city</str>
        <str name="payloadField">state</str>
        <str name="payloadField">postalCode</str>
        <str name="payloadField">phoneNumber</str>
        <str name="weightField">businessName</str>
        <str name="suggestAnalyzerFieldType">text_general</str>
        <str name="buildOnStartup">true</str>
        <str name="buildOnCommit">true</str>
        <str name="preserveSep">false</str>
    </lst>
</searchComponent>

需要什么配置才能在结果中发送多个有效负载?谢谢.

What configuration is required to send multiple payloads in result? Thanks.


这是 solr 建议器的当前输出.


This is current output of the solr suggester.

    {
        "suggest": {
            "suggest": {
                "Rock": {
                    "numFound": 1,
                    "suggestions": [
                        {
                            "term": "Rockview Properties",
                            "weight": 0,
                            "payload": "123456789"
                        }
                    ]
                }
            }
        }
    }

我的期望:
建议者有效负载包含多个字段的一种方式.有效载荷字段还包含哪些数据属于哪个字段的信息.我不是要使用 copyField 标记复制单个字段中的所有数据,然后作为有效负载方法传递.

My Expectation:
A way in which suggester payload contains more than one field. The payload field also contain the information that what data belongs to which field. I am not looking for copying all the data in a single field using copyField tag and then passing as payload approach.

推荐答案

我一直在做在线阅读和搜索问题,在返回 solr 建议程序结果的同时发送多个有效负载.我发现,我们只能从索引中发送一个字段作为有效负载.

I have been doing online reading and search for the issue, sending multiple payload while returning solr suggester results. I found that, we can send only one field as payload from our index.

参考:链接

欢迎提供更多建议.

这篇关于具有多个有效负载的 Solr 建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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