通过 Highlevel Rest api 创建弹性搜索索引失败?

知识探索者001

我正在尝试运行嵌入式弹性搜索实例(6.6.10。然后在启动嵌入式实例后,我正在尝试使用索引映射创建索引。但是我收到以下异常。

ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=unknown setting [[email protected]] please check that any required plugins are installed, or check the breaking changes documentation for removed settings]]
    at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)
    at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2050)
    at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2026)
    at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1775)
    at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1732)
    at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1694)
    at org.elasticsearch.client.IndicesClient.create(IndicesClient.java:151)
    at com.openmind.primecast.web.rest.PerformanceReportingResourceIntTest.startElasticServer(PerformanceReportingResourceIntTest.java:121)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
    Suppressed: org.elasticsearch.client.ResponseException: method [PUT], host [http://localhost:57457], URI [/mep-reports?master_timeout=30s&timeout=30s], status line [HTTP/1.1 400 Bad Request]
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"unknown setting [[email protected]] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"}],"type":"illegal_argument_exception","reason":"unknown setting [[email protected]] please check that any required plugins are installed, or check the breaking changes documentation for removed settings","suppressed":[{"type":"illegal_argument_exception","reason":"unknown setting [[email protected]] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.account_id.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.campaign_id.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.campaign_name.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.delivery_ts.format] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.delivery_ts.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.flight_id.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.flight_name.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.inventory.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.msg_text.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.nof_segments.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.o_error.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.recipient.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.sender.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.status.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.submission_ts.format] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.submission_ts.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"}]},"status":400}
        at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:929)
        at org.elasticsearch.client.RestClient.performRequest(RestClient.java:229)
        at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1762)
        ... 23 more
    Caused by: org.elasticsearch.client.ResponseException: method [PUT], host [http://localhost:57457], URI [/mep-reports?master_timeout=30s&timeout=30s], status line [HTTP/1.1 400 Bad Request]
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"unknown setting [[email protected]] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"}],"type":"illegal_argument_exception","reason":"unknown setting [[email protected]] please check that any required plugins are installed, or check the breaking changes documentation for removed settings","suppressed":[{"type":"illegal_argument_exception","reason":"unknown setting [[email protected]] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.account_id.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.campaign_id.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.campaign_name.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.delivery_ts.format] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.delivery_ts.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.flight_id.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.flight_name.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.inventory.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.msg_text.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.nof_segments.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.o_error.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.recipient.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.sender.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.status.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.submission_ts.format] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":"unknown setting [index.doc.properties.submission_ts.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"}]},"status":400}
        at org.elasticsearch.client.RestClient$1.completed(RestClient.java:548)
        at org.elasticsearch.client.RestClient$1.completed(RestClient.java:533)
        at org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:123)
        at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:181)
        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:436)
        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:326)
        at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265)
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
        at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
        at java.lang.Thread.run(Thread.java:748)

以下是使用java高级rest客户端的代码片段。

CreateIndexRequest indexCreationRequest = new CreateIndexRequest("mep-reports"); 

indexCreationRequest.source(IOUtils.toByteArray(getJsonResourceAsStream()), XContentType.JSON);

CreateIndexResponse createIndexResponse = client.indices().create(indexCreationRequest, RequestOptions.DEFAULT);

以下是我正在使用的索引映射。索引映射由 getJsonResourceAsStream() 返回

{"doc":{"properties":{"@timestamp":{"type":"date"},"@version":{"type":"text"},"account_id":{"type":"keyword"},"campaign_id":{"type":"keyword"},"delivery_ts":{"type":"date","format":"epoch_millis"},"submission_ts":{"type":"date","format":"epoch_millis"},"flight_id":{"type":"keyword"},"inventory":{"type":"keyword"},"msg_text":{"type":"keyword"},"nof_segments":{"type":"keyword"},"o_error":{"type":"keyword"},"recipient":{"type":"text"},"sender":{"type":"keyword"},"status":{"type":"text"},"campaign_name":{"type":"keyword"},"flight_name":{"type":"keyword"}}}}
知识探索者001

我找到了解决方案,因为我的映射文档格式不正确。应该如下。

{
  "mappings": {
    "doc": {
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "@version": {
          "type": "text"
        },
        "account_id": {
          "type": "keyword"
        },
        "campaign_id": {
          "type": "keyword"
        },
        "delivery_ts": {
          "type": "date",
          "format": "epoch_millis"
        },
        "submission_ts": {
          "type": "date",
          "format": "epoch_millis"
        },
        "flight_id": {
          "type": "keyword"
        },
        "inventory": {
          "type": "keyword"
        },
        "msg_text": {
          "type": "keyword"
        },
        "nof_segments": {
          "type": "keyword"
        },
        "o_error": {
          "type": "keyword"
        },
        "recipient": {
          "type": "text"
        },
        "sender": {
          "type": "keyword"
        },
        "status": {
          "type": "text"
        },
        "campaign_name": {
          "type": "keyword"
        },
        "flight_name": {
          "type": "keyword"
        }
      }
    }
  }
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

通过Cloudant-Client API访问搜索索引

通过REST API更新Couchbase FTS索引

通过给定范围的属性查询弹性搜索索引?

如何通过 postman 调用 REST API 在 Azure 中创建索引?

通过 REST API 创建 AX 订单

无法通过Rest API创建Azure锁

Blazegraph通过REST API创建名称空间

通过 Flask REST API 创建 JSON 文件

SonarQube,通过REST API创建问题

在使用 Java 高级其余客户端批量 API 创建动态弹性搜索索引方面需要帮助

Azure搜索索引器可以覆盖通过API发布的更新吗?

通过REST API在TeamCity上搜索内部版本号

通过REST API身份验证进行TeamCity备份失败

如何通过Rest API在ejabberd中创建聊天室?

如何通过REST API在Parse中批量创建用户

Nifi通过Rest-API创建控制器服务

Kapacitor如何通过REST API使用模板创建任务?

通过REST API创建Keycloak客户端

如何通过REST API在GeoServer中创建WMS图层?

通过 REST API 创建的发票导致 PayPal 后端出错

通过REST API在TeamCity 8.0中创建加密的构建参数

通过 PowerShell 使用 REST API 创建 JIRA 问题

如何通过REST API创建Azure Application Insights的新实例

使用Java通过Rest API在Confluence中创建页面

如何通过VSTS REST API创建构建定义

如何通过REST API在Alfresco中创建新文档?

如何通过 REST API 从商机屏幕创建销售订单

通过 Rest API 创建没有工件的 Azure DevOps 版本

无法通过Keycloak Rest API使用密码创建用户