# Understanding an "explain"

**URL:** <https://discuss.elastic.co/t/understanding-an-explain/5592>\
**Category:** Elasticsearch\
**Created:** [October 13, 2011, 5:01pm UTC](https://discuss.elastic.co/t/understanding-an-explain/5592 "2011-10-13T17:01:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Hoffman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_hoffman/32/1872_2.png) [@Nick\_Hoffman](https://discuss.elastic.co/u/Nick_Hoffman)\
**Post date:** [October 13, 2011, 5:01pm UTC](https://discuss.elastic.co/t/understanding-an-explain/5592/1 "2011-10-13T17:01:18Z")

</div>

Hey guys. Is there anything that I can read to help me understand the output  
from an "explain"?

One of my searches is returning a document that I don't think should be  
returned, and I only understand part of the explanation:

> <https://gist.github.com/nickhoffman/1284790>

Line 47 says that the field "items.name" matches the search. But what does "ock  
in 198" mean?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 14, 2011, 12:21pm UTC](https://discuss.elastic.co/t/understanding-an-explain/5592/2 "2011-10-14T12:21:51Z")

</div>

It means that the (part of the) query, which is items.name:ock matched a doc  
number 198 (internal Lucene numbering of docs). What confuses you? the part  
that its ock? Are you doing any special analysis on that field (items.name)?

On Thu, Oct 13, 2011 at 7:01 PM, Nick Hoffman [nick@deadorange.com](mailto:nick@deadorange.com) wrote:

> Hey guys. Is there anything that I can read to help me understand the  
> output from an "explain"?
> 
> One of my searches is returning a document that I don't think should be  
> returned, and I only understand part of the explanation:  
> [gist:1284790 · GitHub](https://gist.github.com/1284790)
> 
> Line 47 says that the field "items.name" matches the search. But what does  
> "ock in 198" mean?

---

<div class="post-metadata">

**Author:** ![Nick\_Hoffman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_hoffman/32/1872_2.png) [@Nick\_Hoffman](https://discuss.elastic.co/u/Nick_Hoffman)\
**Post date:** [October 14, 2011, 1:23pm UTC](https://discuss.elastic.co/t/understanding-an-explain/5592/3 "2011-10-14T13:23:12Z")

</div>

Ah, gotcha re: "in 198" and "(stuff in parens)".

I understand the "ock": it's an nGram that matched.

A custom nGram analyzer named "3\_8\_ngram" is being used for index and search  
analysis:

> <https://gist.github.com/nickhoffman/6e935e022c759fbc8d61>

The rationale for "3\_8\_ngram" is that my users will search for misspellings  
or partial words, and I need to match those. Is there a better approach for  
solving that problem, though?

Thanks again!  
Nick

---

<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 6, 2017, 3:51am UTC](https://discuss.elastic.co/t/understanding-an-explain/5592/4 "2017-07-06T03:51:55Z")

</div>


