# Delete By Query not working in ES embedded server 5.5

**URL:** <https://discuss.elastic.co/t/delete-by-query-not-working-in-es-embedded-server-5-5/155768>\
**Category:** Elasticsearch\
**Created:** [November 7, 2018, 5:36pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working-in-es-embedded-server-5-5/155768 "2018-11-07T17:36:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshadranganathan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshadranganathan/32/37388_2.png) [@harshadranganathan](https://discuss.elastic.co/u/harshadranganathan)\
**Post date:** [November 7, 2018, 5:36pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working-in-es-embedded-server-5-5/155768/1 "2018-11-07T17:36:42Z")

</div>

I have an embedded server running for version 5.5

```
 public EsEmbeddedRandomServer(String home) {
    this.portHttp = freeRandomPort(9200, 9299);
    this.portTransport = freeRandomPort(9300, 9399);
    String clusterName = String.format("es-embedded-%s", portHttp);

    log.info("Found free ports {} and {}", portHttp, portTransport);

    Properties esConf = new Properties();
    esConf.setProperty("path.home", home);
    esConf.setProperty("http.type", "netty3");
    esConf.setProperty("http.port", String.valueOf(portHttp));
    esConf.setProperty("http.enabled", "true");
    esConf.setProperty("transport.tcp.port", String.valueOf(portTransport));
    esConf.setProperty("cluster.name", clusterName);
    esConf.setProperty("transport.type", "local");
    esConf.setProperty("path.repo", home);

    Settings settings = Settings.builder().put(esConf).build();
    this.node = new PluginOverridableNode(settings, Arrays.asList(Netty3Plugin.class));

}

public void start() throws NodeValidationException {
    node.start();
}

```

When I run this query against the remote ES running on version 5.5 it works fine.

```
    curl -X POST \
    http://localhost:9200/docker-data-set/_delete_by_query \
   -d '{
         "query": {
            "match_all": {}
        }
    }'

```

However, when I run the same against the local embedded server running on the same version I get the error:

```
{
"error": {
    "root_cause": [
        {
            "type": "invalid_type_name_exception",
            "reason": "Document mapping type name can't start with '_', found: [_delete_by_query]"
        }
    ],
    "type": "invalid_type_name_exception",
    "reason": "Document mapping type name can't start with '_', found: [_delete_by_query]"
},
"status": 400

```

}

Refer:

> <https://stackoverflow.com/questions/41998979/elastic-search-delete-by-query-isnt-working>

  

> <https://stackoverflow.com/questions/45061315/delete-by-query-conflicts-proceed-doesnt-work-in-elasticsearch-5-1-1-with-netty>

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 7, 2018, 5:59pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working-in-es-embedded-server-5-5/155768/2 "2018-11-07T17:59:16Z")

</div>

You can not run elasticsearch embedded. Read this [blog post](https://www.elastic.co/blog/elasticsearch-the-server).

---

<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:** [December 5, 2018, 5:59pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working-in-es-embedded-server-5-5/155768/3 "2018-12-05T17:59:27Z")

</div>

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