Setting default analyzer for everything


(Enrique Medina Montenegro) #1

Hi,

Being a spanish guy, I created my own analyzer for stemming, accents, etc.
Now I want to make ES always use this analyzer when indexing my fields, no
matter which index or mapping they belong to. After some research, I found
that I have to create a provider for my analyzer and then define the
following in config/elasticsearch.yml:

index:
analysis:
analyzer:
default:
type: es.cuestamenos.lucene.analizadores.SpanishAnalyzerProvider

Is this correct? Do I need anything else? Will all "properties" in all
"mappings" use that analyzer always?

Thanks.


(Enrique Medina Montenegro) #2

Any feedback on the below?

On Wed, Feb 2, 2011 at 12:39 AM, Enrique Medina Montenegro <
e.medina.m@gmail.com> wrote:

Hi,

Being a spanish guy, I created my own analyzer for stemming, accents, etc.
Now I want to make ES always use this analyzer when indexing my fields, no
matter which index or mapping they belong to. After some research, I found
that I have to create a provider for my analyzer and then define the
following in config/elasticsearch.yml:

index:
analysis:
analyzer:
default:
type: es.cuestamenos.lucene.analizadores.SpanishAnalyzerProvider

Is this correct? Do I need anything else? Will all "properties" in all
"mappings" use that analyzer always?

Thanks.


(Shay Banon) #3

Yep, this will set the default analyzer used for any field that does not explicitly define an analyzer.
On Wednesday, February 2, 2011 at 1:35 PM, Enrique Medina Montenegro wrote:

Any feedback on the below?

On Wed, Feb 2, 2011 at 12:39 AM, Enrique Medina Montenegro e.medina.m@gmail.com wrote:

Hi,

Being a spanish guy, I created my own analyzer for stemming, accents, etc. Now I want to make ES always use this analyzer when indexing my fields, no matter which index or mapping they belong to. After some research, I found that I have to create a provider for my analyzer and then define the following in config/elasticsearch.yml:

index:
analysis:
analyzer:
default:
type: es.cuestamenos.lucene.analizadores.SpanishAnalyzerProvider

Is this correct? Do I need anything else? Will all "properties" in all "mappings" use that analyzer always?

Thanks.


(system) #4