MLT analyzer dosn't remove stopwords


we use MLT to find documents base on an id of a source document. Via Validate-API (_validate/query?rewrite=true) we found out that a couple of terms are used which we dosn't want to use for MLT. So we have added a list of stopwords via "stop_words". Works as expected.

Now we want to define a stopword file and place it in the config directory and add an analyzer which should use this stopword file. We tested the analyzer via the Analyze-API (_analyze) and it works as expected.

After that we removed the "stop_words" from the MLT query and added the "analyzer": "my_stopwords_analyzer" to MLT query but it dosn't remove the stopwords as the list of stopwords definded via "stop_words" has done. Shouldn't it?

From a first glance I'm not sure if the analyzer parameter gets apply to docs that you get based on an id or just when you directly supply text. Reading the doc:

When specifying documents, the text is fetched from fields unless overridden in each document request. The text is analyzed by the analyzer at the field, but could also be overridden. The syntax to override the analyzer at the field follows a similar syntax to the per_field_analyzer parameter of the Term Vectors API.

it looks like you might need to specify a per_field_analyzer instead.

If i directly supply text then the analyzer parameter gets applied. For docs i get based on ids it dosn't. Thanks for your feedback.