Hi,
If I want to query a computed value from "a specific document" how this should be written for Kibana or Lucene or in painless script ?
For example, If I want to get delete_time_per_ document = (indexing_delete_time_in_millis / indexing_delete_total) from the two fields in the same index mapping below
One thing you can't do though is query these scripted fields. If you want to do that, you will have to use a script query. For example, the following query will match all docs for which (indexing_delete_time_in_millis / indexing_delete_total) is larger than 1.0:
Be careful with script queries though. They are computationally expensive and can result in errors (for example for document in which the indexing_delete_time_in_millis and indexing_delete_total do not exist, or for documents for which indexing_delete_total is 0.0).
A better way to solve this is to add the actual delete_time_per_ document field to your documents when you index those.
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.