Automatic string splitting in aggregation

AggregationBuilder group = AggregationBuilders.terms("agg1")
                .field("requestId").subAggregation(AggregationBuilders
                        .max("agg2").field("startTime"));

The value of field requestId is split and the result is wrong. And I put mapping like:

client.admin().indices().preparePutMapping(indexName)
                .setType(type)
                .setSource("{\n" +
                        "    \"" + type + "\":{\n" +
                        "        \"properties\": {\n" +
                        "            \"requestId\": {\n" +
                        "                \"type\": \"text\",\n" +
                        "                \"fielddata\": true,\n" +
                        "                \"index\": \"not_analyzed\"\n" +
                        "            }\n" +
                        "        }\n" +
                        "    }\n" +
                        "}")
                .get();

I can't get the right result.

Try "type": "keyword" instead.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.