- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用类型设置为 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/
我有代表用户的文档。它们有字段 name 和 surname。 假设我有两个用户编入索引 - Michael Jackson 和 Michael Starr。我希望这些示例搜索有效: Michael
我正在尝试使用类型设置为 cross_fields 的 elasticsearch(版本 1.0)多匹配查询,就像 elasticsearch 页面 here 上的手册一样: 查询看起来像这样(和 e
我有一个类型为 cross_fields 的 multi_match 查询,我想通过前缀匹配对其进行改进。 { "index": "companies", "size": 25, "fro
我是一名优秀的程序员,十分优秀!