Created
October 16, 2018 08:20
-
-
Save xeraa/9bef12380ead334e70b88f27f9df32b1 to your computer and use it in GitHub Desktop.
Retrieving a copy_to field in Elasticsearch (Kibana syntax)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE my_index | |
PUT my_index | |
{ | |
"settings": { | |
"number_of_shards": 1 | |
}, | |
"mappings": { | |
"_doc": { | |
"properties": { | |
"first_name": { | |
"type": "text", | |
"copy_to": "full_name" | |
}, | |
"last_name": { | |
"type": "text", | |
"copy_to": "full_name" | |
}, | |
"full_name": { | |
"type": "text", | |
"store": true | |
} | |
} | |
} | |
} | |
} | |
PUT my_index/_doc/1 | |
{ | |
"first_name": "John", | |
"last_name": "Smith" | |
} | |
GET my_index/_search | |
{ | |
"stored_fields": [ "first_name", "full_name" ] | |
} | |
GET my_index/_doc/1/_termvectors | |
{ | |
"fields" : ["last_name", "full_name"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment