A scripted field is always calculated as the data is queried, so it would always show the current date for any doc which had Complete: Yes. I'm guessing you want it to indicate the date it was completed?
We should take a step back and ask how your data is getting into Elasticsearch. The two main ways are
time-based data where each doc has a timestamp and you can trend things over time and aggregate data based on time intervals (connections per hour, etc). These docs are usually not updated once they are ingested into Elasticsearch.
the other common way is things that are not time-based. Like inventory items which could have a quantity that gets updated. Or some other docs which start out with Complete: No and get updated to Complete: Yes.
If you are updating docs to indicate when they are completed, that same task could update the Complete_Date: with the current date.
How you do that depends on how that data is getting written into Elasticsearch. If you can explain more of that I can provide more detailed steps.
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.