# Russian search does not work for me

**URL:** <https://discuss.elastic.co/t/russian-search-does-not-work-for-me/21347>\
**Category:** Elasticsearch\
**Created:** [December 21, 2014, 10:08pm UTC](https://discuss.elastic.co/t/russian-search-does-not-work-for-me/21347 "2014-12-21T22:08:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilya\_Kantor](https://avatars.discourse-cdn.com/v4/letter/i/f14d63/32.png) [@Ilya\_Kantor](https://discuss.elastic.co/u/Ilya_Kantor)\
**Post date:** [December 21, 2014, 10:08pm UTC](https://discuss.elastic.co/t/russian-search-does-not-work-for-me/21347/1 "2014-12-21T22:08:26Z")

</div>

Please let me know what I'm doing wrong or where to look/debug.

1. I git cloned [https://github.com/asyncee/elasticsearch-russian-config/](https://github.com/asyncee/elasticsearch-russian-config/)
2. Downloaded elasticsearch-1.4.2 and copied bin and lib into the same dir.
3. Installed [https://github.com/imotov/elasticsearch-analysis-morphology](https://github.com/imotov/elasticsearch-analysis-morphology) 1.2

Run it.

Now looks like I have russian analyzer, at least this test gives correct  
tokens:

curl -XGET "[http://localhost:9200/\_analyze?analyzer=russian&text=Веселые%20истории%20про%20котят](http://localhost:9200/_analyze?analyzer=russian&text=%D0%92%D0%B5%D1%81%D0%B5%D0%BB%D1%8B%D0%B5%20%D0%B8%D1%81%D1%82%D0%BE%D1%80%D0%B8%D0%B8%20%D0%BF%D1%80%D0%BE%20%D0%BA%D0%BE%D1%82%D1%8F%D1%82)"

...But then I create an index:

curl -XPOST "[http://localhost:9200/blog2](http://localhost:9200/blog2)" -d'  
{  
"settings": {  
"analysis": {  
"filter": {  
"ru\_stop": {  
"type": "stop",  
"stopwords": "_russian_"  
},  
"ru\_stemmer": {  
"type": "stemmer",  
"language": "russian"  
}  
},  
"analyzer": {  
"default": {  
"char\_filter": [  
"html\_strip"  
],  
"tokenizer": "standard",  
"filter": [  
"lowercase",  
"ru\_stop",  
"ru\_stemmer"  
]  
}  
}  
}  
},  
"mappings": {  
"post": {  
"properties": {  
"content": {  
"type": "string"  
},  
"published\_at": {  
"type": "date",  
"format": "dateOptionalTime"  
},  
"tags": {  
"type": "string",  
"index": "not\_analyzed"  
},  
"title": {  
"type": "string"  
}  
}  
}  
}  
}'

And insert the record:  
curl -XPUT "[http://localhost:9200/blog2/post/2](http://localhost:9200/blog2/post/2)" -d'  
{  
"title": "Веселые щенки",  
"content": "

Смешная история про щенков

",  
"tags": [  
"щенки",  
"смешная история"  
],  
"published\_at": "2014-08-12T20:44:42+00:00"  
}'

Now I can find it with  
-\> POST [http://localhost:9200/blog2/post/\_search](http://localhost:9200/blog2/post/_search)  
{  
"query": {  
"match": {  
"title": "щенки"  
}  
}  
}

But not if I provide a single "щенок" instead of the plural "щенки".

So, basically, the morphology doesn't work.

P.S. I'm kind of new to elasticsearch.

--  
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/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [December 21, 2014, 10:20pm UTC](https://discuss.elastic.co/t/russian-search-does-not-work-for-me/21347/2 "2014-12-21T22:20:40Z")

</div>

I think you need "type": "custom" inside "analyzer": {"default":{}}.  
On Dec 21, 2014 5:08 PM, "Ilya Kantor" [iliakan@gmail.com](mailto:iliakan@gmail.com) wrote:

> Please let me know what I'm doing wrong or where to look/debug.
> 
> 1. I git cloned [GitHub - asyncee/elasticsearch-russian-config: Basic elasticsearch config with russian language support](https://github.com/asyncee/elasticsearch-russian-config/)
> 2. Downloaded elasticsearch-1.4.2 and copied bin and lib into the same dir.
> 3. Installed [GitHub - imotov/elasticsearch-analysis-morphology: Morphological Analysis Plugin for ElasticSearch (No longer maintained)](https://github.com/imotov/elasticsearch-analysis-morphology)  
> 1.2
> 
> Run it.
> 
> Now looks like I have russian analyzer, at least this test gives correct  
> tokens:
> 
> curl -XGET "[http://localhost:9200/\_analyze?analyzer=russian&text=Веселые%20истории%20про%20котят](http://localhost:9200/_analyze?analyzer=russian&text=%D0%92%D0%B5%D1%81%D0%B5%D0%BB%D1%8B%D0%B5%20%D0%B8%D1%81%D1%82%D0%BE%D1%80%D0%B8%D0%B8%20%D0%BF%D1%80%D0%BE%20%D0%BA%D0%BE%D1%82%D1%8F%D1%82)"
> 
> ...But then I create an index:
> 
> curl -XPOST "[http://localhost:9200/blog2](http://localhost:9200/blog2)" -d'  
> {  
> "settings": {  
> "analysis": {  
> "filter": {  
> "ru\_stop": {  
> "type": "stop",  
> "stopwords": "_russian_"  
> },  
> "ru\_stemmer": {  
> "type": "stemmer",  
> "language": "russian"  
> }  
> },  
> "analyzer": {  
> "default": {  
> "char\_filter": [  
> "html\_strip"  
> ],  
> "tokenizer": "standard",  
> "filter": [  
> "lowercase",  
> "ru\_stop",  
> "ru\_stemmer"  
> ]  
> }  
> }  
> }  
> },  
> "mappings": {  
> "post": {  
> "properties": {  
> "content": {  
> "type": "string"  
> },  
> "published\_at": {  
> "type": "date",  
> "format": "dateOptionalTime"  
> },  
> "tags": {  
> "type": "string",  
> "index": "not\_analyzed"  
> },  
> "title": {  
> "type": "string"  
> }  
> }  
> }  
> }  
> }'
> 
> And insert the record:  
> curl -XPUT "[http://localhost:9200/blog2/post/2](http://localhost:9200/blog2/post/2)" -d'  
> {  
> "title": "Веселые щенки",  
> "content": "
> 
> Смешная история про щенков
> 
> ",  
> "tags": [  
> "щенки",  
> "смешная история"  
> ],  
> "published\_at": "2014-08-12T20:44:42+00:00"  
> }'
> 
> Now I can find it with  
> -\> POST [http://localhost:9200/blog2/post/\_search](http://localhost:9200/blog2/post/_search)  
> {  
> "query": {  
> "match": {  
> "title": "щенки"  
> }  
> }  
> }
> 
> But not if I provide a single "щенок" instead of the plural "щенки".
> 
> So, basically, the morphology doesn't work.
> 
> P.S. I'm kind of new to elasticsearch.
> 
> --  
> 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/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%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/CAPmjWd2AUT77-eAE9ijcADB9SA8%2BocMnQrvkObP86we\_NWy6\_Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2AUT77-eAE9ijcADB9SA8%2BocMnQrvkObP86we_NWy6_Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ilya\_Kantor](https://avatars.discourse-cdn.com/v4/letter/i/f14d63/32.png) [@Ilya\_Kantor](https://discuss.elastic.co/u/Ilya_Kantor)\
**Post date:** [December 22, 2014, 9:23am UTC](https://discuss.elastic.co/t/russian-search-does-not-work-for-me/21347/3 "2014-12-22T09:23:29Z")

</div>

Hi Nikolas,

That didn't help.

For brewity, here's the log of what I'm doing:

curl -XDELETE "[http://localhost:9200/blog](http://localhost:9200/blog)"

curl -XPOST "[http://localhost:9200/blog](http://localhost:9200/blog)" -d'  
{  
"settings": {  
"analysis": {  
"filter": {  
"ru\_stop": {  
"type": "stop",  
"stopwords": "_russian_"  
},  
"ru\_stemmer": {  
"type": "stemmer",  
"language": "russian"  
}  
},  
"analyzer": {  
"default": {  
"type": "custom",  
"char\_filter": [  
"html\_strip"  
],  
"tokenizer": "standard",  
"filter": [  
"lowercase",  
"ru\_stop",  
"ru\_stemmer"  
]  
}  
}  
}  
},  
"mappings": {  
"post": {  
"properties": {  
"content": {  
"type": "string"  
},  
"published\_at": {  
"type": "date",  
"format": "dateOptionalTime"  
},  
"title": {  
"type": "string"  
}  
}  
}  
}  
}'

curl -XPUT "[http://localhost:9200/blog/post/1](http://localhost:9200/blog/post/1)" -d'  
{  
"title": "Веселые щенки",  
"content": "

Смешная история про щенков

",  
"published\_at": "2014-08-12T20:44:42+00:00"  
}'

curl -XPOST "[http://localhost:9200/blog/post/\_search](http://localhost:9200/blog/post/_search)" -d'  
{  
"query": {  
"match": {  
"title": "щенок"  
}  
}  
}'

Returns nothing (morphology doesn't work).

Config: [https://github.com/asyncee/elasticsearch-russian-config/blob/master/config/elasticsearch.yml](https://github.com/asyncee/elasticsearch-russian-config/blob/master/config/elasticsearch.yml)  
Elasticsearch: 1.4.2.

P.S. The index is created according to a tutorial, kind of unsure if the  
settings are correct.

понедельник, 22 декабря 2014 г., 1:21:02 UTC+3 пользователь Nikolas Everett  
написал:

> I think you need "type": "custom" inside "analyzer": {"default":{}}.  
> On Dec 21, 2014 5:08 PM, "Ilya Kantor" \<[ili...@gmail.com](mailto:ili...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Please let me know what I'm doing wrong or where to look/debug.
> > 
> > 1. I git cloned [GitHub - asyncee/elasticsearch-russian-config: Basic elasticsearch config with russian language support](https://github.com/asyncee/elasticsearch-russian-config/)
> > 2. Downloaded elasticsearch-1.4.2 and copied bin and lib into the same  
> > dir.
> > 3. Installed [GitHub - imotov/elasticsearch-analysis-morphology: Morphological Analysis Plugin for ElasticSearch (No longer maintained)](https://github.com/imotov/elasticsearch-analysis-morphology)  
> > 1.2
> > 
> > Run it.
> > 
> > Now looks like I have russian analyzer, at least this test gives correct  
> > tokens:
> > 
> > curl -XGET "[http://localhost:9200/\_analyze?analyzer=russian&text=Веселые%20истории%20про%20котят](http://localhost:9200/_analyze?analyzer=russian&text=%D0%92%D0%B5%D1%81%D0%B5%D0%BB%D1%8B%D0%B5%20%D0%B8%D1%81%D1%82%D0%BE%D1%80%D0%B8%D0%B8%20%D0%BF%D1%80%D0%BE%20%D0%BA%D0%BE%D1%82%D1%8F%D1%82)"
> > 
> > ...But then I create an index:
> > 
> > curl -XPOST "[http://localhost:9200/blog2](http://localhost:9200/blog2)" -d'  
> > {  
> > "settings": {  
> > "analysis": {  
> > "filter": {  
> > "ru\_stop": {  
> > "type": "stop",  
> > "stopwords": "_russian_"  
> > },  
> > "ru\_stemmer": {  
> > "type": "stemmer",  
> > "language": "russian"  
> > }  
> > },  
> > "analyzer": {  
> > "default": {  
> > "char\_filter": [  
> > "html\_strip"  
> > ],  
> > "tokenizer": "standard",  
> > "filter": [  
> > "lowercase",  
> > "ru\_stop",  
> > "ru\_stemmer"  
> > ]  
> > }  
> > }  
> > }  
> > },  
> > "mappings": {  
> > "post": {  
> > "properties": {  
> > "content": {  
> > "type": "string"  
> > },  
> > "published\_at": {  
> > "type": "date",  
> > "format": "dateOptionalTime"  
> > },  
> > "tags": {  
> > "type": "string",  
> > "index": "not\_analyzed"  
> > },  
> > "title": {  
> > "type": "string"  
> > }  
> > }  
> > }  
> > }  
> > }'
> > 
> > And insert the record:  
> > curl -XPUT "[http://localhost:9200/blog2/post/2](http://localhost:9200/blog2/post/2)" -d'  
> > {  
> > "title": "Веселые щенки",  
> > "content": "
> > 
> > Смешная история про щенков
> > 
> > ",  
> > "tags": [  
> > "щенки",  
> > "смешная история"  
> > ],  
> > "published\_at": "2014-08-12T20:44:42+00:00"  
> > }'
> > 
> > Now I can find it with  
> > -\> POST [http://localhost:9200/blog2/post/\_search](http://localhost:9200/blog2/post/_search)  
> > {  
> > "query": {  
> > "match": {  
> > "title": "щенки"  
> > }  
> > }  
> > }
> > 
> > But not if I provide a single "щенок" instead of the plural "щенки".
> > 
> > So, basically, the morphology doesn't work.
> > 
> > P.S. I'm kind of new to elasticsearch.
> > 
> > --  
> > 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/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8368b6a9-5b21-4f5a-bf8e-c3ad6336f937%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/2d4f8314-165c-4af2-acfd-b7a4ad550a8a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2d4f8314-165c-4af2-acfd-b7a4ad550a8a%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, 12:42am UTC](https://discuss.elastic.co/t/russian-search-does-not-work-for-me/21347/4 "2017-07-06T00:42:24Z")

</div>


