PluginProbe
ElasticPress / 5.0.1
ElasticPress v5.0.1
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 / post / 7-0.php

7-0.php in ElasticPress 5.0.1, at includes/mappings/post/7-0.php

479 lines 12.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 ES 5.2
4 *
5 * @since 2.4
6 * @package elasticpress
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12
13 return array(
14 'settings' => array(
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 posts
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_total_field_limit', 5000 ),
39 /**
40 * Filter whether Elasticsearch ignores malformed fields or not.
41 *
42 * @hook ep_ignore_malformed
43 * @param {bool} $ignore True for ignore
44 * @return {bool} New value
45 */
46 'index.mapping.ignore_malformed' => apply_filters( 'ep_ignore_malformed', true ),
47 /**
48 * Filter Elasticsearch max result window for posts
49 *
50 * @hook ep_max_result_window
51 * @param {int} $number Size of result window
52 * @return {int} New number
53 */
54 'index.max_result_window' => apply_filters( 'ep_max_result_window', 1000000 ),
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' => array(
64 'analyzer' => array(
65 'default' => array(
66 'tokenizer' => 'standard',
67 /**
68 * Filter Elasticsearch default analyzer's filters
69 *
70 * @since 3.6.2
71 * @hook ep_default_analyzer_filters
72 * @param {array<string>} $filters Default filters
73 * @return {array<string>} New filters
74 */
75 'filter' => apply_filters( 'ep_default_analyzer_filters', array( 'lowercase', 'ep_stop', 'ewp_snowball' ) ),
76 /**
77 * Filter Elasticsearch default analyzer's char_filter
78 *
79 * @since 4.2.2
80 * @hook ep_default_analyzer_char_filters
81 * @param {array<string>} $char_filters Default filter
82 * @return {array<string>} New filters
83 */
84 'char_filter' => apply_filters( 'ep_default_analyzer_char_filters', array( 'html_strip' ) ),
85 /**
86 * Filter Elasticsearch default language in mapping
87 *
88 * @hook ep_analyzer_language
89 * @param {string} $lang Default language
90 * @param {string} $lang_context Language context
91 * @return {string} New language
92 */
93 'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
94 ),
95 'default_search' => array(
96 'tokenizer' => 'standard',
97 /**
98 * Filter Elasticsearch default analyzer's filters
99 *
100 * @since 5.0.0
101 * @hook ep_default_search_analyzer_filters
102 * @param {array<string>} $filters Default filters
103 * @return {array<string>} New filters
104 */
105 'filter' => apply_filters( 'ep_default_search_analyzer_filters', array( 'lowercase', 'ep_stop', 'ewp_snowball' ) ),
106 /**
107 * Filter Elasticsearch default analyzer's char_filter
108 *
109 * @since 5.0.0
110 * @hook ep_default_search_analyzer_char_filters
111 * @param {array<string>} $char_filters Default filter
112 * @return {array<string>} New filters
113 */
114 'char_filter' => apply_filters( 'ep_default_search_analyzer_char_filters', array( 'html_strip' ) ),
115 /* This filter is documented above */
116 'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
117 ),
118 'shingle_analyzer' => array(
119 'type' => 'custom',
120 'tokenizer' => 'standard',
121 'filter' => array( 'lowercase', 'shingle_filter' ),
122 ),
123 'ewp_lowercase' => array(
124 'type' => 'custom',
125 'tokenizer' => 'keyword',
126 'filter' => array( 'lowercase' ),
127 ),
128 ),
129 'filter' => array(
130 'shingle_filter' => array(
131 'type' => 'shingle',
132 'min_shingle_size' => 2,
133 'max_shingle_size' => 5,
134 ),
135 'ewp_snowball' => array(
136 'type' => 'snowball',
137 /* This filter is documented in includes/mappings/post/7-0.php */
138 'language' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ewp_snowball' ),
139 ),
140 'edge_ngram' => array(
141 'side' => 'front',
142 'max_gram' => 10,
143 'min_gram' => 3,
144 'type' => 'edge_ngram',
145 ),
146 'ep_stop' => [
147 'type' => 'stop',
148 'ignore_case' => true,
149 /* This filter is documented in includes/mappings/post/7-0.php */
150 'stopwords' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ep_stop' ),
151 ],
152 ),
153 'normalizer' => array(
154 'lowerasciinormalizer' => array(
155 'type' => 'custom',
156 'filter' => array( 'lowercase', 'asciifolding' ),
157 ),
158 ),
159 ),
160 ),
161 'mappings' => array(
162 '_meta' => array(
163 'mapping_version' => '7-0.php',
164 ),
165 'date_detection' => false,
166 'dynamic_templates' => array(
167 array(
168 'template_meta' => array(
169 'path_match' => 'post_meta.*',
170 'mapping' => array(
171 'type' => 'text',
172 'fields' => array(
173 '{name}' => array(
174 'type' => 'text',
175 ),
176 'raw' => array(
177 'type' => 'keyword',
178 'ignore_above' => 10922,
179 ),
180 ),
181 ),
182 ),
183 ),
184 array(
185 'template_meta_types' => array(
186 'path_match' => 'meta.*',
187 'mapping' => array(
188 'type' => 'object',
189 'properties' => array(
190 'value' => array(
191 'type' => 'text',
192 'fields' => array(
193 'sortable' => array(
194 'type' => 'keyword',
195 'ignore_above' => 10922,
196 'normalizer' => 'lowerasciinormalizer',
197 ),
198 'raw' => array(
199 'type' => 'keyword',
200 'ignore_above' => 10922,
201 ),
202 ),
203 ),
204 'raw' => array( /* Left for backwards compat */
205 'type' => 'keyword',
206 'ignore_above' => 10922,
207 ),
208 'long' => array(
209 'type' => 'long',
210 ),
211 'double' => array(
212 'type' => 'double',
213 ),
214 'boolean' => array(
215 'type' => 'boolean',
216 ),
217 'date' => array(
218 'type' => 'date',
219 'format' => 'yyyy-MM-dd',
220 ),
221 'datetime' => array(
222 'type' => 'date',
223 'format' => 'yyyy-MM-dd HH:mm:ss',
224 ),
225 'time' => array(
226 'type' => 'date',
227 'format' => 'HH:mm:ss',
228 ),
229 ),
230 ),
231 ),
232 ),
233 array(
234 'template_terms' => array(
235 'path_match' => 'terms.*',
236 'mapping' => array(
237 'type' => 'object',
238 'properties' => array(
239 'name' => array(
240 'type' => 'text',
241 'fields' => array(
242 'raw' => array(
243 'type' => 'keyword',
244 ),
245 'sortable' => array(
246 'type' => 'keyword',
247 'normalizer' => 'lowerasciinormalizer',
248 ),
249 ),
250 ),
251 'term_id' => array(
252 'type' => 'long',
253 ),
254 'term_taxonomy_id' => array(
255 'type' => 'long',
256 ),
257 'parent' => array(
258 'type' => 'long',
259 ),
260 'slug' => array(
261 'type' => 'keyword',
262 ),
263 'facet' => array(
264 'type' => 'keyword',
265 ),
266 'term_order' => array(
267 'type' => 'long',
268 ),
269 ),
270 ),
271 ),
272 ),
273 array(
274 'term_suggest' => array(
275 'path_match' => 'term_suggest_*',
276 'mapping' => array(
277 'type' => 'completion',
278 'analyzer' => 'default',
279 ),
280 ),
281 ),
282 ),
283 'properties' => array(
284 'post_id' => array(
285 'type' => 'long',
286 ),
287 'ID' => array(
288 'type' => 'long',
289 ),
290 'post_author' => array(
291 'type' => 'object',
292 'properties' => array(
293 'display_name' => array(
294 'type' => 'text',
295 'fields' => array(
296 'raw' => array(
297 'type' => 'keyword',
298 ),
299 'sortable' => array(
300 'type' => 'keyword',
301 'normalizer' => 'lowerasciinormalizer',
302 ),
303 ),
304 ),
305 'login' => array(
306 'type' => 'text',
307 'fields' => array(
308 'raw' => array(
309 'type' => 'keyword',
310 ),
311 'sortable' => array(
312 'type' => 'keyword',
313 'normalizer' => 'lowerasciinormalizer',
314 ),
315 ),
316 ),
317 'id' => array(
318 'type' => 'long',
319 ),
320 'raw' => array(
321 'type' => 'keyword',
322 ),
323 ),
324 ),
325 'post_date' => array(
326 'type' => 'date',
327 'format' => 'yyyy-MM-dd HH:mm:ss',
328 ),
329 'post_date_gmt' => array(
330 'type' => 'date',
331 'format' => 'yyyy-MM-dd HH:mm:ss',
332 ),
333 'post_title' => array(
334 'type' => 'text',
335 'fields' => array(
336 'post_title' => array(
337 'type' => 'text',
338 'analyzer' => 'standard',
339 ),
340 'raw' => array(
341 'type' => 'keyword',
342 'ignore_above' => 10922,
343 ),
344 'sortable' => array(
345 'type' => 'keyword',
346 'ignore_above' => 10922,
347 'normalizer' => 'lowerasciinormalizer',
348 ),
349 ),
350 ),
351 'post_excerpt' => array(
352 'type' => 'text',
353 ),
354 'post_password' => array(
355 'type' => 'text',
356 ),
357 'post_content' => array(
358 'type' => 'text',
359 ),
360 'post_content_filtered' => array(
361 'type' => 'text',
362 ),
363 'post_status' => array(
364 'type' => 'keyword',
365 ),
366 'post_name' => array(
367 'type' => 'text',
368 'fields' => array(
369 'post_name' => array(
370 'type' => 'text',
371 ),
372 'raw' => array(
373 'type' => 'keyword',
374 'ignore_above' => 10922,
375 ),
376 ),
377 ),
378 'post_modified' => array(
379 'type' => 'date',
380 'format' => 'yyyy-MM-dd HH:mm:ss',
381 ),
382 'post_modified_gmt' => array(
383 'type' => 'date',
384 'format' => 'yyyy-MM-dd HH:mm:ss',
385 ),
386 'post_parent' => array(
387 'type' => 'long',
388 ),
389 'post_type' => array(
390 'type' => 'text',
391 'fields' => array(
392 'post_type' => array(
393 'type' => 'text',
394 ),
395 'raw' => array(
396 'type' => 'keyword',
397 ),
398 ),
399 ),
400 'post_mime_type' => array(
401 'type' => 'keyword',
402 ),
403 'permalink' => array(
404 'type' => 'keyword',
405 ),
406 'guid' => array(
407 'type' => 'keyword',
408 ),
409 'terms' => array(
410 'type' => 'object',
411 ),
412 'post_meta' => array(
413 'type' => 'object',
414 ),
415 'meta' => array(
416 'type' => 'object',
417 ),
418 'date_terms' => array(
419 'type' => 'object',
420 'properties' => array(
421 'year' => array( // 4 digit year (e.g. 2011).
422 'type' => 'integer',
423 ),
424 'month' => array( // Month number (from 1 to 12) alternate name 'monthnum'.
425 'type' => 'integer',
426 ),
427 'm' => array( // YearMonth (For e.g.: 201307).
428 'type' => 'integer',
429 ),
430 'week' => array( // Week of the year (from 0 to 53) alternate name 'w'.
431 'type' => 'integer',
432 ),
433 'day' => array( // Day of the month (from 1 to 31).
434 'type' => 'integer',
435 ),
436 'dayofweek' => array( // Accepts numbers 1-7 (1 is Sunday).
437 'type' => 'integer',
438 ),
439 'dayofweek_iso' => array( // Accepts numbers 1-7 (1 is Monday).
440 'type' => 'integer',
441 ),
442 'dayofyear' => array( // Accepts numbers 1-366.
443 'type' => 'integer',
444 ),
445 'hour' => array( // Hour (from 0 to 23).
446 'type' => 'integer',
447 ),
448 'minute' => array( // Minute (from 0 to 59).
449 'type' => 'integer',
450 ),
451 'second' => array( // Second (0 to 59).
452 'type' => 'integer',
453 ),
454 ),
455 ),
456 'thumbnail' => array(
457 'type' => 'object',
458 'properties' => array(
459 'ID' => array(
460 'type' => 'long',
461 ),
462 'src' => array(
463 'type' => 'text',
464 ),
465 'width' => array(
466 'type' => 'integer',
467 ),
468 'height' => array(
469 'type' => 'integer',
470 ),
471 'alt' => array(
472 'type' => 'text',
473 ),
474 ),
475 ),
476 ),
477 ),
478 );
479