PluginProbe
ElasticPress / 5.3.5
ElasticPress v5.3.5
5.3.5 5.3.4 3.6.5 3.6.6 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 5.0.0 5.0.1 5.0.2 All 108 releases
elasticpress / includes / mappings / comment / 7-0.php

7-0.php in ElasticPress 5.3.5, at includes/mappings/comment/7-0.php

341 lines 8.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elasticsearch mapping for comments
4 *
5 * @since 3.6.0
6 * @package elasticpress
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12
13 return [
14 'settings' => [
15 /**
16 * Filter number of Elasticsearch shards to use in indices
17 *
18 * @hook ep_default_index_number_of_shards
19 * @param {int} $shards Number of shards
20 * @return {int} New number
21 */
22 'index.number_of_shards' => apply_filters( 'ep_default_index_number_of_shards', 5 ),
23 /**
24 * Filter number of Elasticsearch replicas to use in indices
25 *
26 * @hook ep_default_index_number_of_replicas
27 * @param {int} $replicas Number of replicas
28 * @return {int} New number
29 */
30 'index.number_of_replicas' => apply_filters( 'ep_default_index_number_of_replicas', 1 ),
31 /**
32 * Filter Elasticsearch total field limit for users
33 *
34 * @hook ep_total_field_limit
35 * @param {int} $number Number of fields
36 * @return {int} New number
37 */
38 'index.mapping.total_fields.limit' => apply_filters( 'ep_comment_total_field_limit', 5000 ),
39 /**
40 * Filter Elasticsearch max result window for users
41 *
42 * @hook ep_user_max_result_window
43 * @param {int} $number Size of result window
44 * @return {int} New number
45 */
46 'index.max_result_window' => apply_filters( 'ep_comment_max_result_window', 1000000 ),
47 /**
48 * Filter whether Elasticsearch ignores malformed fields or not.
49 *
50 * @hook ep_ignore_malformed
51 * @param {bool} $ignore True for ignore
52 * @return {bool} New value
53 */
54 'index.mapping.ignore_malformed' => apply_filters( 'ep_ignore_malformed', true ),
55 /**
56 * Filter Elasticsearch maximum shingle difference
57 *
58 * @hook ep_max_shingle_diff
59 * @param {int} $number Max difference
60 * @return {int} New number
61 */
62 'index.max_shingle_diff' => apply_filters( 'ep_max_shingle_diff', 8 ),
63 'analysis' => [
64 'analyzer' => [
65 'default' => [
66 'tokenizer' => 'standard',
67 /* This filter is documented in includes/mappings/post/7-0.php */
68 'filter' => apply_filters( 'ep_default_analyzer_filters', [ 'lowercase', 'ep_stop', 'ewp_snowball', 'ep_asciifolding' ] ),
69 /* This filter is documented in includes/mappings/post/7-0.php */
70 'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
71 ],
72 'default_search' => [
73 'tokenizer' => 'standard',
74 /* This filter is documented in includes/mappings/post/7-0.php */
75 'filter' => apply_filters( 'ep_default_search_analyzer_filters', [ 'lowercase', 'ep_stop', 'ewp_snowball', 'ep_asciifolding' ] ),
76 /* This filter is documented in includes/mappings/post/7-0.php */
77 'char_filter' => apply_filters( 'ep_default_search_analyzer_char_filters', [ 'html_strip' ] ),
78 /* This filter is documented above */
79 'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
80 ],
81 'shingle_analyzer' => [
82 'type' => 'custom',
83 'tokenizer' => 'standard',
84 'filter' => [ 'lowercase', 'shingle_filter' ],
85 ],
86 'ewp_lowercase' => [
87 'type' => 'custom',
88 'tokenizer' => 'keyword',
89 'filter' => [ 'lowercase' ],
90 ],
91 ],
92 'filter' => [
93 'shingle_filter' => [
94 'type' => 'shingle',
95 'min_shingle_size' => 2,
96 'max_shingle_size' => 5,
97 ],
98 'ewp_snowball' => [
99 'type' => 'snowball',
100 /* This filter is documented in includes/mappings/post/7-0.php */
101 'language' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ewp_snowball' ),
102 ],
103 'edge_ngram' => [
104 'max_gram' => 10,
105 'min_gram' => 3,
106 'type' => 'edge_ngram',
107 ],
108 'ep_stop' => [
109 'type' => 'stop',
110 'ignore_case' => true,
111 /* This filter is documented in includes/mappings/post/7-0.php */
112 'stopwords' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ep_stop' ),
113 ],
114 'ep_asciifolding' => [
115 'type' => 'asciifolding',
116 'preserve_original' => true,
117 ],
118 ],
119 'normalizer' => [
120 'lowerasciinormalizer' => [
121 'type' => 'custom',
122 'filter' => [ 'lowercase', 'asciifolding' ],
123 ],
124 ],
125 ],
126 ],
127 'mappings' => [
128 'date_detection' => false,
129 'dynamic_templates' => [
130 [
131 'template_meta_types' => [
132 'path_match' => 'meta.*',
133 'mapping' => [
134 'type' => 'object',
135 'properties' => [
136 'value' => [
137 'type' => 'text',
138 'fields' => [
139 'sortable' => [
140 'type' => 'keyword',
141 'ignore_above' => 10922,
142 'normalizer' => 'lowerasciinormalizer',
143 ],
144 'raw' => [
145 'type' => 'keyword',
146 'ignore_above' => 10922,
147 ],
148 ],
149 ],
150 'raw' => [ /* Left for backwards compat */
151 'type' => 'keyword',
152 'ignore_above' => 10922,
153 ],
154 'long' => [
155 'type' => 'long',
156 ],
157 'double' => [
158 'type' => 'double',
159 ],
160 'boolean' => [
161 'type' => 'boolean',
162 ],
163 'date' => [
164 'type' => 'date',
165 'format' => 'yyyy-MM-dd',
166 ],
167 'datetime' => [
168 'type' => 'date',
169 'format' => 'yyyy-MM-dd HH:mm:ss',
170 ],
171 'time' => [
172 'type' => 'date',
173 'format' => 'HH:mm:ss',
174 ],
175 ],
176 ],
177 ],
178 ],
179 ],
180 'properties' => [
181 'comment_ID' => [
182 'type' => 'long',
183 ],
184 'ID' => [
185 'type' => 'long',
186 ],
187 'comment_post_ID' => [
188 'type' => 'long',
189 ],
190 'comment_post_author_ID' => [
191 'type' => 'long',
192 ],
193 'comment_post_status' => [
194 'type' => 'keyword',
195 ],
196 'comment_post_type' => [
197 'type' => 'text',
198 'fields' => [
199 'comment_post_type' => [
200 'type' => 'text',
201 ],
202 'raw' => [
203 'type' => 'keyword',
204 ],
205 ],
206 ],
207 'comment_post_name' => [
208 'type' => 'text',
209 'fields' => [
210 'comment_post_name' => [
211 'type' => 'text',
212 ],
213 'raw' => [
214 'type' => 'keyword',
215 'ignore_above' => 10922,
216 ],
217 ],
218 ],
219 'comment_post_parent' => [
220 'type' => 'long',
221 ],
222 'comment_author' => [
223 'type' => 'text',
224 'fields' => [
225 'comment_author' => [
226 'type' => 'text',
227 ],
228 'raw' => [
229 'type' => 'keyword',
230 'ignore_above' => 10922,
231 ],
232 ],
233 ],
234 'comment_author_email' => [
235 'type' => 'text',
236 'fields' => [
237 'comment_author_email' => [
238 'type' => 'text',
239 ],
240 'raw' => [
241 'type' => 'keyword',
242 'ignore_above' => 10922,
243 ],
244 ],
245 ],
246 'comment_author_url' => [
247 'type' => 'text',
248 'fields' => [
249 'comment_author_url' => [
250 'type' => 'text',
251 ],
252 'raw' => [
253 'type' => 'keyword',
254 'ignore_above' => 10922,
255 ],
256 ],
257 ],
258 'comment_author_IP' => [
259 'type' => 'text',
260 'fields' => [
261 'comment_author_IP' => [
262 'type' => 'text',
263 ],
264 'raw' => [
265 'type' => 'keyword',
266 'ignore_above' => 10922,
267 ],
268 ],
269 ],
270 'comment_date' => [
271 'type' => 'date',
272 'format' => 'yyyy-MM-dd HH:mm:ss',
273 ],
274 'comment_date_gmt' => [
275 'type' => 'date',
276 'format' => 'yyyy-MM-dd HH:mm:ss',
277 ],
278 'comment_content' => [
279 'type' => 'text',
280 'fields' => [
281 'comment_content' => [
282 'type' => 'text',
283 ],
284 'raw' => [
285 'type' => 'keyword',
286 'ignore_above' => 10922,
287 ],
288 ],
289 ],
290 'comment_karma' => [
291 'type' => 'long',
292 ],
293 'comment_approved' => [
294 'type' => 'text',
295 'fields' => [
296 'comment_approved' => [
297 'type' => 'text',
298 ],
299 'raw' => [
300 'type' => 'keyword',
301 'ignore_above' => 10922,
302 ],
303 ],
304 ],
305 'comment_agent' => [
306 'type' => 'text',
307 'fields' => [
308 'comment_agent' => [
309 'type' => 'text',
310 ],
311 'raw' => [
312 'type' => 'keyword',
313 'ignore_above' => 10922,
314 ],
315 ],
316 ],
317 'comment_type' => [
318 'type' => 'text',
319 'fields' => [
320 'comment_type' => [
321 'type' => 'text',
322 ],
323 'raw' => [
324 'type' => 'keyword',
325 'ignore_above' => 10922,
326 ],
327 ],
328 ],
329 'comment_parent' => [
330 'type' => 'long',
331 ],
332 'user_id' => [
333 'type' => 'long',
334 ],
335 'meta' => [
336 'type' => 'object',
337 ],
338 ],
339 ],
340 ];
341