PluginProbe
ElasticPress / 4.4.0
ElasticPress v4.4.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-0.php

5-0.php in ElasticPress 4.4.0, at includes/mappings/post/5-0.php

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