Hi,
I am trying to create a new field to calculate the duration, during the creation of the field I did not find any issue or error, but while refreshing the Discover page throwing the below error.
Please format your code in the future ... you have to check if the field exists you can not get the .value on a field that does not exist
I thought we answered this here
If you just want to check do something like this
if(doc['readyCreatedTime'].empty) {
emit(0);
return;
}
long datenow = new Date().getTime();
long datewas = doc['readyCreatedTime'].value.getMillis();
long days = (datenow - datewas) / 86400000;
emit (days);
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.