技术标签: Elasticsearch elasticsearch mapper springboot
说来惭愧,这本是一个不应该出现的错误:
pojo类中的部分代码:让composeGoodName使用ik分词器。
@Document(indexName = "seasonal",type = "escomposegood", shards = 4, replicas = 0)
public class ESComposeGood {
@Id
private Long id;
@Field(type = FieldType.Text,analyzer = "ik_max_word")
private String composeGoodName;
@Field(type = FieldType.Integer)
private Integer composeGoodPrice;
@Field(type = FieldType.Long)
private Long composeGoodType;
@Field(type = FieldType.Integer)
private Integer composeGoodStatus;
@Field(type = FieldType.Integer)
private Integer composeGoodWeight;
@Field(type = FieldType.Keyword)
private String composeGoodIcon;
@Field(type = FieldType.Integer)
private Integer composeGoodSales;
}
意外发生了,程序跑不起来了,他告诉我:
[mapper [composeGoodName] has different [analyzer]]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcConversionService' defined in class path resource
[org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method 'mvcConversionService' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ESComposeGoodResitory': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]: Constructor threw exception; nested exception is
java.lang.IllegalArgumentException:
Mapper for [composeGoodName] conflicts with existing mapping in other types:(这句才是错误的核心)
一番查找后发现如果在使用分词器之前将数据插入了Elasticsearch那么就会发生Elasticsearch无法解析的问题,也就是上述错误所以说:
解决方案:
在向Elasticsearch中插入数据之前就要给需要的进行分词的属性标记好解析,然后再插入数据即可解决问题!
EurekaInstanceConfig & EurekaClientConfigInstance 是实例的意思, EurekaInstanceConfig 就是 eureka client 的配置文件中的服务实例信息。 EurekaInstanceConfig instanceConfig = isCloud(ConfigurationManager.getDeploymentContext()) ? new CloudInstanceConfig
Oracle的jdbc驱动三种主要分类:1、JDBC OCI: oci是oracle call interface的缩写,此驱动类似于传统的ODBC 驱动。因为它需要Oracle Call Interface and Net8,所以它需要在运行使用此驱动的JAVA程序的机器上安装客户端软件,其实主要是用到orcale客户端里以dll方式提供的oci和服务器配置。2、JDBC Thin: thin是...
1、对于Linux驱动开发来说,设备模型的理解是根本,顾名思义设备模型是关于设备的模型,设备的概念就是总线和与其相连的各种设备了。总线、设备、驱动,也就是bus、device、driver,在内核里都会有它们自己专属的结构,在include/linux/device.h里定义。首先是总线,bus_type.struct bus_type {constchar*name;--总线名structb...
iOS App Security and Analysis: Part 1/2http://www.raywenderlich.com/45645/ios-app-security-analysis-part-1
移植到android:-------------------------分割线 这部分只要开始做一次就OK了--------------------------------------------------------- 安装cygwin--用于交叉编译c++代码成.so修改主文件夹下cocos2dx文件夹里的Android.mk文件LOCAL_CFLAGS := -DUSE_FILE32AP...
1.GCC简介GCC(GNU Compiler Collection)是一套功能强大、性能优越的编程语言编译器,它是GNU计划的代表作品之一。GCC是Linux平台下最常用的编译器,GCC原名为GNU C Compiler,即GNU C语言编译器,随着GCC支持的语言越来越多,它的名称也逐渐变成了GNU Compiler Collection。下面对GCC的基本使用方法进行介绍。2.GCC...
搭建SpringCloud项目六(Config)配置中心动态刷新
我有以下单个HTML文件(包括样式/脚本):FQ.html我有以下问题:我已经迭代了解决方案尝试,最新的尝试有以下一些CSS [email protected] print{@page {size:1080px 1080px;margin: 0px;}.page-break-before { page-break-before: always; display:block; width:200%;}.pa...
按order_num分组取时间最早的(LAST_UPDATE_DATE asc),若要取最晚的改为descselect ORDER_NUM,LAST_UPDATE_DATE,OPERATOR,rank from(select t.ORDER_NUM,t.LAST_UPDATE_DATE,t.OPERATOR,@rownum:[email protected]+1 ,if(@order_num=t.ORDER_NUM...
这样就好了,应该是focus方法是个异步的 target.focus(); //target:dom节点 this.$nextTick(() => { target.setSelectionRange(2, 5); });
4 嵌入式Web 监控的实现嵌入式Web 监控的实现包括了Boa 服务器移植、CGI 网页交互程序设计两个部分。4. 1 Boa 服务器移植在嵌入式远程监控系统中,Web 服务器的性能对系统的整体性能具有直接影响,因此Web 服务器的选择和设计尤为重要。高效率的Web 服务器,才能使监控系统的能得到充分的发挥。Boa 是一款单任务的HTTP 服务器,它支持CGI 技术,且具有自动生成目录和解压文件...
路径:‘pages/personal/hand/hand’点击某个专业队时需要实现直接切换账户并登陆成功跳转到首页:pages/project-maintenance/duty-manage/duty-preview;跳转时使用使用浏览器运行会报错:需换用:uni.redirectTo(OBJECT)关闭当前页面,跳转到应用内的某个页面。OBJECT参数说明参数 类型 必填 说明url Strin...