# Shingles in Elasticsearch, why does this example with custom analyzer fail?

**URL:** <https://discuss.elastic.co/t/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail/17223>\
**Category:** Elasticsearch\
**Created:** [April 28, 2014, 5:49am UTC](https://discuss.elastic.co/t/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail/17223 "2014-04-28T05:49:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JEB](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeb/32/1615_2.png) [@JEB](https://discuss.elastic.co/u/JEB)\
**Post date:** [April 28, 2014, 5:49am UTC](https://discuss.elastic.co/t/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail/17223/1 "2014-04-28T05:49:41Z")

</div>

Hi Guys,

I've been struggling with this for a couple of days.  
I defined a custom search and index analyzer on a field and can't get it to  
work.

There is a full curl recreation available at stackoverflow:

> <https://stackoverflow.com/questions/23295896/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail>

Can anyone help me with this?

Thanks!!  
Jeb

--  
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/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 28, 2014, 6:11am UTC](https://discuss.elastic.co/t/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail/17223/2 "2014-04-28T06:11:15Z")

</div>

Term query is not analyzed so your query is directly compared to what you have indexed.

Which is the output of:

curl 'localhost:9200/test\_shingling/\_analyze?pretty=1&analyzer=ShingleAnalyzer

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 28 avr. 2014 à 07:49, JEB [jbonerz@googlemail.com](mailto:jbonerz@googlemail.com) a écrit :

Hi Guys,

I've been struggling with this for a couple of days.  
I defined a custom search and index analyzer on a field and can't get it to work.

There is a full curl recreation available at stackoverflow:

> <https://stackoverflow.com/questions/23295896/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail>

Can anyone help me with this?

Thanks!!  
Jeb

--  
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/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/87D5D19D-2CCC-4DEB-AD33-6CEDB0DE7DD5%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/87D5D19D-2CCC-4DEB-AD33-6CEDB0DE7DD5%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![JEB](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeb/32/1615_2.png) [@JEB](https://discuss.elastic.co/u/JEB)\
**Post date:** [April 28, 2014, 6:27am UTC](https://discuss.elastic.co/t/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail/17223/3 "2014-04-28T06:27:42Z")

</div>

I also tried this previously without success.

{ "query": { "query\_string": { "default\_operator": "and" ,"default\_field":  
"Title", "query": "solar panel" } } }

{ "query": { "query\_string": { "default\_field": "Title", "query": "solar  
panel" } } }

Can you guide me into the right direction?

Am Montag, 28. April 2014 08:11:15 UTC+2 schrieb David Pilato:

> Term query is not analyzed so your query is directly compared to what you  
> have indexed.
> 
> Which is the output of:
> 
> curl 'localhost:9200/test\_shingling/\_analyze?pretty=1&analyzer=ShingleAnalyzer
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 28 avr. 2014 à 07:49, JEB \<[jbo...@googlemail.com](mailto:jbo...@googlemail.com) \<javascript:\>\> a  
> écrit :
> 
> Hi Guys,
> 
> I've been struggling with this for a couple of days.  
> I defined a custom search and index analyzer on a field and can't get it  
> to work.
> 
> There is a full curl recreation available at stackoverflow:
> 
> [Shingles in Elasticsearch, why does this example with custom analyzer fail? - Stack Overflow](http://stackoverflow.com/questions/23295896/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail)
> 
> Can anyone help me with this?
> 
> Thanks!!  
> Jeb
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/2125f5fb-32cf-4104-b070-9320dc51db7a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2125f5fb-32cf-4104-b070-9320dc51db7a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 28, 2014, 7:06am UTC](https://discuss.elastic.co/t/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail/17223/4 "2014-04-28T07:06:51Z")

</div>

Did you try a Match query (instead of Term)?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 28 avr. 2014 à 08:27, JEB [jbonerz@googlemail.com](mailto:jbonerz@googlemail.com) a écrit :

I also tried this previously without success.

{ "query": { "query\_string": { "default\_operator": "and" ,"default\_field": "Title", "query": "solar panel" } } }

{ "query": { "query\_string": { "default\_field": "Title", "query": "solar panel" } } }

Can you guide me into the right direction?

Am Montag, 28. April 2014 08:11:15 UTC+2 schrieb David Pilato:

> Term query is not analyzed so your query is directly compared to what you have indexed.
> 
> Which is the output of:
> 
> curl 'localhost:9200/test\_shingling/\_analyze?pretty=1&analyzer=ShingleAnalyzer
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 28 avr. 2014 à 07:49, JEB [jbo...@googlemail.com](mailto:jbo...@googlemail.com) a écrit :
> 
> Hi Guys,
> 
> I've been struggling with this for a couple of days.  
> I defined a custom search and index analyzer on a field and can't get it to work.
> 
> There is a full curl recreation available at stackoverflow:  
> [Shingles in Elasticsearch, why does this example with custom analyzer fail? - Stack Overflow](http://stackoverflow.com/questions/23295896/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail)
> 
> Can anyone help me with this?
> 
> Thanks!!  
> Jeb
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e49c62d0-5851-48d2-8cb4-d32b17853750%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/2125f5fb-32cf-4104-b070-9320dc51db7a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2125f5fb-32cf-4104-b070-9320dc51db7a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/1A5C4279-34C5-4B30-B439-8DBF690A2630%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/1A5C4279-34C5-4B30-B439-8DBF690A2630%40pilato.fr).  
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:33am UTC](https://discuss.elastic.co/t/shingles-in-elasticsearch-why-does-this-example-with-custom-analyzer-fail/17223/5 "2017-07-06T01:33:12Z")

</div>


