У меня есть следующее поле в определении сопоставления:
...
"my_field": {
"type": "string",
"index":"not_analyzed"
}
...
Когда я индексирую документ со значением my_field = 'test-some-another'
это значение разделено на 3 термина: test
, some
, other
.
Что я делаю не так?
Я создал следующий индекс:
curl -XPUT localhost:9200/my_index -d '{
"index": {
"settings": {
"number_of_shards": 5,
"number_of_replicas": 2
},
"mappings": {
"my_type": {
"_all": {
"enabled": false
},
"_source": {
"compressed": true
},
"properties": {
"my_field": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}'
Затем я индексирую следующий документ:
curl -XPOST localhost:9200/my_index/my_type -d '{
"my_field": "test-some-another"
}'
Затем я использую плагин https://github.com/jprante/elasticsearch-index-termlistс следующий API:
завиток -XGET локальный: 9200/мой_индекс/_termlist
Это дает мне следующий ответ:
{"ok":true,"_shards":{"total":5,"successful":5,"failed":0},"terms": ["test","some","another"]}