`multi_match``phrase_prefix`查询使用`_all` [英] `multi_match` `phrase_prefix` query using `_all`

查看:566
本文介绍了`multi_match``phrase_prefix`查询使用`_all`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题沸腾到这个意想不到的行为:



我正在使用这些内容的测试索引:

  DELETE / test_index?ignore_unavailable = true 

POST / test_index / content / 1
{
name: lorem
}

现在我不能做一个 multi_match phrase_prefix 查询使用 _all ,搜索例如



也就是说,以下查询产生0个结果:

  POST / test_index / content / _search 
{
查询:{
multi_match:{
查询:lore,
fields:[
_all
],
type:phrase_prefix
}
}
}

查询更改为 lorem (完整的术语),产生预期的文件。



更改查询以匹配 name 字段具体,也可以使用。



我已经在ES 2.3.1上尝试过了。任何人都可以确认,解释或给出解决方案?

解决方案

这应该在ES 5.1中工作OOTB。


I have an issue boiling down to this unexpected behavior:

I'm using a test index with these contents:

DELETE /test_index?ignore_unavailable=true

POST /test_index/content/1
{
  "name": "lorem"
}

Now I cannot do a multi_match phrase_prefix query using _all, searching for e.g. lore.

That is, the following query yields 0 results:

POST /test_index/content/_search
{
  "query": {
    "multi_match": {
      "query": "lore",
      "fields": [
        "_all"
      ],
      "type": "phrase_prefix"
    }
  }
}

Changing the query to lorem (the complete term), yields the expected document.

Changing the query to match the name field specifically, also works.

I've tried this on ES 2.3.1. Could anyone confirm, explain, or give a solution?

解决方案

This should work OOTB in ES 5.1.

这篇关于`multi_match``phrase_prefix`查询使用`_all`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆