gpt4 book ai didi

ElasticSearch 多匹配查询 cross_fields 类型

转载 作者:行者123 更新时间:2023-11-29 02:57:14 25 4
gpt4 key购买 nike

我正在尝试使用类型设置为 cross_fields 的 elasticsearch(版本 1.0)多匹配查询,就像 elasticsearch 页面 here 上的手册一样:

查询看起来像这样(和 elasticsearch 页面完全一样):

{
"multi_match" : {
"query": "Robert Smith",
"type": "cross_fields",
"fields": [ "vorname", "familienname" ],
"operator": "and"
}
}

索引是使用 jdbc river(具有自动映射)插件创建的,并且可以与其他查询一起正常工作。当我删除类型:cross_fields 或将其更改为 phrase_prefix 时,它工作正常。当我将它更改为其他类型时,如 most_fields 它也不起作用。我得到的错误看起来像这样:

{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[WXL5tNBeQB6tW0xLDPURRA][df_smsdata][3]: SearchParseException[[df_smsdata][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"query\":\"Robert Smith\",\"type\":\"cross_fields\",\"fields\":[\"vorname\",\"familienname\"]}}}]]]; nested: QueryParsingException[[df_smsdata] **[multi_match] query does not support type cross_fields];** }{[WXL5tNBeQB6tW0xLDPURRA][df_smsdata][2]: SearchParseException[[df_smsdata][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"query\":\"Robert Smith\",\"type\":\"cross_fields\",\"fields\":[\"vorname\",\"familienname\"]}}}]]]; nested: QueryParsingException[[df_smsdata] [multi_match] query does not support type cross_fields]; }{[WXL5tNBeQB6tW0xLDPURRA][df_smsdata][4]: SearchParseException[[df_smsdata][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"query\":\"Robert Smith\",\"type\":\"cross_fields\",\"fields\":[\"vorname\",\"familienname\"]}}}]]]; nested: QueryParsingException[[df_smsdata] [multi_match] query does not support type cross_fields]; }{[WXL5tNBeQB6tW0xLDPURRA][df_smsdata][1]: SearchParseException[[df_smsdata][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"query\":\"Robert Smith\",\"type\":\"cross_fields\",\"fields\":[\"vorname\",\"familienname\"]}}}]]]; nested: QueryParsingException[[df_smsdata] [multi_match] query does not support type cross_fields]; }{[WXL5tNBeQB6tW0xLDPURRA][df_smsdata][0]: SearchParseException[[df_smsdata][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"multi_match\":{\"query\":\"Robert Smith\",\"type\":\"cross_fields\",\"fields\":[\"vorname\",\"familienname\"]}}}]]]; nested: QueryParsingException[[df_smsdata] [multi_match] query does not support type cross_fields]; }]",
"status": 400
}

我可以看到查询不支持cross_fields的解析异常。创建索引时我必须设置什么吗?

最佳答案

在您的链接文档中它说:

多匹配查询的类型

备注在 1.1.0 中添加。

http://www.elasticsearch.org/blog/elasticsearch-1-1-0-released/ 中也提到了

您需要下载较新的版本。

关于ElasticSearch 多匹配查询 cross_fields 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22450994/

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