package com.walker.es.entity;
|
|
import org.dromara.easyes.annotation.HighLight;
|
import org.dromara.easyes.annotation.IndexField;
|
import org.dromara.easyes.annotation.IndexId;
|
import org.dromara.easyes.annotation.IndexName;
|
import org.dromara.easyes.annotation.rely.Analyzer;
|
import org.dromara.easyes.annotation.rely.FieldStrategy;
|
import org.dromara.easyes.annotation.rely.FieldType;
|
import org.dromara.easyes.annotation.rely.IdType;
|
|
@IndexName(value = "walker_document", shardsNum = 3, replicasNum = 2, keepGlobalPrefix = true, maxResultWindow = 100)
|
public class Document {
|
|
public String getId() {
|
return id;
|
}
|
|
public void setId(String id) {
|
this.id = id;
|
}
|
|
public String getTitle() {
|
return title;
|
}
|
|
public void setTitle(String title) {
|
this.title = title;
|
}
|
|
public String getContent() {
|
return content;
|
}
|
|
public void setContent(String content) {
|
this.content = content;
|
}
|
|
public String getCreator() {
|
return creator;
|
}
|
|
public void setCreator(String creator) {
|
this.creator = creator;
|
}
|
|
public String getGmtCreate() {
|
return gmtCreate;
|
}
|
|
public void setGmtCreate(String gmtCreate) {
|
this.gmtCreate = gmtCreate;
|
}
|
|
public String getNotExistsField() {
|
return notExistsField;
|
}
|
|
public void setNotExistsField(String notExistsField) {
|
this.notExistsField = notExistsField;
|
}
|
|
public String getLocation() {
|
return location;
|
}
|
|
public void setLocation(String location) {
|
this.location = location;
|
}
|
|
public String getGeoLocation() {
|
return geoLocation;
|
}
|
|
public void setGeoLocation(String geoLocation) {
|
this.geoLocation = geoLocation;
|
}
|
|
public String getCustomField() {
|
return customField;
|
}
|
|
public void setCustomField(String customField) {
|
this.customField = customField;
|
}
|
|
public String getHighlightContent() {
|
return highlightContent;
|
}
|
|
public void setHighlightContent(String highlightContent) {
|
this.highlightContent = highlightContent;
|
}
|
|
public Integer getStarNum() {
|
return starNum;
|
}
|
|
public void setStarNum(Integer starNum) {
|
this.starNum = starNum;
|
}
|
|
/**
|
* es中的唯一id,如果你想自定义es中的id为你提供的id,比如MySQL中的id,请将注解中的type指定为customize或直接在全局配置文件中指定,如此id便支持任意数据类型)
|
*/
|
@IndexId(type = IdType.CUSTOMIZE)
|
private String id;
|
/**
|
* 文档标题,不指定类型默认被创建为keyword类型,可进行精确查询
|
*/
|
private String title;
|
/**
|
* 文档内容,指定了类型及存储/查询分词器
|
*/
|
@HighLight(mappingField = "highlightContent")
|
@IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART)
|
private String content;
|
/**
|
* 作者 加@TableField注解,并指明strategy = FieldStrategy.NOT_EMPTY 表示更新的时候的策略为 创建者不为空字符串时才更新
|
*/
|
@IndexField(strategy = FieldStrategy.NOT_EMPTY)
|
private String creator;
|
/**
|
* 创建时间
|
*/
|
@IndexField(fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
|
private String gmtCreate;
|
/**
|
* es中实际不存在的字段,但模型中加了,为了不和es映射,可以在此类型字段上加上 注解@TableField,并指明exist=false
|
*/
|
@IndexField(exist = false)
|
private String notExistsField;
|
/**
|
* 地理位置经纬度坐标 例如: "40.13933715136454,116.63441990026217"
|
*/
|
@IndexField(fieldType = FieldType.GEO_POINT)
|
private String location;
|
/**
|
* 图形(例如圆心,矩形)
|
*/
|
@IndexField(fieldType = FieldType.GEO_SHAPE)
|
private String geoLocation;
|
/**
|
* 自定义字段名称
|
*/
|
@IndexField(value = "wu-la", fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_SMART,fieldData = true)
|
private String customField;
|
|
/**
|
* 高亮返回值被映射的字段
|
*/
|
private String highlightContent;
|
/**
|
* 文档点赞数
|
*/
|
private Integer starNum;
|
}
|