I am using Elastic Search with a Grails application through the Elastic
Search Plugin. I am upgrading switching over from the Searchable plugin
built on top of Compass framework. My problem is in trying to replicate the
features available in Searchable. One of them is stemmed search. Searchable
made it easy through Compass configuration to set a default analyzer. By
using a Snowball analyzer we made indexing and searching processes use
stemming.
Now I am trying to figure out how to do the same with Elastic Search
Plugin. The plugin allows me to set the analyzer on the per-field basis
which affects the mapping. Thus when I use fielded search, stemming works
fine. But I am not sure how to make a Snowball analyzer a global one. The
plugin does not support it directly, nor it is clear how I can use Groovy
or Grails API directly to specify Snowball analyzer as the default one for
my index.
What is the proper way to set a default analyzer for the entire index?
There is a section on Default Analyzers you can set here
You can also specify what type of analyzers you want to set per type or
even use a dynamic template to have specific analyzers for fields that
match a certain rule.
I am using Elastic Search with a Grails application through the Elastic
Search Plugin. I am upgrading switching over from the Searchable plugin
built on top of Compass framework. My problem is in trying to replicate the
features available in Searchable. One of them is stemmed search. Searchable
made it easy through Compass configuration to set a default analyzer. By
using a Snowball analyzer we made indexing and searching processes use
stemming.
Now I am trying to figure out how to do the same with Elastic Search
Plugin. The plugin allows me to set the analyzer on the per-field basis
which affects the mapping. Thus when I use fielded search, stemming works
fine. But I am not sure how to make a Snowball analyzer a global one. The
plugin does not support it directly, nor it is clear how I can use Groovy
or Grails API directly to specify Snowball analyzer as the default one for
my index.
What is the proper way to set a default analyzer for the entire index?
Thank you for your reply. I am removed by several layers of abstraction
from Elastic Search. The Grails plugin reads the annotation-like
information from my domain classes, constructs the mapping based on it and
sends it to the search engine.
It is not clear to me where I can specify the default analyzer. Is it in
the mapping? Or is there a Java API call can I make to configure the
default analyzer for my index.
How do I convert the information on the page you sent to an API call?
Use the create index API And provide the settings there when you create the
index. Thats the simplest way to do it. Another is to put this in the
config of each node you have.
Thank you for your reply. I am removed by several layers of abstraction
from Elastic Search. The Grails plugin reads the annotation-like
information from my domain classes, constructs the mapping based on it and
sends it to the search engine.
It is not clear to me where I can specify the default analyzer. Is it in
the mapping? Or is there a Java API call can I make to configure the
default analyzer for my index.
How do I convert the information on the page you sent to an API call?
Thank you for your reply. It is still unclear to me how to set the default
analyzer. I am not sure what this "create index API" corresponds to in Java
API. Could you provide a reference?
Thank you for your reply. It is still unclear to me how to set the default
analyzer. I am not sure what this "create index API" corresponds to in Java
API. Could you provide a reference?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.