Why is my very simple ElasticSearch query failing, SearchPhaseExecutionException

时间:2015-07-13 21:03:38

标签: elasticsearch

Im trying to do a search for "dog chew" in the invention-title field in my PatentGrants type.
query url: POST http://localhost:9200/patents/patentGrants/_search
query body:

{
  "query": {
    "match_all": {
      "invention-title": "dog chew"
    }
  }
}

Below is a picture of the data in my patents index and below that is a picture of my query and the error message. Picture of the information in my patents index

My query and resulting exception message

1 个答案:

答案 0 :(得分:0)

试试这个:

{
  "query": {
    "match": {
      "inventionTitle": "dog chew"
    }
  }
}
  1. 屏幕截图中的字段名称为inventionTitle而不是invention-title
  2. https://www.elastic.co/guide/en/elasticsearch/reference/1.6/query-dsl-match-all-query.html - 使用match代替match_allmatch_all不接受搜索查询。