PluginProbe
ElasticPress / 4.6.0
ElasticPress v4.6.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 / pre-5-0.php

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

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