Skip to content

Instantly share code, notes, and snippets.

@tsouza
Last active November 14, 2017 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsouza/b9ac51632a3545daceee3b0c86eb68a1 to your computer and use it in GitHub Desktop.
Save tsouza/b9ac51632a3545daceee3b0c86eb68a1 to your computer and use it in GitHub Desktop.
PUT /test_items
{
"mappings": {
"item": {
"properties": {
"name_suggest": {
"type": "keyword"
}
}
}
}
}
POST /test_items/item
{
"name_suggest": [ "foo" ]
}
POST /test_items/item
{
"name_suggest": [ "bar" ]
}
POST /test_items/item
{
"name_suggest": [ "foo", "foot", "foo foot" ]
}
// Expects results "foo", "foot" and "foo foot" but I get none
POST /test_items/item/_search
{
"suggest": {
"name_suggest": {
"text": "foo",
"term": {
"field": "name_suggest",
"min_word_length": 1
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment