# Stop Token Filter Language Customization Not Working in Java

**URL:** <https://discuss.elastic.co/t/stop-token-filter-language-customization-not-working-in-java/313949>\
**Category:** Elasticsearch\
**Created:** [September 8, 2022, 6:34am UTC](https://discuss.elastic.co/t/stop-token-filter-language-customization-not-working-in-java/313949 "2022-09-08T06:34:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![green12](https://avatars.discourse-cdn.com/v4/letter/g/58956e/32.png) [@green12](https://discuss.elastic.co/u/green12)\
**Post date:** [September 8, 2022, 6:34am UTC](https://discuss.elastic.co/t/stop-token-filter-language-customization-not-working-in-java/313949/1 "2022-09-08T06:34:05Z")

</div>

Hi everyone, I'm trying to create a customized [Indonesian language stop token filter](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-stop-tokenfilter.html#analysis-stop-tokenfilter-stop-words-by-lang) using the [Java package](https://artifacts.elastic.co/javadoc/co/elastic/clients/elasticsearch-java/8.1.0/co/elastic/clients/elasticsearch/_types/analysis/StopTokenFilter.Builder.html).  
The following json is how the configuration looks like when using curl (which works just fine):

```auto
"filter": { 
    "my_stop_filter": { 
        "type": "stop", 
        "stopwords": "_indonesian_"
    }
}

```

And then, here's how I tried to recreate it using Java:

```auto
private TokenFilter createStopFilter() { 
    return new TokenFilter.Builder() 
        .definition( 
            new TokenFilterDefinition.Builder() 
                .stop(new StopTokenFilter.Builder().stopwords("_indonesian_").build()) 
                .build() 
            ) 
           .build(); 
}

```

Turns out, the stopwords just filter the word "\_ indonesian \_" instead of the built-in Indonesian stop words like it was supposed to do.  
The [documentation](https://artifacts.elastic.co/javadoc/co/elastic/clients/elasticsearch-java/8.1.0/co/elastic/clients/elasticsearch/_types/analysis/StopTokenFilter.Builder.html) for the Java package also doesn't mention any support for language customization.  
Does this mean it's simply not supported in Java? Or did I do something wrong?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 6, 2022, 6:34am UTC](https://discuss.elastic.co/t/stop-token-filter-language-customization-not-working-in-java/313949/2 "2022-10-06T06:34:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
