求解 org.elasticsearch.index.mapper.MapperParsingException
来源:互联网 发布:访客网络什么意思 编辑:程序博客网 时间:2024/05/21 22:54
Exception in thread "main" org.elasticsearch.index.mapper.MapperParsingException: Root type mapping not empty after parsing! Remaining fields: [test : {properties={id={type=long, store=yes}, type={type=string, index=not_analyzed}, catIds={type=integer}}}]
at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:278)
at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:192)
at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:449)
at org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:505)
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:374)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:188)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:158)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
下面是代码
private static XContentBuilder getMapping() throws Exception {
XContentBuilder mapping =jsonBuilder().startObject();
mapping=mapping.startObject("test")
.startObject("properties")
.startObject("id")
.field("type", "long")
.field("store", "yes")
.endObject()
.startObject("type")
.field("type", "string")
.field("index", "not_analyzed")
.endObject()
.startObject("catIds")
.field("type", "integer")
.endObject()
.endObject()
.endObject();
mapping=mapping.endObject();
return mapping;
}
// TODO Auto-generated method stub
Client client = ESUtils.getClient();
PutMappingRequestBuilder builder = client.admin().indices()
.preparePutMapping("esindex");
builder.setType("testMapping");
XContentBuilder mapping = getMapping();
builder.setSource(mapping);
PutMappingResponse response = builder.execute().actionGet();
System.out.println(response.isAcknowledged());
- 求解 org.elasticsearch.index.mapper.MapperParsingException
- elasticsearch报错:org.elasticsearch.index.engine.DocumentMissingException:document missing
- ElasticSearch {"error":"MapperParsingException[failed to parse];JsonParseException[Unexpected charac
- elasticsearch MapperParsingException[failed to parse [auditDate]]; nested: NumberFormatException[Fo
- Windows下elasticsearch插入数据报错!"error":"MapperParsingException[failed to parse]
- elasticsearch index type
- elasticsearch之index模块
- ElasticSearch Index API
- elasticsearch查看所有index
- elasticsearch mapping index 说明
- elasticsearch 操作 index 命令
- elasticsearch index and store
- Magic Index 求解
- org.mybatis.spring.mapper.MapperScannerConfigurer
- org.elasticsearch.transport.ReceiveTimeoutTransportException:
- what is an elasticsearch index?
- elasticsearch的javaAPI之index
- elasticsearch index 的 type 解释
- logcat获取apk的activity名
- STL学习----入门(1)[functional]
- 2824 The Euler function【欧拉函数】
- uploadifive 1.1.2 动态传参
- caffe 回调函数分析
- 求解 org.elasticsearch.index.mapper.MapperParsingException
- TWIG 模板设计 快速入门手册 中文
- MSBuild 命令行编译项目且不包含pdb文件
- 详解android中OnClickListener监听
- Caliburn Micro Part 1: Getting Started
- 手机录音和降噪那些事
- 场景漫游(wasdqe)
- 链式A+B
- OC 中的block的使用与它的实现底层