# Elasticsearch dealing with overspecific terms

**URL:** <https://discuss.elastic.co/t/elasticsearch-dealing-with-overspecific-terms/60787>\
**Category:** Elasticsearch\
**Created:** [September 17, 2016, 2:35pm UTC](https://discuss.elastic.co/t/elasticsearch-dealing-with-overspecific-terms/60787 "2016-09-17T14:35:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Athar.Khan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/athar.khan/32/11951_2.png) [@Athar.Khan](https://discuss.elastic.co/u/Athar.Khan)\
**Post date:** [September 17, 2016, 2:35pm UTC](https://discuss.elastic.co/t/elasticsearch-dealing-with-overspecific-terms/60787/1 "2016-09-17T14:35:36Z")

</div>

I want to be able to deal with over-specific search terms. So that if a user search for "taxation" I want to be able to include results for tax as well but only if it presents in title field. Below is my Elasticsearch configs. I'm using version 1.5.

**Settings**

```
{  

"content_pages":{  
      "settings":{  
         "index":{  
            "creation_date":"1473848573964",
            "analysis":{  
               "analyzer":{  
                  "string_analyzer":{  
                     "filter":[  
                        "standard",
                        "lowercase",
                        "stop",
                        "asciifolding"
                     ],
                     "char_filter":[  
                        "html_strip"
                     ],
                     "type":"custom",
                     "tokenizer":"standard"
                  }
               }
            },
            "number_of_shards":"2",
            "number_of_replicas":"0",

         }
      }
   }
}

```

**Mappings**

```
"mappings":{  
     "content_page_type":{  
        "_all":{  
           "auto_boost":true
        },
        "properties":{  
           "author":{  
              "type":"integer"
           },
           "body:value":{  
              "type":"string",
              "boost":13.0,
              "analyzer":"string_analyzer"
           },
           "id":{  
              "type":"integer",
              "include_in_all":false
           },
           "title":{  
              "type":"string",
              "boost":21.0,
              "analyzer":"string_analyzer"
           },
           "type":{  
              "type":"string",
              "index":"not_analyzed",
              "analyzer":"string_analyzer"
           }
        }
     }
  }

```

**Query**

```
{  
   "from":0,
   "size":"10",       
   "query":{  
      "bool":{  
         "must":[  
            {  
               "multi_match":{  
                  "query":"taxation",
                  "fields":[  
                     "body:value^13.0",
                     "content_page_tab_data^13.0",
                     "field_body:value^13.0",
                     "field_tabs_page_body:value^13.0",
                     "title^21.0"
                  ]
               }
            }
         ],
         "should":[  
            {  
               "query_string":{  
                  "query":"(taxation)",
                  "fields":[  
                     "body:value^13.0",
                     "content_page_tab_data^13.0",
                     "field_body:value^13.0",
                     "field_tabs_page_body:value^13.0",
                     "title^21.0"
                  ]
               }
            },
            {
               "fuzzy_like_this" : {
                  "fields" : ["title"],
                  "like_text" : "taxation",
                  "fuzziness": "AUTO"
                }
            }
         ]
      }
   }       
}

```

Above query does not return results with title that contains "tax" but "taxation" only. I also don't want to include irrelevant results such as "relation" or "action".

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [September 17, 2016, 3:05pm UTC](https://discuss.elastic.co/t/elasticsearch-dealing-with-overspecific-terms/60787/2 "2016-09-17T15:05:33Z")

</div>

Usually the way to hand this is with stemming. There are a couple of  
English stammers included in Elasticsearch and you can customize them to  
some degree with stemmer overrides. Play around with that and the analysis  
API to see if you can get what you want. It isn't magic, just heuristics.

---

<div class="post-metadata">

**Author:** ![Athar.Khan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/athar.khan/32/11951_2.png) [@Athar.Khan](https://discuss.elastic.co/u/Athar.Khan)\
**Post date:** [September 17, 2016, 5:41pm UTC](https://discuss.elastic.co/t/elasticsearch-dealing-with-overspecific-terms/60787/3 "2016-09-17T17:41:46Z")

</div>

Thanks for pointing me towards the right direction.

---

<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:** [July 5, 2017, 10:19pm UTC](https://discuss.elastic.co/t/elasticsearch-dealing-with-overspecific-terms/60787/4 "2017-07-05T22:19:26Z")

</div>


