# Completion suggester: Problems getting suggests of middle words using recommended disabling of preserve\_position\_increments

**URL:** <https://discuss.elastic.co/t/completion-suggester-problems-getting-suggests-of-middle-words-using-recommended-disabling-of-preserve-position-increments/19718>\
**Category:** Elasticsearch\
**Created:** [September 10, 2014, 3:46pm UTC](https://discuss.elastic.co/t/completion-suggester-problems-getting-suggests-of-middle-words-using-recommended-disabling-of-preserve-position-increments/19718 "2014-09-10T15:46:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tom_4/32/1045_2.png) [@Tom\_4](https://discuss.elastic.co/u/Tom_4)\
**Post date:** [September 10, 2014, 3:46pm UTC](https://discuss.elastic.co/t/completion-suggester-problems-getting-suggests-of-middle-words-using-recommended-disabling-of-preserve-position-increments/19718/1 "2014-09-10T15:46:12Z")

</div>

Hi,

referencing  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-suggesters-completion.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-suggesters-completion.html)  
and [http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-suggesters-completion.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-suggesters-completion.html)  
i tried to get suggests from middlewords without success.  
Setup and Request:

#!/bin/bash

DOMAIN='127.0.0.1'  
PORT='9200'  
INDEX='music'  
TYPE='song'

curl -X PUT $DOMAIN:$PORT/hotels -d '  
{  
"mappings": {  
"hotel" : {  
"properties" : {  
"name" : { "type" : "string" },  
"city" : { "type" : "string" },  
"name\_suggest" : {  
"type" : "completion",  
"index\_analyzer" : "stop", # also tried standard, simple ...  
"search\_analyzer" : "stop", # also tried standard, simple ...

```
      "preserve_position_increments": false,
      "preserve_separators": false
    }
  }
}

```

}  
}'

curl -X PUT $DOMAIN:$PORT/hotels/hotel/1 -d '  
{  
"name" : "Mercure Hotel Munich",  
"city" : "Munich",  
"name\_suggest" : {  
"input" : [  
"Mercure Hotel Munich",  
"Mercure Munich"  
]  
}  
}'

curl -X PUT $DOMAIN:$PORT/hotels/hotel/2 -d '  
{  
"name" : "Hotel Monaco",  
"city" : "Munich",  
"name\_suggest" : {  
"input" : [  
"Monaco Munich",  
"Hotel Monaco"  
]  
}  
}'

curl -X PUT $DOMAIN:$PORT/hotels/hotel/3 -d '  
{  
"name" : "Courtyard by Marriot Munich City",  
"city" : "Munich",  
"name\_suggest" : {  
"input" : [  
"Courtyard by Marriot Munich City",  
"Marriot Munich City"  
]  
}  
}'

curl -XPOST $DOMAIN:$PORT/hotels/\_refresh

curl -X POST $DOMAIN:$PORT/hotels/\_suggest?pretty -d '  
{  
"hotels" : {  
"text" : "Munich",  
"completion" : {  
"field" : "name\_suggest"  
}  
}  
}'

Response:  
{  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hotels" : [ {  
"text" : "Munich",  
"offset" : 0,  
"length" : 6,  
"options" : []  
} ]  
}

Any suggestions? Checked this against ES 1.3.2.

Thx in advance,  
Tom

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/72f73b37-6432-4b61-82b9-2b078d956d3f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/72f73b37-6432-4b61-82b9-2b078d956d3f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:03am UTC](https://discuss.elastic.co/t/completion-suggester-problems-getting-suggests-of-middle-words-using-recommended-disabling-of-preserve-position-increments/19718/2 "2017-07-06T01:03:16Z")

</div>


