December 2015
Intermediate to advanced
176 pages
3h 25m
English
You can define an analyzer both in the index_analyzer and the search_analyzer member over a field in the mapping process. Also, Elasticsearch allows you to use different analyzers in separate fields.
The following command shows us the mapping for the fields that an analyzer defined:
curl -XPUT localhost:9200/blog -d '{
"mappings": {
"article": {
"properties": {
"title": {
"type": "string", "index_analyzer": "simple"
},
"content": {
"type": "string", "index_analyzer": "whitespace", "search_analyzer": "standard"
}
}
}
}
}'
{"acknowledged":true}We defined a simple analyzer to the title field, and whitespace analyzer to the content field by the preceding configuration. Also, the search analyzer refers ...
Read now
Unlock full access