PluginProbe
ElasticPress / 4.2.2
ElasticPress v4.2.2
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 / user / pre-5-0.php

pre-5-0.php in ElasticPress 4.2.2, at includes/mappings/user/pre-5-0.php

272 lines 6.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 users
4 *
5 * @since 3.0
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 users
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_user_total_field_limit', 5000 ),
39 /**
40 * Filter Elasticsearch max result window for users
41 *
42 * @hook ep_user_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_user_max_result_window', 1000000 ),
47 'analysis' => array(
48 'analyzer' => array(
49 'default' => array(
50 'tokenizer' => 'standard',
51 'filter' => array( 'standard', 'ewp_word_delimiter', 'lowercase', 'stop', 'ewp_snowball' ),
52 /**
53 * Filter Elasticsearch default language in mapping
54 *
55 * @hook ep_analyzer_language
56 * @param {string} $lang Default language
57 * @param {string} $lang_context Language context
58 * @return {string} New language
59 */
60 'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
61 ),
62 'shingle_analyzer' => array(
63 'type' => 'custom',
64 'tokenizer' => 'standard',
65 'filter' => array( 'lowercase', 'shingle_filter' ),
66 ),
67 'ewp_lowercase' => array(
68 'type' => 'custom',
69 'tokenizer' => 'keyword',
70 'filter' => array( 'lowercase' ),
71 ),
72 ),
73 'filter' => array(
74 'shingle_filter' => array(
75 'type' => 'shingle',
76 'min_shingle_size' => 2,
77 'max_shingle_size' => 5,
78 ),
79 'ewp_word_delimiter' => array(
80 'type' => 'word_delimiter',
81 'preserve_original' => true,
82 ),
83 'ewp_snowball' => array(
84 'type' => 'snowball',
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', 'filter_ewp_snowball' ),
94 ),
95 'edge_ngram' => array(
96 'side' => 'front',
97 'max_gram' => 10,
98 'min_gram' => 3,
99 'type' => 'edgeNGram',
100 ),
101 ),
102 'normalizer' => array(
103 'lowerasciinormalizer' => array(
104 'type' => 'custom',
105 'filter' => array( 'lowercase', 'asciifolding' ),
106 ),
107 ),
108 ),
109 ),
110 'mappings' => array(
111 'user' => array(
112 'date_detection' => false,
113 'dynamic_templates' => array(
114 array(
115 'template_meta_types' => array(
116 'path_match' => 'meta.*',
117 'mapping' => array(
118 'type' => 'object',
119 'path' => 'full',
120 'properties' => array(
121 'value' => array(
122 'type' => 'string',
123 'fields' => array(
124 'sortable' => array(
125 'type' => 'string',
126 'ignore_above' => 10922,
127 'normalizer' => 'lowerasciinormalizer',
128 ),
129 'raw' => array(
130 'type' => 'string',
131 'ignore_above' => 10922,
132 ),
133 ),
134 ),
135 'raw' => array( /* Left for backwards compat */
136 'type' => 'string',
137 'ignore_above' => 10922,
138 ),
139 'long' => array(
140 'type' => 'long',
141 ),
142 'double' => array(
143 'type' => 'double',
144 ),
145 'boolean' => array(
146 'type' => 'boolean',
147 ),
148 'date' => array(
149 'type' => 'date',
150 'format' => 'yyyy-MM-dd',
151 ),
152 'datetime' => array(
153 'type' => 'date',
154 'format' => 'yyyy-MM-dd HH:mm:ss',
155 ),
156 'time' => array(
157 'type' => 'date',
158 'format' => 'HH:mm:ss',
159 ),
160 ),
161 ),
162 ),
163 ),
164 array(
165 'template_capabilities' => array(
166 'path_match' => 'capabilities.*',
167 'mapping' => array(
168 'type' => 'object',
169 'path' => 'full',
170 'properties' => array(
171 'roles' => array(
172 'type' => 'string',
173 ),
174 ),
175 ),
176 ),
177 ),
178 ),
179 '_all' => array(
180 'analyzer' => 'simple',
181 ),
182 'properties' => array(
183 'ID' => array(
184 'type' => 'long',
185 ),
186 'user_registered' => array(
187 'type' => 'date',
188 'format' => 'YYYY-MM-dd HH:mm:ss',
189 ),
190 'user_nicename' => array(
191 'type' => 'string',
192 'fields' => array(
193 'user_nicename' => array(
194 'type' => 'string',
195 ),
196 'raw' => array(
197 'type' => 'string',
198 'ignore_above' => 10922,
199 ),
200 ),
201 ),
202 'user_login' => array(
203 'type' => 'string',
204 'fields' => array(
205 'user_login' => array(
206 'type' => 'string',
207 ),
208 'raw' => array(
209 'type' => 'string',
210 'ignore_above' => 10922,
211 ),
212 ),
213 ),
214 'display_name' => array(
215 'type' => 'string',
216 'fields' => array(
217 'raw' => array(
218 'type' => 'string',
219 'index' => 'not_analyzed',
220 'ignore_above' => 10922,
221 ),
222 'sortable' => array(
223 'type' => 'string',
224 'index' => 'not_analyzed',
225 'analyzer' => 'ewp_lowercase',
226 ),
227 ),
228 ),
229 'user_email' => array(
230 'type' => 'string',
231 'fields' => array(
232 'user_email' => array(
233 'type' => 'string',
234 ),
235 'raw' => array(
236 'type' => 'string',
237 'ignore_above' => 10922,
238 ),
239 ),
240 ),
241 'capabilities' => array(
242 'type' => 'object',
243 ),
244 'user_url' => array(
245 'type' => 'string',
246 'fields' => array(
247 'user_url' => array(
248 'type' => 'string',
249 ),
250 'raw' => array(
251 'type' => 'string',
252 'ignore_above' => 10922,
253 ),
254 ),
255 ),
256 'status' => array(
257 'type' => 'long',
258 ),
259 'spam' => array(
260 'type' => 'long',
261 ),
262 'deleted' => array(
263 'type' => 'long',
264 ),
265 'meta' => array(
266 'type' => 'object',
267 ),
268 ),
269 ),
270 ),
271 );
272