How to restrict field to add data in copy_to method

Hi,
I am using copy_to method where I am trying to allow first_name and last_name to add data and full_name will be read-only. The data will be added into the full_name field automatically.

PUT my_index
{
"mappings": {
"properties": {
"first_name": {
"type": "text",
"copy_to": "full_name"
},
"last_name": {
"type": "text",
"copy_to": "full_name"
},
"full_name": {
"type": "text"
}
}
}
}

can you please explain what the problem or the question here is? Please format your snippets, as you can use markdown in here and provide a full reproducible example (including data being indexed and queries executed) in order to other to reproduce.

Thanks!

Hi,

Thanks for your reply

Here I am trying to concatenate the data from multiple field to a single field.
like I have two field

first_name
last_name

need to store all data from "first_name" and "last_name" into field "full_name"
but i don't want to allow user to add data into field "full_name"
I like to make "full_name" as read only and only copied data from "first_name" and "last_name" field

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.