package com.walker.support.es.so;
|
|
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;
|
|
/**
|
* 文件索引对象
|
*
|
* @author 时克英
|
* @date 2017年4月22日
|
*/
|
//@Document(indexName = "db", type = "attachment")
|
@Document(indexName = "db")
|
public class Attachment extends BaseSearchObject {
|
// 唯一编号
|
@Id
|
@Field(type = FieldType.Text, index = false, store = true)
|
private String id;
|
|
// 文件内容
|
@Field(type = FieldType.Text, analyzer = "ik", searchAnalyzer = "ik")
|
private String content;
|
|
// 文件标题
|
@Field(type = FieldType.Text, analyzer = "ik", searchAnalyzer = "ik")
|
private String title;
|
|
// 文件最后修改日期
|
@Field(type = FieldType.Long, index = false)
|
private Long date;
|
|
// 文件路径
|
@Field(type = FieldType.Text, index = false)
|
private String path;
|
|
// 文件类型
|
@Field(type = FieldType.Text, index = false)
|
private String content_type;
|
|
// 文件长度
|
@Field(type = FieldType.Long, index = false)
|
private long content_length;
|
|
/**
|
* 获取唯一编号
|
*
|
* @return 唯一编号
|
*/
|
@Override
|
public String getId() {
|
return id;
|
}
|
|
/**
|
* 设置唯一编号
|
*
|
* @param id 唯一编号
|
*/
|
public void setId(String id) {
|
this.id = id;
|
}
|
|
/**
|
* 获取文件内容
|
*
|
* @return 文件内容
|
*/
|
public String getContent() {
|
return content;
|
}
|
|
/**
|
* 设置文件内容
|
*
|
* @param content 文件内容
|
*/
|
public void setContent(String content) {
|
this.content = content;
|
}
|
|
/**
|
* 获取文件标题
|
*
|
* @return 文件标题
|
*/
|
public String getTitle() {
|
return title;
|
}
|
|
/**
|
* 设置文件标题
|
*
|
* @param title 文件标题
|
*/
|
public void setTitle(String title) {
|
this.title = title;
|
}
|
|
/**
|
* 获取文件最后修改日期
|
*
|
* @return 文件最后修改日期
|
*/
|
public Long getDate() {
|
return date;
|
}
|
|
/**
|
* 设置文件最后修改日期
|
*
|
* @param date 文件最后修改日期
|
*/
|
public void setDate(Long date) {
|
this.date = date;
|
}
|
|
/**
|
* 获取文件路径
|
*
|
* @return 文件路径
|
*/
|
public String getPath() {
|
return path;
|
}
|
|
/**
|
* 设置文件路径
|
*
|
* @param path 文件路径
|
*/
|
public void setPath(String path) {
|
this.path = path;
|
}
|
|
/**
|
* 获取文件类型
|
*
|
* @return 文件类型
|
*/
|
public String getContent_type() {
|
return content_type;
|
}
|
|
/**
|
* 设置文件类型
|
*
|
* @param content_type 文件类型
|
*/
|
public void setContent_type(String content_type) {
|
this.content_type = content_type;
|
}
|
|
/**
|
* 获取文件长度
|
*
|
* @return 文件长度
|
*/
|
public long getContent_length() {
|
return content_length;
|
}
|
|
/**
|
* 设置文件长度
|
*
|
* @param content_length 文件长度
|
*/
|
public void setContent_length(long content_length) {
|
this.content_length = content_length;
|
}
|
|
}
|