Skip to content

StopTokenFilter with predefined language-specific stop words #1222

@danielsilva

Description

@danielsilva

I'm wondering how to define a StopTokenFilter with predefined language-specific stop words as explained at the docs:

The stopwords parameter accepts either an array of stopwords:

PUT /my_index

{
   "settings": {
       "analysis": {
           "filter": {
               "my_stop": {
                   "type":       "stop",
                   "stopwords": ["and", "is", "the"]
               }
           }
       }
   }
}

or a predefined language-specific list:

PUT /my_index

{
   "settings": {
       "analysis": {
           "filter": {
               "my_stop": {
                   "type":       "stop",
                   "stopwords":  "_english_"
               }
       }
   }
}

But our StopTokenFilter class defines only the array version for this parameter:

[JsonProperty("stopwords")]
public IEnumerable<string> Stopwords { get; set; }

Shouldn't we need a optional parameter for the StopTokenFilter class that receives the predefined language name to use? Like this:

public StopTokenFilter(string predefinedStopWords = null) : base("stop")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions