【问题标题】:How to delete index in elasticsearch 5.6.3如何在 elasticsearch 5.6.3 中删除索引
【发布时间】:2017-11-20 14:31:48
【问题描述】:

我最近将项目中的 elasticsearch 版本从 2.3.3 更新到 5.6.3,在 2.3.3 版本中,我使用 org.elasticsearch.plugin 2.0.0-rc1 删除我的索引,我正在使用以下设置:-

      Client client = TransportClient.builder().addPlugin(DeleteByQueryPlugin.class).build().addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(host), port));

而我的删除索引代码是:-

        DeleteByQueryResponse response = new DeleteByQueryRequestBuilder(client, DeleteByQueryAction.INSTANCE)
                .setIndices(index)
                .setTypes(indexType)
                .setSource(query.toString())
                .execute()
                .actionGet();

但在 elasticsearch 5.6.3 版中,我使用以下方法删除索引是:-

 BulkByScrollResponse response = DeleteByQueryAction.INSTANCE.newRequestBuilder(client)
                .source(index)
                .filter(QueryBuilders.queryStringQuery(query.toString()))
                .execute()
                .actionGet();

但是当我运行我的代码时,我遇到了以下异常:-

java.lang.NoSuchFieldError: V_5_1_1_UNRELEASED

请建议我如何使用弹性搜索 5.6.3 版本删除索引

【问题讨论】:

    标签: java elasticsearch spring-boot


    【解决方案1】:

    我会建议弹性的website 推荐的选项

    【讨论】:

    • 我可以看到一些差异,这就是我发送链接的原因
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-10
    • 2020-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多