Azure Cognitive Search 为什么优先考虑文档内容而不是名称?

huangapple go评论63阅读模式
英文:

Why is Azure Cognitive Search prioritizing document content over name?

问题

我已经设置了Azure Cognitive Search,并从Blob Storage填充了一个索引,一切似乎都正常工作。文档都在那里,我可以搜索到它们,但由于某种原因,文档的内容似乎比文档的名称更受优先考虑。我希望包含搜索词在名称中的文档首先显示,然后是包含搜索词在内容中的文档。

这是我搜索单个词后获得的响应示例:
Azure Cognitive Search 为什么优先考虑文档内容而不是名称?

正如您所看到的,第一个命中项的分数比其他命中项更高,尽管第三个命中项的名称中也包含搜索词。我假设第二个命中项包含大量搜索词的实例,但我仍希望名称优先于内容。

我该如何实现这一点?

名称和内容都是可搜索的。我已经尝试添加一个具有名称字段权重的评分配置文件,但这样做似乎只会导致第一个命中项的分数更高,而其他分数保持不变。

编辑 - 添加用于搜索的评分配置文件图片。

在原始问题中,我已经添加了一个评分配置文件,其中metadata_storage_name的权重为2。这是默认设置,去除它会将第一个结果的分数降低到8.3,而其他分数保持不变。我还尝试过使用"docs?search=betong&scoringProfile=FileNameBoost"这种方法,尽管在将评分配置文件设置为默认情况下不是必需的。
通过将内容添加到评分配置文件中,其他结果会获得提升,但这不是我想要的,因为名称应优先于内容。

Azure Cognitive Search 为什么优先考虑文档内容而不是名称?

英文:

I have set up an Azure Cognitive Search, populated an index with documents from Blob Storage, and everything seems to work fine. The documents are there, and I can search for them, but for some reason the content of the document seems to be prioritized higher than the name of the document. I want the documents that includes the search term in the name to show up first, followed by documents that contain the search term in the content.

Here is an example of the response I get after searching for a single word:
Azure Cognitive Search 为什么优先考虑文档内容而不是名称?

As you can see, the first hit gets a higher score than the others, even though the third hit also contains the search term in the name. I assume the second hit contains a lot of instances of the search term, but I still want name to be prioritized higher.

How can I achieve this?

Both name and content are searchable. I have tried adding a scoring profile with a weight to the name field, but doing this only seems to result in an even higher score for the first hit, and the other scores stay identical.

EDIT - Adding picture of scoring profile used for search.

In the original question, I had already added a scoring profile where metadata_storage_name was given a weight of 2. This was set to default, and removing it would drop the score of the first result to 8.3, while the others stayed identical. I have also tried "docs?search=betong&scoringProfile=FileNameBoost" this approach, although not necessary with the scoring profile set as default.
By adding content to the scoring profile as well, the other results get a boost, but this is not what I want, as the name should be prioritized above content.

Azure Cognitive Search 为什么优先考虑文档内容而不是名称?

答案1

得分: 1

你需要使用评分配置文件来提升包含搜索词在名称中的文档。

这是官方文档,提供了更多相关信息:

https://learn.microsoft.com/en-us/azure/search/index-add-scoring-profiles

英文:

You'll need to use scoring profiles to boost documents which contain the searched term in the name.

Here's the official doc with more information around it:

https://learn.microsoft.com/en-us/azure/search/index-add-scoring-profiles

huangapple
  • 本文由 发表于 2023年6月22日 16:10:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76529795.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定