I have a scripted field setup with the following code:
List list = new ArrayList();
Map m = new HashMap();
m.put("usColpo", "colpo");
m.put("vp", "visualPap");
for (int i = 0; i < doc['user.clinicalScenarios.keyword'].length; ++i) {
def value = doc['user.clinicalScenarios.keyword'][i];
if(m.get(value)!=null){
list.add(m.get(value));
} else {
list.add(value);
}
}
return list;
The original field clinicalScenario is a comma delimited string. It can have one or more values: usColpo, vp or usColpo, vp.
When I go to the discover tab I can see all the values populated correctly but when I add the filter examType:colpo no results are returned. Is it because I return a list to populate the field? I would ultimately like to add a filter control for this field so that I can filter on it in a dashboard.
Thanks You