# Ngram analyzer and term frequency

**URL:** <https://discuss.elastic.co/t/ngram-analyzer-and-term-frequency/39004>\
**Category:** Elasticsearch\
**Created:** [January 12, 2016, 4:22pm UTC](https://discuss.elastic.co/t/ngram-analyzer-and-term-frequency/39004 "2016-01-12T16:22:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torben](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@Torben](https://discuss.elastic.co/u/Torben)\
**Post date:** [January 12, 2016, 4:22pm UTC](https://discuss.elastic.co/t/ngram-analyzer-and-term-frequency/39004/1 "2016-01-12T16:22:50Z")

</div>

Hello,

I'm using a ngram tokenizer for full text search and got some questions about term frequency.

Full example: [http://paste.ubuntu.com/14478646/](http://paste.ubuntu.com/14478646/)

If I use the explain API on my search query (last 2 curl commands) for document 1 (`"abcd - foooooooabcd"`) I got a term frequency of 2.0 for the string `"abc"`, which is okay. But when I search for `"abcd"` I got a term frequency of 17.0. What? Shouldn't this also be 2.0?

The index analyzer works fine, so why this weird term frequency?  
`curl -XGET 'localhost:9200/test20160107/_analyze?analyzer=index_ngram_wd_analyzer&pretty' -d "abcd"`

Thanks in advance for any help!

Best regards,  
Torben

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:25pm UTC](https://discuss.elastic.co/t/ngram-analyzer-and-term-frequency/39004/2 "2017-07-05T23:25:08Z")

</div>


