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

7-0.php in ElasticPress 4.7.2, at includes/mappings/user/7-0.php

271 lines 7.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 users post ES 7.0
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_user_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 maximum shingle difference
41 *
42 * @hook ep_max_shingle_diff
43 * @param {int} $number Max difference
44 * @return {int} New number
45 */
46 'index.max_shingle_diff' => apply_filters( 'ep_max_shingle_diff', 8 ),
47 /**
48 * Filter Elasticsearch max result window for users
49 *
50 * @hook ep_user_max_result_window
51 * @param {int} $number Size of result window
52 * @return {int} New number
53 */
54 'index.max_result_window' => apply_filters( 'ep_user_max_result_window', 1000000 ),
55 /**
56 * Filter whether Elasticsearch ignores malformed fields or not.
57 *
58 * @hook ep_ignore_malformed
59 * @param {bool} $ignore True for ignore
60 * @return {bool} New value
61 */
62 'index.mapping.ignore_malformed' => apply_filters( 'ep_ignore_malformed', true ),
63 'analysis' => array(
64 'analyzer' => array(
65 'default' => array(
66 'tokenizer' => 'standard',
67 'filter' => array( 'ewp_word_delimiter', 'lowercase', 'ep_stop', 'ewp_snowball' ),
68 /* This filter is documented in includes/mappings/post/7-0.php */
69 'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ),
70 ),
71 'shingle_analyzer' => array(
72 'type' => 'custom',
73 'tokenizer' => 'standard',
74 'filter' => array( 'lowercase', 'shingle_filter' ),
75 ),
76 'ewp_lowercase' => array(
77 'type' => 'custom',
78 'tokenizer' => 'keyword',
79 'filter' => array( 'lowercase' ),
80 ),
81 ),
82 'filter' => array(
83 'shingle_filter' => array(
84 'type' => 'shingle',
85 'min_shingle_size' => 2,
86 'max_shingle_size' => 5,
87 ),
88 'ewp_word_delimiter' => array(
89 'type' => 'word_delimiter_graph',
90 'preserve_original' => true,
91 ),
92 'ewp_snowball' => array(
93 'type' => 'snowball',
94 /* This filter is documented in includes/mappings/post/7-0.php */
95 'language' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ewp_snowball' ),
96 ),
97 'edge_ngram' => array(
98 'side' => 'front',
99 'max_gram' => 10,
100 'min_gram' => 3,
101 'type' => 'edge_ngram',
102 ),
103 'ep_stop' => [
104 'type' => 'stop',
105 'ignore_case' => true,
106 /* This filter is documented in includes/mappings/post/7-0.php */
107 'stopwords' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ep_stop' ),
108 ],
109 ),
110 'normalizer' => array(
111 'lowerasciinormalizer' => array(
112 'type' => 'custom',
113 'filter' => array( 'lowercase', 'asciifolding' ),
114 ),
115 ),
116 ),
117 ),
118 'mappings' => array(
119 'date_detection' => false,
120 'dynamic_templates' => array(
121 array(
122 'template_meta_types' => array(
123 'path_match' => 'meta.*',
124 'mapping' => array(
125 'type' => 'object',
126 'properties' => array(
127 'value' => array(
128 'type' => 'text',
129 'fields' => array(
130 'sortable' => array(
131 'type' => 'keyword',
132 'ignore_above' => 10922,
133 'normalizer' => 'lowerasciinormalizer',
134 ),
135 'raw' => array(
136 'type' => 'keyword',
137 'ignore_above' => 10922,
138 ),
139 ),
140 ),
141 'raw' => array( /* Left for backwards compat */
142 'type' => 'keyword',
143 'ignore_above' => 10922,
144 ),
145 'long' => array(
146 'type' => 'long',
147 ),
148 'double' => array(
149 'type' => 'double',
150 ),
151 'boolean' => array(
152 'type' => 'boolean',
153 ),
154 'date' => array(
155 'type' => 'date',
156 'format' => 'yyyy-MM-dd',
157 ),
158 'datetime' => array(
159 'type' => 'date',
160 'format' => 'yyyy-MM-dd HH:mm:ss',
161 ),
162 'time' => array(
163 'type' => 'date',
164 'format' => 'HH:mm:ss',
165 ),
166 ),
167 ),
168 ),
169 ),
170 array(
171 'template_capabilities' => array(
172 'path_match' => 'capabilities.*',
173 'mapping' => array(
174 'type' => 'object',
175 'properties' => array(
176 'roles' => array(
177 'type' => 'keyword',
178 ),
179 ),
180 ),
181 ),
182 ),
183 ),
184 'properties' => array(
185 'ID' => array(
186 'type' => 'long',
187 ),
188 'user_registered' => array(
189 'type' => 'date',
190 'format' => 'yyyy-MM-dd HH:mm:ss',
191 ),
192 'user_nicename' => array(
193 'type' => 'text',
194 'fields' => array(
195 'user_nicename' => array(
196 'type' => 'text',
197 ),
198 'raw' => array(
199 'type' => 'keyword',
200 'ignore_above' => 10922,
201 ),
202 ),
203 ),
204 'user_login' => array(
205 'type' => 'text',
206 'fields' => array(
207 'user_login' => array(
208 'type' => 'text',
209 ),
210 'raw' => array(
211 'type' => 'keyword',
212 'ignore_above' => 10922,
213 ),
214 ),
215 ),
216 'display_name' => array(
217 'type' => 'text',
218 'fields' => array(
219 'raw' => array(
220 'type' => 'keyword',
221 'ignore_above' => 10922,
222 ),
223 'sortable' => array(
224 'type' => 'keyword',
225 'normalizer' => 'lowerasciinormalizer',
226 ),
227 ),
228 ),
229 'user_email' => array(
230 'type' => 'text',
231 'fields' => array(
232 'user_email' => array(
233 'type' => 'text',
234 ),
235 'raw' => array(
236 'type' => 'keyword',
237 'ignore_above' => 10922,
238 ),
239 ),
240 ),
241 'capabilities' => array(
242 'type' => 'object',
243 ),
244 'user_url' => array(
245 'type' => 'text',
246 'fields' => array(
247 'user_url' => array(
248 'type' => 'text',
249 ),
250 'raw' => array(
251 'type' => 'keyword',
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