精华内容
下载资源
问答
  • ElasticSearch创建索引报错
    千次阅读
    2018-08-29 11:15:58

    当执行

    curl -X PUT '9.112.4.34:9200/accounts/person/1' -d '
    {
      "user": "张三",
      "title": "工程师",
      "desc": "数据库管理"
    }'

    报错:{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406} 

    curl -H 'Content-Type:application/json' -X PUT '9.112.4.34:9200/accounts/person/1' -d '
    {
      "user": "张三",
      "title": "工程师",
      "desc": "数据库管理"
    }'

    是由于ES在6.x后做了调整,具体信息查看官网:https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests

    更多相关内容
  • Q:安装ik分词器1.2.9 后,使用head插件创建索引报错 { " error ": "IndexCreationException[[email] failed to create index]; nested: NoClassDefFoundError[org/apache/...

    Q:安装ik分词器1.2.9 后,使用head插件创建索引报错

    { 
     "error": "IndexCreationException[[email] failed to create index]; nested: NoClassDefFoundError[org/apache/http/client/ClientProtocolException]; nested: ClassNotFoundException[org.apache.http.client.ClientProtocolException]; ",
    "status": 500 }

    A:根据其提示,发现有2种情况,一是jdk的版本不对,一是少了jar包。

    百度过后发现,其它人也有相应的情况。
    说是ik的目录下少了 http的jar包。

    • 1、同步httpClient和httpCore包到集群的所有机器的/plugins/analysis-ik目录下。
    • 2、重启es

    转载于:https://my.oschina.net/claireliu/blog/468185

    展开全文
  • ElasticSearch版本号:5.6.14,这个错误和ES版本有一定的关系,还是先交代下版本号,免得有的读者根据我的方法操作后无效 错误翻译: mapper_parsing_exception :映射解析异常 Root mapping definition has ...

    ElasticSearch版本号:5.6.14,这个错误和ES版本有一定的关系,还是先交代下版本号,免得有的读者根据我的方法操作后无效
    在这里插入图片描述
    错误翻译:
    mapper_parsing_exception :映射解析异常
    Root mapping definition has unsupported parameters :根映射定义包含不受支持的参数

    错误映射语句1:

    {
        "test_0904": {
            "mappings": {
                "user": {
                    "properties": {
                        "birthday": {
                            "type": "date",
                            "store": true
                        },
                        "hobby": {
                            "type": "text",
                            "store": true
                        },
                        "id": {
                            "type": "long",
                            "store": true
                        },
                        "name": {
                            "type": "text",
                            "store": true
                        }
                    }
                }
            }
        }
    }
    

    错误映射语句2:

    {
        "mappings": {
            "user": {
                "properties": {
                    "birthday": {
                        "type": "date",
                        "store": true
                    },
                    "hobby": {
                        "type": "text",
                        "store": true
                    },
                    "id": {
                        "type": "long",
                        "store": true
                    },
                    "name": {
                        "type": "text",
                        "store": true
                    }
                }
            }
        }
    }
    

    修改后的映射语句:

    {
        "properties": {
            "birthday": {
                "type": "date",
                "store": true
            },
            "hobby": {
                "type": "text",
                "store": true
            },
            "id": {
                "type": "long",
                "store": true
            },
            "name": {
                "type": "text",
                "store": true
            }
        }
    }
    

    总结起来就是ES各个版本支持的映射语句结构上存在一定的差异,不同版本有不同版本的语句写法,参数有的版本支持,有的版本不支持。

    展开全文
  • ElasticsearchStatusException[Elasticsearch exception [type=resource_already_exists_exception, reason=index [discusspost/3IyXwPzXQ06z7uwDN-z5Zw] already exists] ]

    笔记待改

    报错:
    ElasticsearchStatusException[Elasticsearch exception [type=resource_already_exists_exception, reason=index [discusspost/3IyXwPzXQ06z7uwDN-z5Zw] already exists]
    ]

    情景再现

    一句话来说,就是用testDeleteIndex()方法删除了叫做"discusspost"的索引后,又用testCreateIndex()创建了叫做"discusspost"的索引,并往该索引里插入了数据。然后在testCreateIndex()方法里的createIndex()方法处报错。


    application.properties

    # ElasticsearchProperties
    elasticSearch.url=127.0.0.1:9200
    elasticsearch.indices=discusspost
    

    EsConfig

    import org.elasticsearch.client.RestHighLevelClient;
    import org.springframework.beans.factory.annotation.Value;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.data.elasticsearch.client.ClientConfiguration;
    import org.springframework.data.elasticsearch.client.RestClients;
    
    @Configuration
    public class EsConfig {
        @Value("${elasticSearch.url}")
        private String esUrl;
    
        //localhost:9200 写在配置文件中就可以了
        @Bean
        RestHighLevelClient client() {
            ClientConfiguration clientConfiguration = ClientConfiguration.builder()
                    .connectedTo(esUrl)//elasticsearch地址
                    .build();
    
            return RestClients.create(clientConfiguration).rest();
        }
    }
    

    pom.xml

    	<properties>
    		<java.version>1.8</java.version>
    		<elasticsearch.version>7.12.0</elasticsearch.version>
    	</properties>
    
    		<dependency>
    			<groupId>org.springframework.boot</groupId>
    			<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    		</dependency>
    

    DiscussPost

    import org.springframework.data.annotation.Id;
    import org.springframework.data.elasticsearch.annotations.Document;
    import org.springframework.data.elasticsearch.annotations.Field;
    import org.springframework.data.elasticsearch.annotations.FieldType;
    
    import java.util.Date;
    
    @Document(indexName = "discusspost", /*type = "_doc",*/ shards = 6, replicas = 3)
    public class DiscussPost {
    
        @Id
        private int id;
    
        @Field(type = FieldType.Integer)
        private int userId;
    
        // 互联网校招
        @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
        private String title;
    
        @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
        private String content;
    
        @Field(type = FieldType.Integer)
        private int type;
    
        @Field(type = FieldType.Integer)
        private int status;
    
        @Field(type = FieldType.Date)
        private Date createTime;
    
        @Field(type = FieldType.Integer)
        private int commentCount;
    
        @Field(type = FieldType.Double)
        private double score;
    
    	//get、set方法、toString方法
    }
    

    ElasticsearchTests

    @SpringBootTest
    @ContextConfiguration(classes = CommunityApplication.class)
    public class ElasticsearchTests {
    
        @Autowired
        private DiscussPostMapper discussMapper;
    
        @Autowired
        private DiscussPostRepository discussRepository;
    
        @Qualifier("client")
        @Autowired
        private RestHighLevelClient restHighLevelClient;
    
        @Value("${elasticsearch.indices}")
        String esIndices;
    
        @Test
        public void testExistsIndex() throws Exception {
            System.out.println(existsIndex(esIndices));
        }
    
        @Test
        public void testCreateIndex() throws Exception {
            System.out.println(createIndex(esIndices));
            //把所有帖子(List<DiscussPost>)存入es的discusspost索引(es的索引相当于数据库的表)
            discussRepository.saveAll(discussMapper.selectAllDiscussPosts());
        }
    
        @Test
        public void testDeleteIndex() throws Exception {
            discussRepository.deleteAll();//删除所有数据
            System.out.println(deleteIndex(esIndices));
        }
    
        //判断索引是否存在
        public boolean existsIndex(String index) throws IOException {
            GetIndexRequest request = new GetIndexRequest(index);
            boolean exists = restHighLevelClient.indices().exists(request, RequestOptions.DEFAULT);
            return exists;
        }
    
        //创建索引
        public boolean createIndex(String index) throws IOException {
            CreateIndexRequest request = new CreateIndexRequest(index);
            CreateIndexResponse createIndexResponse = restHighLevelClient.indices().create(request, RequestOptions.DEFAULT);
            return createIndexResponse.isAcknowledged();
        }
    
        //删除索引
        public boolean deleteIndex(String index) throws IOException {
            DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(index);
            AcknowledgedResponse response = restHighLevelClient.indices().delete(deleteIndexRequest, RequestOptions.DEFAULT);
            return response.isAcknowledged();
        }
    }
    

    完整报错信息

    [discusspost/3IyXwPzXQ06z7uwDN-z5Zw] ElasticsearchStatusException[Elasticsearch exception [type=resource_already_exists_exception, reason=index [discusspost/3IyXwPzXQ06z7uwDN-z5Zw] already exists]
    ]
    	at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:176)
    	at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1933)
    	at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1910)
    	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1667)
    	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1639)
    	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1606)
    	at org.elasticsearch.client.IndicesClient.create(IndicesClient.java:134)
    	at com.nowcoder.community.ElasticsearchTests.createIndex(ElasticsearchTests.java:218)
    	at com.nowcoder.community.ElasticsearchTests.testCreateIndex(ElasticsearchTests.java:197)
    	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:497)
    	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
    	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
    	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
    	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    	at java.util.ArrayList.forEach(ArrayList.java:1249)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    	at java.util.ArrayList.forEach(ArrayList.java:1249)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
    	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
    	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
    	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
    	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
    	Suppressed: org.elasticsearch.client.ResponseException: method [PUT], host [http://127.0.0.1:9200], URI [/discusspost?master_timeout=30s&timeout=30s], status line [HTTP/1.1 400 Bad Request]
    {"error":{"root_cause":[{"type":"resource_already_exists_exception","reason":"index [discusspost/3IyXwPzXQ06z7uwDN-z5Zw] already exists","index_uuid":"3IyXwPzXQ06z7uwDN-z5Zw","index":"discusspost"}],"type":"resource_already_exists_exception","reason":"index [discusspost/3IyXwPzXQ06z7uwDN-z5Zw] already exists","index_uuid":"3IyXwPzXQ06z7uwDN-z5Zw","index":"discusspost"},"status":400}
    		at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:326)
    		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:296)
    		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:270)
    		at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1654)
    		... 70 more
    

    报错原因和解决方法

    报错原因:分词器反复创建:先用standard分词器建的index,然后使用ik分词器又建索引出现这个错误,相当于对已有的index修改mapping,同样之前用standard建的索引,现在换成用ik分词器搜也搜不出来RestHighLevelClient的TermQuery。

    解决方法:直接注释掉createIndex()方法,不创建索引就好了。你之前已经删除掉了索引"discusspost",es里是没有"discusspost"索引的。但实体类"DiscussPost"里有"indexName = “discusspost”",你往索引里插入数据时,索引就自动存在了。

        @Test
        public void testCreateIndex() throws Exception {
            //System.out.println(createIndex(esIndices));
            //把所有帖子(List<DiscussPost>)存入es的discusspost索引(es的索引相当于数据库的表)
            discussRepository.saveAll(discussMapper.selectAllDiscussPosts());
        }
        
        //创建索引
        public boolean createIndex(String index) throws IOException {
            CreateIndexRequest request = new CreateIndexRequest(index);
            CreateIndexResponse createIndexResponse = restHighLevelClient.indices().create(request, RequestOptions.DEFAULT);
            return createIndexResponse.isAcknowledged();
        }
    

    我的疑问

    问题:我用testDelete()方法把索引中的数据全部删掉,我用elasticsearch-head http://127.0.0.1:9100/刷新看了,数据确实都删掉了,然后用testInsert()方法插入一条数据,但此时,所有数据都插入了。

        //删除一条数据和删除所有数据
        @Test
        public void testDelete() {
            //discussRepository.deleteById(109);//删除一条数据
            discussRepository.deleteAll();//删除所有数据
        }
        
        //一次保存一条数据
        @Test
        public void testInsert() {
            //把id为241的DiscussPost的对象保存到discusspost索引(es的索引相当于数据库的表)
            discussRepository.save(discussMapper.selectDiscussPostById(241));
        }
        
    

    问题:我用testDeleteIndex()删除所有数据再删除索引,我用elasticsearch-head http://127.0.0.1:9100/刷新看了,索引确实删掉了,然后用testInsert()方法插入一条数据,但此时,所有数据都插入了。

        @Test
        public void testDeleteIndex() throws Exception {
            discussRepository.deleteAll();//删除所有数据
            System.out.println(deleteIndex(esIndices));
        }
    
        //删除索引
        public boolean deleteIndex(String index) throws IOException {
            DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(index);
            AcknowledgedResponse response = restHighLevelClient.indices().delete(deleteIndexRequest, RequestOptions.DEFAULT);
            return response.isAcknowledged();
        }
    
    
        //一次保存一条数据
        @Test
        public void testInsert() {
            //把id为241的DiscussPost的对象保存到discusspost索引(es的索引相当于数据库的表)
            discussRepository.save(discussMapper.selectDiscussPostById(241));
        }
    
    展开全文
  • 创建索引报错 “error” : “Content-Type header [application/x-www-form-urlencoded] is not supported” 解决方案 找到elasticsearch-head插件目录下面的vendor.js文件 全局搜索application/x-...
  • ES创建索引时,报错 "reason": "Root mapping definition has unsupported parameters: 语法错误。 原因:我这里是因为换了7.x版本,7.x版本以后就不支持type了,所以创建索引时不用加type{} 7.x之前的版本...
  • ElasticSearch建立索引报错

    千次阅读 2017-06-14 10:24:31
    报错为:MapperParsingException[Object mapping for [title] tried to parse field [tilte] as object ,but found a concrete value] 映射异常:title 的对象映射 字段应该为object,但是却发现是一个真实的值。 ...
  • 二:如何创建索引(数据库)结构?三:如何向已有索引(数据库)中添加类型(表)结构?四:如何向已有类型(表)中添加新字段?五:如何更改现有类型(表)中的字段类型?六:如何删除索引(数据库)?七:如何删除索引中某一个...
  • 创建信息: { "mappings":{ "article":{ "properties":{ "id":{ "type":"long", "store":true }, ...
  • 1)进入head安装目录_site/vendor.js的6886行附近修改 2)进入head安装目录_site/vendor.js的7573行附近,修改 修改为: 重启ESes-head插件后,发下执行es初始化脚本还是报同样错, 3)直接创建索引的脚本里指定...
  • 首先,我是根据这篇博客安装的Docker安装ElasticSearch 但是安装完毕以后创建索引无响应,F12查看发现406错误,原来是请求头的问题,所以要修改head的 Content-Type 设置. 一.进入容器(b93fa4e29ba2为容器ID,请改成自己...
  • Elasticsearch创建索引流程

    千次阅读 2021-01-16 01:21:18
    前言说明:本文章使用的ES版本是:6.7.0由此可知,在ES启动过程中,创建Node对象(new Node(environment))时,初始化了RestHandler,由其名字可以知道这是用来处理Rest请求的。在ES源码中,RestHandlerAction如下图:...
  • ES 创建索引

    2020-03-03 11:36:31
    检查Elasticsearch是否正在运行 : curl http://localhost:9200/ 集群健康 : GET “localhost:9200/_cat/health?v” 查看全部索引 : GET “localhost:9200/_cat/indices?v” 2 : 创建索引 例如创建索引名称 roc_test...
  • 我的版本的8.1.1版本的,是不是版本原因。 我看别人用的7.x版本的成功了,有懂的兄弟指导一下吗
  • ES重建索引 问题描述: 日志数据插入到动态索引中,导致报错 java.lang.IllegalArgumentException: Limit of total fields [1000] in index [track-tech-msee-backend-2021-01] has been exceeded 原因分析: ...
  • Elasticsearch 6创建索引报错: Invalid index name [testDemo], must be lowercase 原因:Elasticsearch 6 默认索引类型是_doc,如果想改变则要指定索引类型 示例: PUT testDemo { "mappings": { ...
  • es通过mapping创建索引出错

    万次阅读 2019-03-16 21:38:48
    最近,我在es创建索引的时候报出奇怪的错误,问题描述大致如下,这个错误后来验证后发现不少同学也遇到过,主要是es版本的差异造成的, Caused by: ElasticsearchException[Elasticsearch exception [type=illegal...
  • 如果elasticsearch删除索引报错 curl -X DELETE 'http://10.73.26.66:9200/httpd-34-2017.08.15' {"error":{"root_cause":[{"type":"illegal_argument_exception","...
  • Elasticsearch版本2.4.1创建索引报错

    千次阅读 2016-10-14 15:21:50
    之前测试了1.7的版本,然后又下载了2.4.1的安装包进行安装。 在java的pom.xml中添加引用:这里写代码片 <groupId>org.elasticsearch <artifactId>elasticsearch <version>2.4.1 然后运
  • 02-ElasticSearch创建索引

    2022-01-11 10:36:32
    02-ElasticSearch创建索引一、数据类型对比二、索引的创建1.创建索引(put请求:127.0.0.1:9200/shopping)2.查询单个索引(get请求:127.0.0.1:9200/shopping)3. 查询所有索引(get请求:127.0.0.1:9200/_cat/indices...
  • 使用elasticsearch创建索引时报错

    千次阅读 2022-04-07 18:05:59
    使用elasticsearch创建索引时报错
  • 文章目录1、elasticsearch插入索引报错2、报错原因3、解决方案 1、elasticsearch插入索引报错 报错内容: { “error”: “Content-Type header [text/plain] is not supported”, “status”: 406 } { “error”: { ...
  • 使用java创建索引库,es7舍弃了InetSocketTransportAddress,需要替换成TransportAddress,另外如果报错NoNodeAvailableException的原因是es的版本不一致,需要保证maven的依赖版本和服务器es版本一致。 es7.x创建...
  • Elasticsearch创建索引别名

    千次阅读 2019-07-09 22:39:52
    es直接报错,严重影响了生产数据的获取。 异常来得总是那么突然,那么,我们要怎样解决这个问题? 数据转移。创建一个新的数据库,并更新其mapping curl -x POST '...
  • 使用idea:javaAPI往公司ES集群批量随机生成索引,用于ES节点的压测,报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 报错情况: org.springframework....
  • 此文转载自:... 大咖揭秘Java人都栽在了哪?...>> 环境:ES 6.2.2 os:Centos 7 ...索引ElasticSearch存放数据的地方,可以理解为关系型数据库中的一个数据库。事实上,...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 15,716
精华内容 6,286
关键字:

es 创建索引报错