How can I create a mapping that will tokenize the string on whitespace and also change it to lowercase for indexing?
This is my current mapping that tokenizes by whitespace by I cant understand how to lowercase it and also search (query) the same...
{
"mappings": {
"my_type" : {
"properties" : {
"title" : { "type" : "string", "analyzer" : "whitespace", "tokenizer": "whitespace", "search_analyzer":"whitespace" }
}
}
}
}
Please help...
You have two options -
Simple Analyser
the simple analyser will probably meet your needs:
To use the simple analyser in your mapping:
Custom Analyser
Second option is to define your own custom analyser and specify how to tokenise and filter the data. Then refer to this new analyser in your mapping.
i managed to write a custom analyzer and this works...