我有一個下面提到的非常簡單的彈性查詢。
{
"query": {
"bool": {
"must": [
{
"bool": {
"minimum_should_match": 1,
"should": [
{
"match": {
"tag": {
"query": "Audience: PRO Brand: Samsung",
"boost": 3,
"operator": "and"
}
}
},
{
"match": {
"tag": {
"query": "audience: PRO brand samsung",
"boost": 2,
"operator": "or"
}
}
}
]
}
}
]
}
}
}
我想知道如果我在查詢中添加提升,是否會因此對性能產生任何影響,并且如果您有一個非常大的資料集,其中搜索詞的出現很常見,那么提升也會有所幫助。
uj5u.com熱心網友回復:
Elasticsearch 添加了帶有默認值的 boost 引數,IMO 給出不同的值不會對性能產生太大影響,但您應該能夠自己測量它。
注冊。您的第二個問題,在搜索詞常見的地方添加 boost 絕對有意義,這將幫助您找到相關檔案。例如:假設您query在包含 Elasticsearch 帖子的索引中搜索(查詢將在 Elasticsearch 帖子中非常常見),但您希望對具有標簽的檔案給予更多權重elasticsearch-query。在這種情況下添加提升,將為您提供更相關的結果。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/456492.html
標籤:弹性搜索 木花 solr-boost
上一篇:如何匹配多字詞?
下一篇:使用后洗掉grok匹配欄位
