X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSearchIndexField.php;h=6f3b207848c2fc0fbcdecab81207e26c6f475e13;hb=098e23fb9dc76bc715095f51c9547986874eea37;hp=6b5316f009fa2592998b56bdd0568c27cacf30ff;hpb=939199bcea28a3b13c49c0f808d11d415660b924;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchIndexField.php b/includes/search/SearchIndexField.php index 6b5316f009..6f3b207848 100644 --- a/includes/search/SearchIndexField.php +++ b/includes/search/SearchIndexField.php @@ -30,16 +30,19 @@ interface SearchIndexField { * This field is case-insensitive. */ const FLAG_CASEFOLD = 1; + /** * This field contains secondary information, which is * already present in other fields, but can be used for * scoring. */ const FLAG_SCORING = 2; + /** * This field does not need highlight handling. */ const FLAG_NO_HIGHLIGHT = 4; + /** * Do not index this field, just store it. */ @@ -51,20 +54,23 @@ interface SearchIndexField { * @return array|null Null means this field does not map to anything */ public function getMapping( SearchEngine $engine ); + /** * Set global flag for this field. * - * @param int $flag Bit flag to set/unset + * @param int $flag Bit flag to set/unset * @param bool $unset True if flag should be unset, false by default * @return $this */ 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 ); + /** * Merge two field definitions if possible. * @@ -72,4 +78,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 ); }