I'm trying to compare two fields and ensure one is greater than other. Something like this:
"doc['key1'].value > doc['key2'].value"
But this isn't working as scripting is disabled with my provider. Is there any other alternative to this?
I'm trying to compare two fields and ensure one is greater than other. Something like this:
"doc['key1'].value > doc['key2'].value"
But this isn't working as scripting is disabled with my provider. Is there any other alternative to this?
There isn't another way to compare two values of the same document as part of your search, no.
One work-around might be to index the difference of these two fields, and store the result in another field that you can perform range queries against. However that would require reindexing.
Why didn't I think of this... Thank you for pointing it out.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.