ElasticSearch enable Snowball Analyzer and Synonym on Fields

Hi guys,

Originally I posted this in SO but found this place which seems more
suitable to ask :slight_smile:

I have an elasticsearch index where my default analyzer is the snowball
analyzer so I can get the stemming and now I need the ability to have
synonyms on some of the fields as well as the benefit of the snowball
analyzer to do stemming.

Is this possible and if so how?

As a test I tried to set a synonym filter on the snowball analiyzer, hoping
that it would enable synonyms on all fields so I can test it but that
didn't really work...

I created another analyzer for synonyms on my index with the WordNet
synonym file.

If I am not clear please let me know and I'll try and update. Here is my
current index settings.

"settings": {
"index": {
"analysis": {
"analyzer": {
"synonym": {
"filter": [
"synonym"
],
"tokenizer": "whitespace"
},
"default": {
"language": "English",
"type": "snowball"
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "/elasticsearch/wn_s.pl",
"format": "wordnet"
}
}
}
}
}
}

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/26511746-d12e-4630-99bb-a4b488c0c201%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

You would need to create a custom analyzer by basically repeating the
configuration of the snowball analyzer, but adding in the synonym filter.
You can't modify a stock analyzer, unless this has changed (if so, someone
please correct me).

--
Ivan

On Wed, Nov 5, 2014 at 6:43 PM, Iqbal Ahmed iq.quit@gmail.com wrote:

Hi guys,

Originally I posted this in SO but found this place which seems more
suitable to ask :slight_smile:

I have an elasticsearch index where my default analyzer is the snowball
analyzer so I can get the stemming and now I need the ability to have
synonyms on some of the fields as well as the benefit of the snowball
analyzer to do stemming.

Is this possible and if so how?

As a test I tried to set a synonym filter on the snowball analiyzer,
hoping that it would enable synonyms on all fields so I can test it but
that didn't really work...

I created another analyzer for synonyms on my index with the WordNet
synonym file.

If I am not clear please let me know and I'll try and update. Here is my
current index settings.

"settings": {
"index": {
"analysis": {
"analyzer": {
"synonym": {
"filter": [
"synonym"
],
"tokenizer": "whitespace"
},
"default": {
"language": "English",
"type": "snowball"
}
},
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "/elasticsearch/wn_s.pl",
"format": "wordnet"
}
}
}
}
}
}

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/26511746-d12e-4630-99bb-a4b488c0c201%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/26511746-d12e-4630-99bb-a4b488c0c201%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQComno1ywsjw%3DvhxbhT8oEqQPeWzs9DOqUFDYH-oyLA_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.