ElasticSearch 多匹配查询 cross_fields 类型

标签 elasticsearch elasticsearch-jdbc-river

我正在尝试使用类型设置为 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/

相关文章:

scala - 使用Spark检索聚集/存储桶

elasticsearch - 运行 Elasticsearch 的河流插件时出现Java noclassdeffounderror

elasticsearch - Elasticsearch-JDBC-初始设置-ClassNotFoundException-JDBCFeeder

elasticsearch - 当河流通过 Elasticsearch 更新数据时,丢失的数据会被删除吗?

嵌套数组上的 Elasticsearch 日期直方图聚合

mysql - Elasticsearch JDBC River MySQL连接超时

c# - 如何使用流畅的映射来映射Dictionary <string,MyDto>类型的属性

mapping - Elasticsearch中的默认数据类型映射

elasticsearch - Elasticsearch提升查询

ElasticSearch Max Agg 在文档的列表属性中的最低值