I am trying to add a weight to a completion suggest field using logstash, but I'm getting errors. Has anybody done this?
The completion suggester field is set up as follows:
display_name": {
"type": "text",
"fields": {
"complete": {
"type": "completion",
"analyzer": "simple",
"preserve_separators": true,
"preserve_position_increments": true,
"max_input_length": 50
},
"keyword": {
"type": "keyword"
}
}
},
What I want to do is add a weight to this field when I add records via logstash. The value for weight is in another field called cited_by_count. I tried it in logstash like this:
mutate {
add_field => { "[display_name][weight]" => "%{cited_by_count}"}
remove_field => ["json_save", "version"]
}
But when I tried to run it I got multiple errors, saying:
[main] Exception caught while applying mutate filter {:exception=>"Could not set field 'weight' on object 'Zenun Kast' to value '331'.This is probably due to trying to set a field like [foo][bar] = someValuewhen [foo] is not either a map or a string"}