I am creating an index with a property called text
and two fields called english
and metaphone
.
I am able to search on the metaphone
value, but I can't see what the value is actually being stored/converted to (in this case, I know it's converted to "MNFK"
, but I want to actually check it within ElasticSearch)
How can I view all the fields for my document?
# Create a mapping to the metaphone value...
PUT ${indexName}
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"metaphone_anlayzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"metaphone_filter"
]
}
},
"filter": {
"metaphone_filter": {
"type": "phonetic",
"encoder": "metaphone",
"replace": false
}
}
}
}
},
"mappings": {
"properties": {
"text": {
"type": "text",
"fields": {
"english": {
"type": "text",
"analyzer": "english",
"store": true
},
"metaphone": {
"type": "text",
"analyzer": "metaphone_anlayzer",
"store": true
}
}
}
}
}
}
# Add an entry...
PUT ${indexName}/_doc/1
{ "text": "Magnavox" }
# Search by the metaphone value...
GET ${indexName}/_search
{
"query": {
"multi_match": {
"query": "MNFK",
"fields": [
"text",
"text.english",
"text.metaphone"
],
"type": "most_fields"
}
}
}
# This doesn't show my field values...
GET ${indexName}/_doc/1