Merge "API: Allow anonymous CORS from anywhere, when specifically requested"
[lhc/web/wiklou.git] / includes / search / SearchIndexField.php
1 <?php
2 /**
3 * Definition of a mapping for the search index field.
4 * @since 1.28
5 */
6 interface SearchIndexField {
7 /**
8 * Field types
9 */
10 const INDEX_TYPE_TEXT = 0;
11 const INDEX_TYPE_KEYWORD = 1;
12 const INDEX_TYPE_INTEGER = 2;
13 const INDEX_TYPE_NUMBER = 3;
14 const INDEX_TYPE_DATETIME = 4;
15 const INDEX_TYPE_NESTED = 5;
16 const INDEX_TYPE_BOOL = 6;
17 /**
18 * Generic field flags.
19 */
20 /**
21 * This field is case-insensitive.
22 */
23 const FLAG_CASEFOLD = 1;
24 /**
25 * This field is for scoring only.
26 */
27 const FLAG_SCORING = 2;
28 /**
29 * This field does not need highlight handling.
30 */
31 const FLAG_NO_HIGHLIGHT = 4;
32 /**
33 * Do not index this field.
34 */
35 const FLAG_NO_INDEX = 8;
36 /**
37 * Get mapping for specific search engine
38 * @param SearchEngine $engine
39 * @return array|null Null means this field does not map to anything
40 */
41 public function getMapping( SearchEngine $engine );
42 /**
43 * Set global flag for this field.
44 *
45 * @param int $flag Bit flag to set/unset
46 * @param bool $unset True if flag should be unset, false by default
47 * @return $this
48 */
49 public function setFlag( $flag, $unset = false );
50 /**
51 * Check if flag is set.
52 * @param $flag
53 * @return int 0 if unset, !=0 if set
54 */
55 public function checkFlag( $flag );
56 /**
57 * Merge two field definitions if possible.
58 *
59 * @param SearchIndexField $that
60 * @return SearchIndexField|false New definition or false if not mergeable.
61 */
62 public function merge( SearchIndexField $that );
63 }