Just checking to see if anyone has a solution to this? In a relational system I would do something in a query like WHERE date1 GT date2
thus comparing data from the two columns. Is something like this an option in Lucene or ES?
I tested it in my Kibana , although my test fields were numbers - but I'm sure it will work with dates.
One thing to note though is that you'll need to have groovy scripting enabled on your elasticsearch for it to work.
I dont think it Is by default - sorry, for got about that.
Just edit your /etc/elasticsearch/elasticsearch.yml file and
add add script.disable_dynamic: true to the bottom. Or change from false to true if it already exists.
Of course enabling dynamic scripting does have some security (amongst other) implications... so consider this scripting page.
Having thought about the security implications we would like to investigate getting this to work in the Kibana search bar first. Am I correct in thinking that we would not have to allow scripting in that case? Also, and I have researched this far and wide and found nothing to help, could someone please provide an example of the syntax one would use to compare two fields in the Kibana search bar? I have looked at the query string query documentation but found no obvious solutions.
Of course having posted the previous message we then immediately decided that allowing scripting would be OK so having enabled it this syntax now works in the Kibana search bar:
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.