# Debugging elasticsearch

**URL:** <https://discuss.elastic.co/t/debugging-elasticsearch/17355>\
**Category:** Elasticsearch\
**Created:** [May 5, 2014, 8:48pm UTC](https://discuss.elastic.co/t/debugging-elasticsearch/17355 "2014-05-05T20:48:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![HungryHorace](https://avatars.discourse-cdn.com/v4/letter/h/858c86/32.png) [@HungryHorace](https://discuss.elastic.co/u/HungryHorace)\
**Post date:** [May 5, 2014, 8:48pm UTC](https://discuss.elastic.co/t/debugging-elasticsearch/17355/1 "2014-05-05T20:48:52Z")

</div>

I've been following a tuturial here:  
[http://blog.qbox.io/multi-field-partial-word-autocomplete-in-elasticsearch-using-ngrams](http://blog.qbox.io/multi-field-partial-word-autocomplete-in-elasticsearch-using-ngrams)

but when I query for results I only get matches if i use the entire word.  
Partial word searches always give zero results. How do debug this ?

A query for 'aragon' produces matches but 'arango' produces zero  
matches...? I'm using 'sense' to submit my queries

POST /tso/geo/\_search  
{  
"size": 10,  
"query": {  
"match": {  
"\_all": {  
"query": "arago",  
"operator": "and"  
}  
}  
}  
}

result.  
{  
"took": 1,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"hits": {  
"total": 0,  
"max\_score": null,  
"hits": []  
}  
}

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/266c1334-0a39-4ce0-b962-8080fa841f98%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/266c1334-0a39-4ce0-b962-8080fa841f98%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Michael\_Lussier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_lussier/32/1591_2.png) [@Michael\_Lussier](https://discuss.elastic.co/u/Michael_Lussier)\
**Post date:** [May 6, 2014, 2:50pm UTC](https://discuss.elastic.co/t/debugging-elasticsearch/17355/2 "2014-05-06T14:50:28Z")

</div>

Can you provide your index settings and type mapping?

On Monday, May 5, 2014 3:48:52 PM UTC-5, HungryHorace wrote:

> I've been following a tuturial here:
> 
> [http://blog.qbox.io/multi-field-partial-word-autocomplete-in-elasticsearch-using-ngrams](http://blog.qbox.io/multi-field-partial-word-autocomplete-in-elasticsearch-using-ngrams)
> 
> but when I query for results I only get matches if i use the entire word.  
> Partial word searches always give zero results. How do debug this ?
> 
> A query for 'aragon' produces matches but 'arango' produces zero  
> matches...? I'm using 'sense' to submit my queries
> 
> POST /tso/geo/\_search  
> {  
> "size": 10,  
> "query": {  
> "match": {  
> "\_all": {  
> "query": "arago",  
> "operator": "and"  
> }  
> }  
> }  
> }
> 
> result.  
> {  
> "took": 1,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 5,  
> "successful": 5,  
> "failed": 0  
> },  
> "hits": {  
> "total": 0,  
> "max\_score": null,  
> "hits":   
> }  
> }

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5ec140c4-7bbb-4783-95be-49040cc5eb7d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5ec140c4-7bbb-4783-95be-49040cc5eb7d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![HungryHorace](https://avatars.discourse-cdn.com/v4/letter/h/858c86/32.png) [@HungryHorace](https://discuss.elastic.co/u/HungryHorace)\
**Post date:** [May 6, 2014, 3:50pm UTC](https://discuss.elastic.co/t/debugging-elasticsearch/17355/3 "2014-05-06T15:50:03Z")

</div>

Hi Michael.

I'm on windows so I'm using sense rather than curl. here are my requests

PUT /travelshopoffers/\_settings  
{  
"analysis": {  
"filter": {  
"nGram\_filter": {  
"type": "nGram",  
"min\_gram": 2,  
"max\_gram": 20,  
"token\_chars": [  
"letter",  
"digit",  
"punctuation",  
"symbol"  
]  
}  
},  
"analyzer": {  
"nGram\_analyzer": {  
"type": "custom",  
"tokenizer": "whitespace",  
"filter": [  
"lowercase",  
"asciifolding",  
"nGram\_filter"  
]  
},  
"whitespace\_analyzer": {  
"type": "custom",  
"tokenizer": "whitespace",  
"filter": [  
"lowercase",  
"asciifolding"  
]  
}  
}  
}  
}

PUT /travelshopoffers/geo/\_mapping  
{  
"mappings": {  
"geo": {  
"\_all": {  
"index\_analyzer": "nGram\_analyzer",  
"search\_analyzer": "whitespace\_analyzer"  
},  
"properties": {  
"name": {  
"type": "string",  
"include\_in\_all": true  
},  
"lat": {  
"type": "string",  
"index": "no"  
},  
"lng": {  
"type": "string",  
"index": "no"  
},  
"countryCode": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"countryName": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
}  
}  
}  
}  
}

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ff9e6ec7-f77c-4c24-ba06-9b2eef9de9ba%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ff9e6ec7-f77c-4c24-ba06-9b2eef9de9ba%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Michael\_Lussier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_lussier/32/1591_2.png) [@Michael\_Lussier](https://discuss.elastic.co/u/Michael_Lussier)\
**Post date:** [May 6, 2014, 4:18pm UTC](https://discuss.elastic.co/t/debugging-elasticsearch/17355/4 "2014-05-06T16:18:21Z")

</div>

Assuming the response for the settings and mappings for your cluster are  
the same as the requests, and you're expecting "name" to match on "arango".  
The reason "arango" isn't partially matching as you're expecting because  
"arango" doesn't match any documents in \_all.

In the tutorial mentioned, queries are being used to highlight results as  
you search. As the example mentions in the tutorial, a query match for  
"disn 123 2013" will highlight matching results in the search box.  
But using the same tutorial searching for "disnp 123 2013" or "disnp" will  
give no results. This tutorial works really well when you're looking to  
have a search only find exactly what you search for.

If you're looking to allow for spell checking/errors in your auto-complete,  
I suggest looking into the suggest[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters.html)api. I hope that makes sense, let me know if I can offer my explanation.

On Tuesday, May 6, 2014 10:50:03 AM UTC-5, HungryHorace wrote:

> Hi Michael.
> 
> I'm on windows so I'm using sense rather than curl. here are my requests
> 
> PUT /travelshopoffers/\_settings  
> {  
> "analysis": {  
> "filter": {  
> "nGram\_filter": {  
> "type": "nGram",  
> "min\_gram": 2,  
> "max\_gram": 20,  
> "token\_chars": [  
> "letter",  
> "digit",  
> "punctuation",  
> "symbol"  
> ]  
> }  
> },  
> "analyzer": {  
> "nGram\_analyzer": {  
> "type": "custom",  
> "tokenizer": "whitespace",  
> "filter": [  
> "lowercase",  
> "asciifolding",  
> "nGram\_filter"  
> ]  
> },  
> "whitespace\_analyzer": {  
> "type": "custom",  
> "tokenizer": "whitespace",  
> "filter": [  
> "lowercase",  
> "asciifolding"  
> ]  
> }  
> }  
> }  
> }
> 
> PUT /travelshopoffers/geo/\_mapping  
> {  
> "mappings": {  
> "geo": {  
> "\_all": {  
> "index\_analyzer": "nGram\_analyzer",  
> "search\_analyzer": "whitespace\_analyzer"  
> },  
> "properties": {  
> "name": {  
> "type": "string",  
> "include\_in\_all": true  
> },  
> "lat": {  
> "type": "string",  
> "index": "no"  
> },  
> "lng": {  
> "type": "string",  
> "index": "no"  
> },  
> "countryCode": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "include\_in\_all": false  
> },  
> "countryName": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "include\_in\_all": false  
> }  
> }  
> }  
> }  
> }

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f9335fdf-b46c-4467-8c59-7e93c639ddde%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f9335fdf-b46c-4467-8c59-7e93c639ddde%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![HungryHorace](https://avatars.discourse-cdn.com/v4/letter/h/858c86/32.png) [@HungryHorace](https://discuss.elastic.co/u/HungryHorace)\
**Post date:** [May 6, 2014, 7:56pm UTC](https://discuss.elastic.co/t/debugging-elasticsearch/17355/5 "2014-05-06T19:56:06Z")

</div>

mmm the tutorial says it does partial word autocomplete which is what i was  
looking for and you say it won't do. i'm a little confused here.

i'll check out the suggest api - i hadn't seen that before.

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e5e01242-c0bf-43a9-b177-ccd2e1ce5825%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e5e01242-c0bf-43a9-b177-ccd2e1ce5825%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:31am UTC](https://discuss.elastic.co/t/debugging-elasticsearch/17355/6 "2017-07-06T01:31:16Z")

</div>


