# Preserve\_position\_increments mapping with stop analyzer not searching for middle words

**URL:** <https://discuss.elastic.co/t/preserve-position-increments-mapping-with-stop-analyzer-not-searching-for-middle-words/140554>\
**Category:** Elasticsearch\
**Created:** [July 18, 2018, 12:41pm UTC](https://discuss.elastic.co/t/preserve-position-increments-mapping-with-stop-analyzer-not-searching-for-middle-words/140554 "2018-07-18T12:41:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anshul.chhangani](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@anshul.chhangani](https://discuss.elastic.co/u/anshul.chhangani)\
**Post date:** [July 18, 2018, 12:41pm UTC](https://discuss.elastic.co/t/preserve-position-increments-mapping-with-stop-analyzer-not-searching-for-middle-words/140554/1 "2018-07-18T12:41:01Z")

</div>

Hey,  
Similar queries have been previously posted but none of the solutions are working for me.

Elasticsearch Version 5.5.3

Have set the preserve\_position\_increments as false and have tried "stop", "standard" and "simple" analyzers, but not able to get the results if the suggestion text doesn't match with the starting of the input, i.e suggestion not working for middle words.  
Mapping

```
 "course_suggest": {
                            "type": "completion",
                            "analyzer": "stop",
                            "search_analyzer": "stop",
                            "preserve_separators": false,
                            "preserve_position_increments": false,
                            "max_input_length": 50
                        }

```

Sample data:  
course\_suggest: ["B.tech CSE"]

Post Request:  
[http://localhost:9200/index/\_search?pretty](http://localhost:9200/index/_search?pretty)

```
{
     "suggest" : {
          	"course_suggestion": {
         	    "text" : "B.tech",
          	    "completion" : {
          	        "field" : "courses_suggest",
          	        "size": 10
          	     }
          	}
     }
}

```

The above request works but if I query with the text "CSE" no results are found.

---

<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:** [August 15, 2018, 12:55pm UTC](https://discuss.elastic.co/t/preserve-position-increments-mapping-with-stop-analyzer-not-searching-for-middle-words/140554/2 "2018-08-15T12:55:07Z")

</div>

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