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 / 5-2.php

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

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