# Custom stemmer with elasticsearch / tire / rails

**URL:** <https://discuss.elastic.co/t/custom-stemmer-with-elasticsearch-tire-rails/17424>\
**Category:** Elasticsearch\
**Created:** [May 9, 2014, 2:42am UTC](https://discuss.elastic.co/t/custom-stemmer-with-elasticsearch-tire-rails/17424 "2014-05-09T02:42:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oto\_iashvili](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@oto\_iashvili](https://discuss.elastic.co/u/oto_iashvili)\
**Post date:** [May 9, 2014, 2:42am UTC](https://discuss.elastic.co/t/custom-stemmer-with-elasticsearch-tire-rails/17424/1 "2014-05-09T02:42:54Z")

</div>

Hi,

Im' searchinkg to ass new stemmer to elastisearch to use with tire / rails

I've found java file  
([https://github.com/emilis/PolicyFeed/blob/master/src/search/java/org/tartarus/snowball/ext/LithuanianStemmer.java](https://github.com/emilis/PolicyFeed/blob/master/src/search/java/org/tartarus/snowball/ext/LithuanianStemmer.java))  
I've created a jar from this file  
I've put it in elasticsearch's lib folder

here my rails file

tire.settings :analysis =\> {  
:filter =\> {  
"lt\_stemmer" =\> {  
"type" =\> "stemmer",  
"name" =\> "lithuanian",  
"rules\_path" =\> "lt\_stemmer.jar"  
}  
},  
:analyzer =\> {  
"lithuanian" =\> {  
"type" =\> "snowball",  
"tokenizer" =\> "keyword",  
"filter" =\> ["lowercase", "lt\_stemmer"]  
},  
},  
} do  
mapping do  
indexes :titre\_lt, :analyzer =\> "lithuanian"

end

I succeed them to create index and index data, but when I test, it seems it  
doesn't use the rule in my jar file.

curl -XGET 'localhost:9200/lituanieindex/\_analyze?analyzer=lithuanian' -d  
'smulkių, dalinių, pilnų krovinių pervežimas nuosavais arba partnerių  
vilkikais su standartinėmis 92 m3 puspriekabėmis ir 120 m3 autotraukiniais;'

{"tokens":[{"token":"smulkių","start\_offset":0,"end\_offset":7,"type":"","position":1},{"token":"dalinių","start\_offset":9,"end\_offset":16,"type":"","position":2},{"token":"pilnų","start\_offset":18,"end\_offset":23,"type":"","position":3},{"token":"krovinių","start\_offset":24,"end\_offset":32,"type":"","position":4},{"token":"pervežima","start\_offset":33,"end\_offset":43,"type":"","position":5},{"token":"nuosavai","start\_offset":44,"end\_offset":53,"type":"","position":6},{"token":"arba","start\_offset":54,"end\_offset":58,"type":"","position":7},{"token":"partnerių","start\_offset":59,"end\_offset":68,"type":"","position":8},{"token":"vilkikai","start\_offset":69,"end\_offset":78,"type":"","position":9},{"token":"su","start\_offset":79,"end\_offset":81,"type":"","position":10},{"token":"standartinėmi","start\_offset":82,"end\_offset":96,"type":"","position":11},{"token":"92","start\_offset":97,"end\_offset":99,"type":"","position":12},{"token":"m3","start\_offset":100,"end\_offset":102,"type":"","position":13},{"token":"puspriekabėmi","start\_offset":103,"end\_offset":117,"type":"","position":14},{"token":"ir","start\_offset":118,"end\_offset":120,"type":"","position":15},{"token":"120","start\_offset":121,"end\_offset":124,"type":"","position":16},{"token":"m3","start\_offset":125,"end\_offset":127,"type":"","position":17},{"token":"autotraukiniai","start\_offset":128,"end\_offset":143,"type":"","position":18}]}

what do I do wrong ?

thanks for help

--  
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/c4bd01c5-832a-42b4-8218-8263ca284f25%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4bd01c5-832a-42b4-8218-8263ca284f25%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:30am UTC](https://discuss.elastic.co/t/custom-stemmer-with-elasticsearch-tire-rails/17424/2 "2017-07-06T01:30:36Z")

</div>


