Merge "Special:Newpages feed now shows first revision instead of latest revision"
[lhc/web/wiklou.git] / includes / search / SearchIndexField.php
index 6806ee5..eb72662 100644 (file)
@@ -14,6 +14,15 @@ interface SearchIndexField {
        const INDEX_TYPE_DATETIME = 4;
        const INDEX_TYPE_NESTED = 5;
        const INDEX_TYPE_BOOL = 6;
+
+       /**
+        * SHORT_TEXT is meant to be used with short text made of mostly ascii
+        * technical information. Generally a language agnostic analysis chain
+        * is used and aggressive splitting to increase recall.
+        * E.g suited for mime/type
+        */
+       const INDEX_TYPE_SHORT_TEXT = 7;
+
        /**
         * Generic field flags.
         */
@@ -52,7 +61,7 @@ interface SearchIndexField {
        public function setFlag( $flag, $unset = false );
        /**
         * Check if flag is set.
-        * @param $flag
+        * @param int $flag
         * @return int 0 if unset, !=0 if set
         */
        public function checkFlag( $flag );
@@ -63,4 +72,21 @@ interface SearchIndexField {
         * @return SearchIndexField|false New definition or false if not mergeable.
         */
        public function merge( SearchIndexField $that );
+
+       /**
+        * A list of search engine hints for this field.
+        * Hints are usually specific to a search engine implementation
+        * and allow to fine control how the search engine will handle this
+        * particular field.
+        *
+        * For example some search engine permits some optimizations
+        * at index time by ignoring an update if the updated value
+        * does not change by more than X% on a numeric value.
+        *
+        * @param SearchEngine $engine
+        * @return array an array of hints generally indexed by hint name. The type of
+        * values is search engine specific
+        * @since 1.30
+        */
+       public function getEngineHints( SearchEngine $engine );
 }