shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
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;
    }
 
}