Delete By Query not working in ES embedded server 5.5


(HARSHAD RANGANATHAN) #1

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:



(David Pilato) #2

You can not run elasticsearch embedded. Read this blog post.


(system) #3

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