brewster / elastictastic

Object-document mapper and lightweight API adapter for ElasticSearch
MIT License
88 stars 13 forks source link

Setting default analyzer #23

Closed kostia closed 11 years ago

kostia commented 11 years ago

Hello,

I'm working on a german website and so would like to specify the analyzer globally (per index). Is it possible?

Kind regards! Kostia

outoftime commented 11 years ago

It doesn't look like ES itself has any index-level or type-level defaults for analyzer, and Elastictastic doesn't have the ability to set a default analyzer. Do you have so many fields that it's a problem to just set the analyzer in the mapping? The presets feature may be of some use -- this allows you to specify a set of common options for fields, and then apply them to the fields of your choosing.

kostia commented 11 years ago

Thanx! :-))) I'll try it out :100:

kostia commented 11 years ago

@outoftime Could you please provide an example of how to specify that correctly?

What I would like to achieve is the following:

  1. Use german stemming
  2. Exclude german stop-words

I've tried following:

field :description, analyzer: :german

But it doesn't work... I'm still unable to serach for "Malerin" (female form of "Maler") and I'm still getting results for "und" (german "and").

kostia commented 11 years ago

It seems not to be easy to achieve this behavior by only using an analyzer. Details here: https://groups.google.com/forum/?fromgroups=#!searchin/elasticsearch/german/elasticsearch/4uxtnLX3mE8/I-fg6THasH8J