And this functionned perfectly but I have lines In my index without this fields.
And I have an error like that:
And it says it's because some lines don't have this 2 fields for created this time of resolution.
And I can't see some lines in discover by this error.
For that I deleted my scripted field and like that I can see this other lines.
Now I want to recreated this field but I can't see everything lines and I have this explanation:
So I wanted for solved my first problem created an expression like that
But this haven't functionned by le .exists do you have a means for created a field who say if the fields exists then do my first expression and if it not exists then return 0 ?
And can the resolution of the first problem solve the second?
Hey @marie,
You get this expression because it´s a scripted field, scripted fields are not in the source-data and this says you that you can visualize and search on it, but you will not find this in your ES ( because its in Kibana).
You can write the following script to check if value is null
Script
if(doc['myvalue.keyword']).value == null){
return 0;
}else{
...Write your expression/painless script here here...
}
I had this problem, too. The problem was that some of the fields that I used to calculate the scripted field had text which caused the script to fail. I soved it by calculating the value and adding it as a new field to the database, not as scripted field.
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.