gpt4 book ai didi

elasticsearch - 在Elasticsearch查询中获取解析异常

转载 作者:行者123 更新时间:2023-12-03 01:45:01 25 4
gpt4 key购买 nike

仅当我要添加查询类型时才会发生此错误,但是我需要添加类型,请帮助我。这是我查询ES时遇到的错误

{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "failed to parse [multi_match] query type [knowledge]. unknown type."
}
],
"type": "parse_exception",
"reason": "failed to parse [multi_match] query type [knowledge]. unknown type."
},
"status": 400}

我的查询( Elasticsearch )是:
{
"query": {
"multi_match" : {
"query": "computer",
"type": "knowledge",
"fields": ["topic.name","title" ]
}
}
}`

我在查询中使用“type”和“_type”在我的情况下都不起作用。

最佳答案

这里的类型与您想的不一样。类型的可能变量是best_fields,most_fields等。有关更多详细信息,请引用this

对于您的特定情况,您应该发出这样的请求:

GET index_name/your_type/_search/
{
"query": {
"multi_match" : {
"query": "computer",
"fields": ["topic.name","title" ]
}
}
}

关于elasticsearch - 在Elasticsearch查询中获取解析异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44691387/

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