Merge "Move bottomScripts() call in SkinTemplate"
[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 contains secondary information, which is
26 * already present in other fields, but can be used for
27 * scoring.
28 */
29 const FLAG_SCORING = 2;
30 /**
31 * This field does not need highlight handling.
32 */
33 const FLAG_NO_HIGHLIGHT = 4;
34 /**
35 * Do not index this field, just store it.
36 */
37 const FLAG_NO_INDEX = 8;
38 /**
39 * Get mapping for specific search engine
40 * @param SearchEngine $engine
41 * @return array|null Null means this field does not map to anything
42 */
43 public function getMapping( SearchEngine $engine );
44 /**
45 * Set global flag for this field.
46 *
47 * @param int $flag Bit flag to set/unset
48 * @param bool $unset True if flag should be unset, false by default
49 * @return $this
50 */
51 public function setFlag( $flag, $unset = false );
52 /**
53 * Check if flag is set.
54 * @param $flag
55 * @return int 0 if unset, !=0 if set
56 */
57 public function checkFlag( $flag );
58 /**
59 * Merge two field definitions if possible.
60 *
61 * @param SearchIndexField $that
62 * @return SearchIndexField|false New definition or false if not mergeable.
63 */
64 public function merge( SearchIndexField $that );
65 }