绊脚石乃是进身之阶。

query_string里default_field带type前缀无法搜索出结果

Elasticsearch | 作者 lilongsy | 发布于2016年03月31日 | 阅读数:5567

query_string里default_field带type前缀无法搜索出结果,搜索_all或不带前缀的title、content出结果,请问什么原因?谢谢

query_string里,
这样写有问题:
GET collection/headlines/_search
{
  "query": {
    "query_string": {
      "default_field": "title",
      "query": "开盘:耶伦鸽派立场推动美股周三高开"
    }
  }
}
这样写就没问题:
GET collection/headlines/_search
{
  "query": {
    "query_string": {
      "default_field": "headlines.title",
      "query": "开盘:耶伦鸽派立场推动美股周三高开"
    }
  }
}


1.png



2.png

mapping配置如下:
3.png

 
已邀请:

medcl - 今晚打老虎。

赞同来自:

已经不支持在字段名中带type名前缀了
https://www.elastic.co/guide/e ... moved

要回复问题请先登录注册