Commit 5b8ef310 authored by Pablo Panero's avatar Pablo Panero
Browse files

jsonschemas/mapping[webservices]: add suggest field for search-as-you-type

parent 9f307718
...@@ -66,6 +66,12 @@ ...@@ -66,6 +66,12 @@
} }
} }
}, },
"suggest": {
"type": "array",
"items": {
"type": "string"
}
},
"promoted": { "promoted": {
"type": "boolean" "type": "boolean"
}, },
......
...@@ -7,6 +7,14 @@ ...@@ -7,6 +7,14 @@
"url_tokenizer": { "url_tokenizer": {
"type": "pattern", "type": "pattern",
"pattern": "\\.|(\\:\\/\\/)|\\/" "pattern": "\\.|(\\:\\/\\/)|\\/"
},
"autocomplete": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 20,
"token_chars": [
"letter"
]
} }
}, },
"filter":{ "filter":{
...@@ -20,6 +28,15 @@ ...@@ -20,6 +28,15 @@
"type": "custom", "type": "custom",
"tokenizer": "url_tokenizer", "tokenizer": "url_tokenizer",
"filter": ["url_stop"] "filter": ["url_stop"]
},
"autocomplete": {
"tokenizer": "autocomplete",
"filter": [
"lowercase"
]
},
"autocomplete_search": {
"tokenizer": "lowercase"
} }
}, },
"normalizer": { "normalizer": {
...@@ -61,6 +78,7 @@ ...@@ -61,6 +78,7 @@
"properties": { "properties": {
"name": { "name": {
"type": "text", "type": "text",
"copy_to": "suggest",
"analyzer": "english", "analyzer": "english",
"fields": { "fields": {
"french": { "french": {
...@@ -111,6 +129,7 @@ ...@@ -111,6 +129,7 @@
}, },
"authors": { "authors": {
"type": "text", "type": "text",
"copy_to": "suggest",
"fields": { "fields": {
"exact_match": { "exact_match": {
"type": "keyword", "type": "keyword",
...@@ -120,6 +139,11 @@ ...@@ -120,6 +139,11 @@
} }
} }
}, },
"suggest": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "autocomplete_search"
},
"promoted": { "promoted": {
"type": "boolean" "type": "boolean"
}, },
......
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