# Elasticsearch multiple search terms

**URL:** <https://discuss.elastic.co/t/elasticsearch-multiple-search-terms/212770>\
**Category:** Elasticsearch\
**Created:** [December 22, 2019, 9:42am UTC](https://discuss.elastic.co/t/elasticsearch-multiple-search-terms/212770 "2019-12-22T09:42:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![salimsaid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/salimsaid/32/59842_2.png) [@salimsaid](https://discuss.elastic.co/u/salimsaid)\
**Post date:** [December 22, 2019, 9:42am UTC](https://discuss.elastic.co/t/elasticsearch-multiple-search-terms/212770/1 "2019-12-22T09:42:43Z")

</div>

I've set an elastic index. I have 100,000 documents all with the following fields

```
{
"Make:": "NISSAN",
"Model:": "FUGA",
"Body Type:": "SEDAN",
"Year of Manufacture:": 2012,
"Country:": "JAPAN",
"Fuel Type:": "PETROL",

}

```

I need to create a search based on four possible terms

1. Make
2. Model
3. Year of Manufacture
4. Fuel Type

Below are four possible combinations for a search query

`2012 nissan fuga petrol`  
`nissan fuga 2012 petrol`  
`petrol 2012 nissan fuga`  
`nissan fuga petrol 2012`

Assuming we have correct spelling on the search query, below is how i tried searching based on the search query

```
curl -X GET "localhost:9200/vehicles/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "simple_query_string" : {
        "query": "2012 NISSAN FUGA PETROL",
        "fields": ["Make","Model","Year of Manufacture","Fuel Type"]
    }
  }
} 

```

Out of surprise, the search didn't return any hits

```
  {
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : []
  }
}

```

Below is more information on my version of elastic

```
{
"name": "salim-HP-EliteBook-840-G5",
"cluster_name": "elasticsearch",
"cluster_uuid": "mSWKP4G1TSSq9rI3Hc0f6w",
"version": {
    "number": "7.5.1",
    "build_flavor": "default",
    "build_type": "tar",
    "build_hash": "3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96",
    "build_date": "2019-12-16T22:57:37.835892Z",
    "build_snapshot": false,
    "lucene_version": "8.3.0",
    "minimum_wire_compatibility_version": "6.8.0",
    "minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "You Know, for Search"

```

}

How can i make a successful search based on my search criteria ?

---

<div class="post-metadata">

**Author:** ![Opster\_Community1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/opster_community1/32/59062_2.png) [@Opster\_Community1](https://discuss.elastic.co/u/Opster_Community1)\
**Post date:** [December 22, 2019, 2:09pm UTC](https://discuss.elastic.co/t/elasticsearch-multiple-search-terms/212770/2 "2019-12-22T14:09:47Z")

</div>

Please add the mapping of index as well.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 19, 2020, 2:09pm UTC](https://discuss.elastic.co/t/elasticsearch-multiple-search-terms/212770/3 "2020-01-19T14:09:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
