How do I get a terms count of text filed?

For example, "desc" is a text field (fielddata = true)

doc1 PUT {"desc", "aaa aaa aaa"}
doc2 PUT {"desc", "aaa xxx"}

When I do a terms aggreation on it, and I will get a "doc count",
but I want to get the term count,
"aaa" 4
"xxx" 1

Thanks for any reply!(DSL or Java High level are all okay)

Hi,
What you want to get is term vectors rather than term aggregation.

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