In 6.2.4 I have a machine learning job with a summary count that is set to a keyword field. It runs just fine. In the anomaly explorer I select an anomaly and click on Open Link / View series. That opens a new window that hangs forever with a Loading spinner.
In the elasticsearch log I see it failing to do the aggs with a sum on the keyword field. Not very friendly.
[2018-05-15T15:43:59,193][DEBUG][o.e.a.s.TransportSearchAction] [...] [nypd-complaints][0], node[Sup8CgURSpCU7gKD-NwAWA], [P], s[STARTED], a[id=CjolmCJBSn-WLYhYzbJR3A]: Failed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, indices=[nypd-complaints], indicesOptions=IndicesOptions[id=38, ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=true, ignore_aliases=false], types=[], routing='null', preference='null', requestCache=null, scroll=null, maxConcurrentShardRequests=5, batchedReduceSize=512, preFilterShardSize=128, source={"size":0,"query":{"bool":{"must":[{"range":{"@timestamp":{"from":1135296000000,"to":1485215999999,"include_lower":true,"include_upper":true,"format":"epoch_millis","boost":1.0}}},{"match_all":{"boost":1.0}},{"query_string":{"query":"Borough.keyword:\"STATEN ISLAND\"","fields":[],"type":"best_fields","default_operator":"or","max_determinized_states":10000,"enable_position_increments":true,"fuzziness":"AUTO","fuzzy_prefix_length":0,"fuzzy_max_expansions":50,"phrase_slop":0,"analyze_wildcard":false,"escape":false,"auto_generate_synonyms_phrase_query":true,"fuzzy_transpositions":true,"boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},"_source":{"includes":[],"excludes":[]},"aggregations":{"byTime":{"date_histogram":{"field":"@timestamp","interval":"1M","offset":0,"order":{"_key":"asc"},"keyed":false,"min_doc_count":0},"aggregations":{"metric":{"sum":{"field":"OffenseCode.keyword"}}}}}}}]
org.elasticsearch.transport.RemoteTransportException: [...][127.0.0.1:9300][indices:data/read/search[phase/query]]
Caused by: java.lang.IllegalArgumentException: Expected numeric type on field [OffenseCode.keyword], but got [keyword]
at org.elasticsearch.search.aggregations.support.ValuesSourceConfig.numericField(ValuesSourceConfig.java:307) ~[elasticsearch-6.2.4.jar:6.2.4]
and
[2018-05-15T15:43:59,201][DEBUG][o.e.a.s.TransportSearchAction] [...] All shards failed for phase: [query]
org.elasticsearch.ElasticsearchException$1: Expected numeric type on field [OffenseCode.keyword], but got [keyword]
at org.elasticsearch.ElasticsearchException.guessRootCauses(ElasticsearchException.java:619) ~[elasticsearch-6.2.4.jar:6.2.4]