gpt4 book ai didi

elasticsearch - [simple_query_string] 中 START_OBJECT 的未知键

转载 作者:行者123 更新时间:2023-12-02 22:46:09 30 4
gpt4 key购买 nike

在 elasticsearch 5.6.2 和 5.6.3 (Ubuntu 16.04) 中,这个查询

GET _search
{
"simple_query_string": {
"query": "test1 + test2",
"analyzer": "snowball",
"fields": ["myfield"],
"default_operator": "and"
}
}

导致这个错误

{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "Unknown key for a START_OBJECT in [simple_query_string].",
"line": 2,
"col": 44
}
],
"type": "parsing_exception",
"reason": "Unknown key for a START_OBJECT in [simple_query_string].",
"line": 2,
"col": 44
},
"status": 400
}

这与此处的第一个示例几乎相同https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html

有人可以帮助我吗?

最佳答案

您需要在 query 部分中包含 simple_query_string,如下所示:

GET _search
{
"query": {
"simple_query_string": {
"query": "test1 + test2",
"analyzer": "snowball",
"fields": ["myfield"],
"default_operator": "and"
}
}
}

关于elasticsearch - [simple_query_string] 中 START_OBJECT 的未知键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46771935/

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