jprante / elasticsearch-langdetect

A plugin for language detection in Elasticsearch using Nakatani Shuyo's language detector
Apache License 2.0
251 stars 46 forks source link

Not working in mapper es 2.3.3 and 2.3.1 #43

Open vacuumisme opened 8 years ago

vacuumisme commented 8 years ago

I've tried to define mapping field, but it is not working. it is working as endpoint. it seems bcs of LangdetectService Init. This line LangdetectService service = new LangdetectService(settingsBuilder.build()); is creating empty settings.

jprante commented 8 years ago

I can not follow.

Can you give an example of the steps you do and what setting is not working for you?

vacuumisme commented 8 years ago

yes, first i've tried 2.3.3 and installed plugin manually(i changed the es version in plugin-descriptor.properties). Next i've added some field definition in "text":{ "term_vector":"yes", "type":"string", "include_in_all": false, "analyzer":"indexing_english", "fields":{ "lang":{ "type" : "langdetect", "store":true } } }
next I indexed documents. but when i query "exists" {"field":"text.lang"} or "aggs" with "terms" of that field, or even tried to return it with fields, i can't do it. I also tried es 2.3.1. and i tried separate field with "copy_to" from the first one. when i try endpoint it works. then i've tried to figure out what is diff and i find that ngrams map is not loaded i think it because of the difference in settings that are passed to constructor. P.S. when I get mapping from elastic for that field it is "lang" : { "type" : "langdetect", "analyzer" : "_keyword", "position_increment_gap" : 100 }

vacuumisme commented 8 years ago

i also tried example from yuor tutorial, the query returns 0 hits

jprante commented 8 years ago

Thanks for your report.

Indeed, the examples did not work, there was a small flaw, the default languages were not set.

I fixed it in 2.3.3.0

vacuumisme commented 8 years ago

Awesome, thank you, by the way 2.3.3 release zip still doesn't exist

vggg commented 8 years ago

+1 for 2.3.3.0 Release version

jprante commented 8 years ago

@vggg 2.3.3.0 has been uploaded since June 12 http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-langdetect/2.3.3.0/