Ho il seguente campo nella mia definizione di mappatura:Perché il campo "not_analyzed" di Elasticsearch è suddiviso in termini?
...
"my_field": {
"type": "string",
"index":"not_analyzed"
}
...
Quando ho indice di un documento con valore my_field = 'test-some-another'
tale valore è suddiviso in 3 termini: test
, some
, another
.
Cosa sto sbagliando?
ho creato il seguente indice:
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"
}
}
}
}
}
}'
Poi ho indice il seguente documento:
curl -XPOST localhost:9200/my_index/my_type -d '{
"my_field": "test-some-another"
}'
allora io uso il plugin https://github.com/jprante/elasticsearch-index-termlist con il seguente API: curl -XGET localhost:9200/my_index/_termlist
Questo mi dà il seguente risposta:
{"ok":true,"_shards":{"total":5,"successful":5,"failed":0},"terms": ["test","some","another"]}
È possibile aggiungere un esempio più dettagliato che mostri il problema? Come hai determinato che il test-un-altro-altro è effettivamente suddiviso in 3 termini? – imotov
Ho modificato la mia domanda per rispondere alla tua. Grazie per la rapida risposta! – Georgi