gpt4 book ai didi

elasticsearch - ElasticSearch more_like_this-选项是否在源索引或目标索引上运行?

转载 作者:行者123 更新时间:2023-12-03 02:27:55 62 4
gpt4 key购买 nike

more_like_this函数的一个有用功能是ES,它可以交叉搜索不同的索引(假设字段名称和映射相对应)。

让我感到困惑的一件事是如何在这些情况下应用术语选择参数。

考虑:

max_doc_freq

最大文档频率,高于此频率时,输入文档中的术语将被忽略。为了忽略频繁出现的单词(例如停用词),这可能很有用。默认为无界(Integer.MAX_VALUE,即2 ^ 31-1或2147483647)。

这是原始文档索引上的文档频率吗?还是将其应用于我们正在查询的索引?

例:

GET index_a/_search
{
"query": {
"function_score": {
"query": {
"bool": {
"should": [
{
"more_like_this": {
"boost": 1,
"fields": [
"text"
],
"include": true,
"like": [
{
"_id": "tI2N_24BFVRF37fDxSTT",
"_index": "index_b"
}
],
"max_doc_freq": 50000,
"max_query_terms": 50,
"min_term_freq": 1,
"min_word_length": 4,
"minimum_should_match": "1%",
"stop_words": []
}
}
]
}
},
"script_score": {
"script": "1.0"
}
}
}
}

在这种情况下,最大文档频率设置为50,000。但这是在index_a上吗?或index_b?

最佳答案

多数民众赞成在rewrite phrase查询。所以index_b。将rewrites MLT阶段重写为 bool(boolean) 查询

关于elasticsearch - ElasticSearch more_like_this-选项是否在源索引或目标索引上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60655232/

62 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com