【发布时间】:2019-08-14 19:15:05
【问题描述】:
根据文章https://azure.microsoft.com/pl-pl/blog/azure-search-synonyms-public-preview/我应该在synonymMaps中使用多词/短语同义词
多词同义词
在许多全文搜索引擎中,对同义词的支持仅限于单个单词。我们的团队设计了一个解决方案,允许 Azure 搜索支持多词同义词。这允许短语查询(“”)在使用同义词时正常工作。如果有人将“热水浴缸”映射到“漩涡浴缸”,然后搜索“大热水浴缸”,Azure 搜索将返回同时包含“大热水浴缸”和“大漩涡浴缸”的匹配项。
但是,就我而言,我在子词上得到了匹配。
我的 synonymMap 看起来像:
{"name":"map",
"format":"solr",
"synonyms":"Gastroenterology (acute and chronic),vomiting, diarrhoea, weight loss\n"}
我在搜索索引中有一些文档,其中包含胃肠病学(急性和慢性)等医学学科。
?search="vomiting" 之后我收到的是:
{
"@search.score": 1.0405536,
"@search.highlights": {
"disciplines/name": [
"<em>Acute</em> <em>and</em> <em>chronic</em> ear disease",
"<em>Acute</em> <em>and</em> <em>chronic</em> skin disease",
"<em>Gastroenterology</em> (<em>acute</em> <em>and</em> <em>chronic</em>)",
"Haematology (<em>acute</em> <em>and</em> <em>chronic</em>)",
"Respiratory medicine (<em>acute</em> <em>and</em> <em>chronic</em>)"
],
我期待:
{
"@search.score": 1.0405536,
"@search.highlights": {
"disciplines/services/translatedName": [
"<em>Gastroenterology (acute and chronic)</em>",
],
我做错了吗?
我试图将主要词剪切成一个单词,例如 Gastroenterology,但其中一些根本无法剪切。
提供像synonyms => "Gastroenterology (acute and chronic)" 这样的引号也不起作用。
更新
我想知道为什么我认为有问题。 好吧,我提供了:
{"name":"map",
"format":"solr",
"synonyms":"Gastroenterology (acute and chronic),vomiting, diarrhoea, weight loss\n"}
实际使用:
{"name":"map",
"format":"solr",
"synonyms":"Gastroenterology (acute and chronic),vomiting, diarrhoea, weight loss
=> Gastroenterology (acute and chronic)\n"}
在这种情况下,我得到 4 个结果:
"@odata.count": 4,
"value": [
{
"@search.score": 1.0137179,
"@search.highlights": {
"disciplines/services/translatedName": [
"<em>Acute</em> <em>and</em> <em>chronic</em> ear disease",
"<em>Acute</em> <em>and</em> <em>chronic</em> skin disease",
"<em>Gastroenterology</em> (<em>acute</em> <em>and</em> <em>chronic</em>)",
"Haematology (<em>acute</em> <em>and</em> <em>chronic</em>)",
"Respiratory medicine (<em>acute</em> <em>and</em> <em>chronic</em>)"
],
"equipment/translatedName": [
"Emergency <em>and</em> crictial care",
"In house skin <em>and</em> ear cyology"
],
"disciplines/translatedName": [
"Anaesthesia <em>and</em> analgesia",
"Emergency <em>and</em> critical care"
]
},
...
{
"@search.score": 0.33542877,
"@search.highlights": {
"disciplines/services/translatedName": [
"<em>Chronic</em> pain management"
],
"disciplines/translatedName": [
"Anaesthesia <em>and</em> analgesia"
]
},
...
{
"@search.score": 0.13757591,
"@search.highlights": {
"equipment/translatedName": [
"Emergency <em>and</em> crictial care"
],
"disciplines/translatedName": [
"Emergency <em>and</em> critical care"
]
},
...
{
"@search.score": 0.07112321,
"@search.highlights": {
"disciplines/services/translatedName": [
"<em>Chronic</em> pain management"
]
},
你能解释一下在这种情况下它是如何工作的吗?
【问题讨论】: