Hello, i used script fileds to return value if sessionDate : null return 'never check'
My script do half work and don't return the value 'never check' when it==null
in my case doc[' sessionDate'] it's a list that's why I use the collection and in the collection don't retrieve null values, it's not indexed when it's null,
I found a solution by changing the mapping when it is null to replace the value null value
on first I wanted to used painless but I need to get the date right now this option don't exists in painless" topic get date right now in painless"
i have this answer for Elastic Team Member :
Scripted fields in Kibana simply use Elasticsearch's Painless scripting language. Unfortunately, that language can only be used to work with numbers, booleans, voids, and arrays. Since there is no way to operate on dates in the language, there is no way to calculate the difference between dates in scripted fields.
in the first exemple of topic Fields aggregation or field formatter?
he test if the value it's not null it's work for me too but return value when it's null it's not working
his exemple :
if (doc['name.keyword'].value != null)
return doc['name.keyword'].value;
if (doc['firstName.keyword'].value != null)
return doc['firstName.keyword'].value;
if (doc['fullName.keyword'].value != null)
return doc['fullName.keyword'].value;
what I want
if (doc['name.keyword'].value == null){
return 'it's null '
}
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.