I am trying to build an ElasticSearch index which will have documents with product names, for instance of laptops - 

```
{ "name" : "Laptop Blue I7"}

```

Then I want to use it for autocomplete suggestion by querying the ES index. I have 2 main constraints:

1. There can be Synonyms of the name -

I want to define Synonyms for terms, like "Notebook" for "Laptop"
The ingested documents can be of the following kind - 

```
"Laptop Blue I7"
"Laptop Blue I7"
"Laptop Blue I7"
"Laptop Blue I7"
"Laptop Red I7"
"Laptop Red I7"
"Notebook Blue I7"

```

Now, I am adding the following settings and mapping file while creating the index - 

```
{
  "settings": {
    "index": {
      "analysis": {
        "filter" : {
                    "synonym" : {
                        "type" : "synonym",
                        "synonyms" : ["Laptop,Notebook"]
                    }
                },
        "analyzer": {
        "synonym" : {
                        "tokenizer" : "keyword",
                        "filter" : ["synonym"]
                    }
}}}}, 
"mappings": {
    "catalog": {
      "properties": {
        "name": {
          "type": "text",
          "analyzer": "synonym"
        }
      }
    }
  }
}

```

2. Querying -

When I query the data, with "Notebook", 
the preferred response should be ordered in terms of frequency and synonym. However, when I query, the response is normally independent of the synonym and frequency. I use the following query - 

```
/_search
{"query": {
        "query_string" : {"default_field" : "name", "query" : "Notebook"}
            } }

```

The response I get is - 

```
"Notebook Blue I7"

```

While I would hope the response to be either of the following - 

```
"Laptop Blue I7"
"Laptop Red I7"

```

or 

```
"Notebook Blue I7"
"Laptop Blue I7"
"Laptop Red I7"

```

Any insights in resolving this would be helpful. Thanks 

========
Edit 1: 

When I use `\_analyze` on "Notebook" the response is 

```
{'tokens': [{'end_offset': 3,
             'position': 0,
             'start_offset': 0,
             'token': 'Notebook',
             'type': '<ALPHANUM>'},
            {'end_offset': 3,
             'position': 0,
             'start_offset': 0,
             'token': 'Laptop',
             'type': 'SYNONYM'}]}

```