tengo el siguiente campo en mi definición de asignación:¿Por qué el campo Elasticsearch "not_analyzed" se divide en términos?
...
"my_field": {
"type": "string",
"index":"not_analyzed"
}
...
Cuando índice I un documento con valor de my_field = 'test-some-another'
ese valor se divide en 3 términos: test
, some
, another
.
¿Qué estoy haciendo mal?
creé el siguiente índice:
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"
}
}
}
}
}
}'
Entonces índice del siguiente documento:
curl -XPOST localhost:9200/my_index/my_type -d '{
"my_field": "test-some-another"
}'
Luego uso el plugin https://github.com/jprante/elasticsearch-index-termlist con la siguiente API: curl -XGET localhost:9200/my_index/_termlist
que me da el siguiente respuesta:
{"ok":true,"_shards":{"total":5,"successful":5,"failed":0},"terms": ["test","some","another"]}
¿Puede agregar un ejemplo más detallado que demuestre el problema? ¿Cómo determinó que el test-some-another se divida en 3 términos? – imotov
Modifiqué mi pregunta para responder la tuya. ¡Gracias por la rápida respuesta! – Georgi