Elasticsearch: create alias with routing and filter using Java API
<p>I'm trying to send this request using Java API:</p>

<pre><code>curl -XPUT 'http://localhost:9201/living/_alias/living_team' -d '
{
  "routing": "living_team",
  "filter": {
    "term": {
      "user": "living_team"   //user property must exists 
    }
  }
}'
</code></pre>

<p>Up to now, I've not been able to figure out how exactly build the Java request:</p>

<pre><code>this.elasticsearchResources.getElasticsearchClient()
    .admin()
    .indices()
    .prepareAliases()
    .addAlias(
        ElasticsearchRepository.ELASTICSEARCH_INDEX,
        alias,
        QueryBuilders.termQuery("user", alias);
</code></pre>

<p>This line only creates an ADD ALIAS request with a filter, nevertheless I don't know how to set routing path...</p>

<p>How could I set the routing path up on request?</p>