Azure搜索建议中的不同值? [英] Distinct values in Azure Search Suggestions?
问题描述
我正在将关系数据库上的搜索功能卸载到Azure搜索. 我的产品"表中包含诸如serialNumber,PartNumber等列.(可以有多个具有相同partNumber的序列号).
I am offloading my search feature on a relational database to Azure Search. My Products tables contains columns like serialNumber, PartNumber etc.. (there can be multiple serialNumbers with the same partNumber).
我想创建一个可以自动填写部件号的建议器.但是在我的场景中,由于在多个条目中找到了partNumber匹配项,因此建议中有很多重复项.
I want to create a suggestor that can autocomplete partNumbers. But in my scenario I am getting a lot of duplicates in the suggestions because the partNumber match was found in multiple entries.
我该如何解决这个问题?
How can I solve this problem ?
推荐答案
Suggest API会建议文档,而不是查询.如果在索引中为每个序列号重复partNumber信息,然后根据partNumber提出建议,则将为每个匹配的文档获得结果.通过在$ select参数中包含键字段,可以更清楚地看到这一点. Azure搜索将消除同一文档内的重复项,但不会消除跨文档的重复项.您将必须在客户端执行此操作,或者仅出于建议的目的构建partNumbers的二级索引.
The Suggest API suggests documents, not queries. If you repeat the partNumber information for each serialNumber in your index and then suggest based on partNumber, you will get a result for each matching document. You can see this more clearly by including the key field in the $select parameter. Azure Search will eliminate duplicates within the same document, but not across documents. You will have to do that on the client side, or build a secondary index of partNumbers just for suggestions.
See this forum thread for a more in-depth discussion.
Also, feel free to vote on this UserVoice item to help us prioritize improvements to Suggestions.
这篇关于Azure搜索建议中的不同值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!