Commit 21d77919 authored by Pablo Panero's avatar Pablo Panero
Browse files

jsonschemas/mapping[test]: refactor search-as-you-type analyzer and add did-you-mean

parent 11202e94
......@@ -43,6 +43,9 @@
"suggest": {
"type": "string"
},
"didyoumean": {
"type": "string"
},
"control_number": {
"type": "string"
},
......
......@@ -7,11 +7,18 @@
"autocomplete": {
"tokenizer": "autocomplete",
"filter": [
"lowercase"
"lowercase",
"asciifolding"
]
},
"autocomplete_search": {
"tokenizer": "lowercase"
"didyoumean": {
"type": "custom",
"tokenizer": "standard",
"filter": ["lowercase", "asciifolding", "shingle"]
},
"suggester_search": {
"tokenizer": "standard",
"filter": ["lowercase"]
}
},
"tokenizer": {
......@@ -23,6 +30,13 @@
"letter"
]
}
},
"filter": {
"shingle": {
"type": "shingle",
"min_shingle_size": 2,
"max_shingle_size": 3
}
}
}
},
......@@ -54,15 +68,29 @@
"type": "object",
"properties": {
"title": {
"type": "keyword",
"copy_to": "suggest"
"type": "text",
"analyzer": "english",
"copy_to": [
"suggest",
"didyoumean"
],
"fields": {
"exact_match": {
"type": "keyword"
}
}
}
}
},
"suggest": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "autocomplete_search"
"search_analyzer": "suggester_search"
},
"didyoumean": {
"type": "text",
"analyzer": "didyoumean",
"search_analyzer": "suggester_search"
},
"control_number": {
"type": "keyword"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment