PluginProbe
ElasticPress / 4.3.0
ElasticPress v4.3.0
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 / 5-2.php

5-2.php in ElasticPress 4.3.0, at includes/mappings/post/5-2.php

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