Last active
November 14, 2017 22:09
-
-
Save tsouza/b9ac51632a3545daceee3b0c86eb68a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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