PluginProbe
ElasticPress / 4.5.1
ElasticPress v4.5.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 4.5.1, at includes/mappings/post/7-0.php

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