I am a novice in ES... I want to work with watcher of ES.
Let's assume a scenario: Let's say I am a doctor. I have data about my patients in ES. Whenever the diagnostic team claims that the patient's health status is deteriorating I should be notified. As I am using Elasticsearch, I want to implement it using watcher in Java. I followed this link but was not able to get a condition using Java. Also, the mustache template is confusing. Is it a good idea to write every logic in a script and access the same script in java class.
Can you please help me with it? If you have any better ideas please suggest which supports the above scenario.
Upon quering ES: http://localhost:9200/clinic/_search?pretty=1 , the response is as below:
> { > "took": 1, > "timed_out": false, > "_shards": { > "total": 5, > "successful": 5, > "failed": 0 > }, > "hits": { > "total": 1, > "max_score": 1, > "hits": [{ > "_index": "clinic", > "_type": "patients", > "_id": "AWEocy4uDyy-SYauj60G", > "_score": 1, > "_source": { > "Pdata": [{ > "Status": "unhealthy", > "Name": "JohnDoe 1", > "disease": "Typhoid", > "Metrics": { > "BodyMetrics": [{ > "symptoms": "fever", > "Type": "c" > }] > }, > "Address": "abcd street", > "Date": 2412017, > "severity": "major" > }, > { > "Status": "unhealthy", > "Name": "JohnDoe 2", > "disease": "Fatigue", > "Metrics": { > "BodyMetrics": [{ > "symptoms": "weakness", > "Type": "a" > }] > }, > "Address": "efgh street", > "Date": 22122017, > "severity": "minor" > }, > { > "Status": "healthy", > "Name": "JohnDoe 3", > "disease": "HyperTension", > "Metrics": { > "BodyMetrics": [{ > "symptoms": "tiredness", > "Type": "d" > }] > }, > "Address": "xyz street", > "Date": 2412017, > "severity": "none" > }] > } > }] > } > }