Is it possible in Elasticsearch to search for documents that have two equal/different properties or a property in the document root is equal/different to a property in a nested property?
For example, I have a document that stores orders, inside it I have a property that stores the delivery address ( delivery_addres
), and inside that document I have an object with the customer's data, including the address where he lives ( customer.addres
).
I would like to search all addresses where the delivery address is different from the customer address where he lives in, but I don't know if Elasticsearch supports this type of search.
My Mapping:
"mappings": {
"properties": {
"delivery_addres": {
"type": "text",
"index": true
}
"customer": {
"properties": {
"addres": {
"type": "text",
"index": true
}
}
}
}
}