So i have 2 indexes, A which is periodically updated and contains docs with two fields which are email and reviewed. My second index B has lots of fields including email and reviewed, this index im constantly adding to.
I want a pipeline to check the incoming doc (incoming to index B) against Index A to see if it exists and if it does update the incoming doc "reviewed" boolean with the value in index A. Ive added my enrich policy and pipeline below, currently any matches do not get put into the index. Ive found that if i update the "target_field" in the pipeline to anything "test" for example it adds the incoming docs fine but instead of updating the value it puts test.user.email and test.user.reviewed into the doc.
I might be looking at this the wrong way so any suggestions as to how i should go about it would be appreciated.
index A
user.email_address, text
user.reviewed, boolean
index B
user.email_address, text
user.reviewed, boolean
...
This is my current pipeline
[
{
"enrich": {
"policy_name": "reviewed-policy",
"field": "user.email",
"target_field": "user.reviewed}",
"max_matches": "1",
"on_failure": [
{
"set": {
"field": "error.message",
"value": "{{ _ingest.on_failure_message }}"
}
}
]
}
}
]
This is my current enrich policy
PUT /_enrich/policy/ignore-policy
{
"match": {
"indices": "indexA",
"match_field": "user.email",
"enrich_fields": ["reviewed"]
}
}