-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Description
Elasticsearch version:
5.0.0-alpha5
Plugins installed: []
JVM version:
1.8
OS version:
Mac OS X El Capitan
Description of the problem including expected versus actual behavior:
https://www.elastic.co/guide/en/elasticsearch/reference/master/search-suggesters-completion.html
I was trying to uplift the below blog entry:
https://www.elastic.co/blog/you-complete-me
Steps to reproduce:
Simple hotels index with type hotels
Index creation
PUT /hotels
{
"settings": {
"analysis": {
"analyzer": {
"suggest_synonyms": {
"type": "custom",
"tokenizer": "lowercase",
"filter": [ "my_synonyms" ]
}
},
"filter": {
"my_synonyms": {
"type": "synonym",
"synonyms": [ "courtyard, marriot" ]
}
}
}
},
"mappings": {
"hotel" : {
"properties" : {
"name" : { "type" : "string" },
"city" : { "type" : "string" },
"name_suggest" : {
"type" : "completion",
"analyzer" : "suggest_synonyms",
"search_analyzer" : "suggest_synonyms"
}
}
}
}
}
Hotel doc
PUT /hotels/hotel/1
{
"name" : "Mercure Hotel Munich",
"city" : "Munich",
"name_suggest" : {
"input" : [
"Mercure Hotel Munich",
"Mercure Munich"
],
"weight": 5
}
}
Suggest query is
POST /hotels/_suggest?pretty
{
"hotels" : {
"prefix" : "coutr",
"completion" : {
"field" : "name_suggest",
"payload": ["city"],
"fuzzy" : {
"fuzziness" : 2
}
}
}
}
Error is:
"reason": {
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [city] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
}
Thanks,
Shane.
Metadata
Metadata
Assignees
Labels
No labels