You have two options -
Simple analyzer
A simple analyzer is likely to satisfy your needs:
curl -XGET 'localhost:9200/myindex/_analyze?analyzer=simple&pretty' -d 'Some DATA' { "tokens" : [ { "token" : "some", "start_offset" : 0, "end_offset" : 4, "type" : "word", "position" : 1 }, { "token" : "data", "start_offset" : 5, "end_offset" : 9, "type" : "word", "position" : 2 } ] }
To use a simple analyzer in your mapping:
{ "mappings": { "my_type" : { "properties" : { "title" : { "type" : "string", "analyzer" : "simple"} } } } }
Custom analyzer
The second option is to define your own custom analyzer and specify how tokenize and filter the data. Then refer to this new analyzer in your mapping.
Olly cruickshank
source share