Combining stopwords with filter in an Analyzer

Hello,

I'm trying to combine the Stopwords functionnality of an Analyzer with a
Synonym filter. They work separatly but I can't manage to make them work
together.

So I create an index (index3) and set an analyzer which remove little dutch
words, It's working : In the following example, "de" and "het" are removed,

PUT /index3
{
"settings": {
"analysis": {
"analyzer": {
"du_analyzer": {
"type": "standard",
"stopwords" : "dutch"
}
}
}
}
}

GET /index3/_analyze?analyzer=du_analyzer
{
het de universe
}

Results :

{
"tokens": [
{
"token": "universe",
"start_offset": 14,
"end_offset": 22,
"type": "",
"position": 3
}
]
}

When I try to add a Synonym Filter, it works but the Stopwords
functionnality stop working... Like in the following example ("universe"
become "cosmos" but "het" and "de" are still there)

PUT /index2
{
"settings": {
"analysis": {
"filter": {
"synonym" : {
"type" : "synonym",
"synonyms_path" : "analysis/synonym.txt"
}
},
"analyzer": {
"du_analyzer": {
"type": "custom",
"tokenizer": "standard",
"stopwords" : "dutch",
"filter": ["synonym"]
}
}
}
}
}

GET /index2/_analyze?analyzer=du_analyzer
{
het de universe
}

Results :

{
"tokens": [
{
"token": "het",
"start_offset": 7,
"end_offset": 10,
"type": "",
"position": 1
},
{
"token": "de",
"start_offset": 11,
"end_offset": 13,
"type": "",
"position": 2
},
{
"token": "cosmos",
"start_offset": 14,
"end_offset": 22,
"type": "SYNONYM",
"position": 3
}
]
}

Anyone know why my request behaves like this?

--
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/42fb605b-27da-43ca-b1a7-d4d2b291e75f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ok, I found my error. stopwords is also a filter... Here is the solution

PUT /index4
{
"settings": {
"analysis": {
"filter": {
"synonym" : {
"type" : "synonym",
"synonyms_path" : "analysis/synonym.txt"
},
"du_stop" : {
"type" : "stop",
"stopwords" : "dutch"
}
},
"analyzer": {
"du_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": ["synonym", "du_stop"]
}
}
}
}
}

--
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/3251e032-dc61-45b6-9cfb-57d2395ae626%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.