How to get total term frequency within a document

i am writing java code for getting total term frequency(number of times a
term occured within a document).
please help me to write this.

here is the document that i inserted into elastic search index.
but when i count how many no of times error_code is equal to 45, it
returns 1.
but i want it to return 4 as it is 4 times in my document.

please help me. it's kind of urgent.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit