Slide 87
Slide 87 text
exercise: write a custom analyzer
tags: "red, two-headed, striped, really dangerous"
!
curl -XGET -s 'http://localhost:9200/_analyze?analyzer=whitespace&pretty=true' -d
'red, two-headed, striped, really dangerous'
red two-headed striped really dangerous
curl -s -XGET 'http://127.0.0.1:9200/test/
monster/_search?pretty' -d '{
"query": {
"match_all": {}
},
"filter": {
"term": {"tags": "dangerous"}
}
}
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "test",
"_type" : "monster",
"_id" : "1",
"_score" : 1.0, "_source" : {
"title": "Scarlet Klackinblax",
"tags": "red, two-headed, striped, really dangerous"
}
} ]
}
}