0
votes

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

1 Answers

0
votes

Try this:

{
  "query": {
    "match": {
      "inventionTitle": "dog chew"
    }
  }
}
  1. The field name in the screenshot is inventionTitle not invention-title.
  2. https://www.elastic.co/guide/en/elasticsearch/reference/1.6/query-dsl-match-all-query.html - use match instead of match_all. match_all doesn't accept a search query.