Dynamic templates is the approach to take to be able to configure copy_to to another field or fields for dynamic fields i.e. fields whose names you don't know ahead of time and can provide explicit mapping for.
Your example looks good and produces the following request (I'm assuming you're using NEST 6.x based on the CreateIndex() method call)
{
"mappings": {
"appbuilder": {
"dynamic_templates": [
{
"all_strings": {
"mapping": {
"type": "text",
"copy_to": [
"_ternarySearch"
],
"index": true
},
"match_mapping_type": "string"
}
}
],
"properties": {
"suggest": {
"type": "completion"
}
}
}
}
}
This will map new string fields within the _source document as text field mapping, index the results of running the field value through analysis against the field name in the inverted index ("index": true, which is the default), and also copy the field value to "_ternarySearch" field, index the results of running the field value through analysis and index them in the inverted index against the "_ternarySearch" field.
Note that the original _source document sent to Elasticsearch is not changed by this process, and is persisted verbatim as it was sent in, meaning that the _source returned in the hits for documents matching a query will not contain a "_ternarySearch" field, because it didn't exist on _source.