CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch Namespace Reference

A fallback method is a way to interact (correct/fix/suggest a better query) with the search results. More...

Namespaces

namespace  Elastica
 Implementation of "sltr" query from ltr-query plugin.
 

Classes

class  BaseInterwikiResolver
 Base InterwikiResolver class. More...
 
class  BaseRequestLog
 
class  BulkUpdateRequestLog
 Request log for requests that update the elasticsearch cluster. More...
 
class  ChangeListener
 Implementation to all the hooks that CirrusSearch needs to listen in order to keep its index in sync with main SQL database. More...
 
class  CirrusConfigInterwikiResolver
 InterwikiResolver suited for custom cirrus config: More...
 
class  CirrusDebugOptions
 Cirrus debug options generally set via unofficial URI param (&cirrusXYZ=ZYX) More...
 
class  CirrusSearch
 SearchEngine implementation for CirrusSearch. More...
 
class  CirrusSearchHookRunner
 
class  CirrusSearchServices
 A simple wrapper for MediaWikiServices, to support type safety when accessing services defined by this extension. More...
 
class  ClusterSettings
 Handles resolving configuration variables into specific settings for a specific cluster. More...
 
class  CompletionRequestLog
 
class  CompletionSuggester
 Performs search as you type queries using Completion Suggester. More...
 
class  Connection
 Forms and caches connection to Elasticsearch as well as client objects that contain connection information like \Elastica\Index and \Elastica\Type. More...
 
class  CrossSearchStrategy
 Defines support strategies regarding cross wiki searches. More...
 
class  DataSender
 Handles non-maintenance write operations to the elastic search cluster. More...
 
class  Dump
 action=cirrusDump handler. More...
 
class  ElasticaErrorHandler
 Generic functions for extracting and reporting on errors/exceptions from Elastica. More...
 
class  ElasticsearchIntermediary
 Base class with useful functions for communicating with Elasticsearch. More...
 
class  EmptyInterwikiResolver
 
class  ExplainPrinter
 Formats the result of elasticsearch explain to a (slightly) more readable html format than raw json. More...
 
class  ExternalIndex
 Represents an external index referenced by the OtherIndex functionality. More...
 
class  HashSearchConfig
 SearchConfig implemenation backed by a simple HashConfig. More...
 
class  Hooks
 All CirrusSearch's external hooks. More...
 
interface  InterwikiResolver
 Retrieve Interwiki information. More...
 
class  InterwikiResolverFactory
 Factory class used to create InterwikiResolver. More...
 
class  InterwikiSearcher
 Performs searches using Elasticsearch – on interwikis! More...
 
class  MultiSearchRequestLog
 Extending from SearchRequestLog doesn't quite feel right, but there is a good amount of shared code. More...
 
class  NearMatchPicker
 Picks the best "near match" title. More...
 
class  NoActiveTestException
 Thrown when a user testing method is called that requires an active test, but no test was active. More...
 
class  OtherIndexesUpdater
 Tracks whether a Title is known on other indexes. More...
 
class  PageChangeTracker
 Listen to a set of hooks to keep track if a pageId was involved in a "page change". More...
 
interface  RequestLog
 Represents logging information for a single network operation made between php and elasticsearch. More...
 
class  RequestLogger
 Handles logging information about requests made to various destinations, such as monolog, EventBus and statsd. More...
 
class  SearchConfig
 Configuration class encapsulating Searcher environment. More...
 
class  Searcher
 Performs searches using Elasticsearch. More...
 
class  SearchRequestLog
 
class  SiteMatrixInterwikiResolver
 InterwikiResolver suited for WMF context and uses SiteMatrix. More...
 
class  UpdateGroup
 
class  Updater
 Performs updates and deletes on the Elasticsearch index. More...
 
class  UserTestingEngine
 Decision making around user testing. More...
 
class  UserTestingStatus
 Reports UserTesting bucketing decision. More...
 
class  Util
 Random utility functions that don't have a better home. More...
 
class  Version
 Fetch the Elasticsearch version. More...
 
interface  WarningCollector
 Warning collector interface. More...
 

Variables

 return ['default'=>['builder_class'=> Query\FullTextQueryStringQueryBuilder::class, 'settings'=>[],], 'browser_tests'=>['builder_class'=> Query\FullTextSimpleMatchQueryBuilder::class, 'settings'=>['default_min_should_match'=> '1', 'default_query_type'=> 'most_fields', 'default_stem_weight'=> 0.3, 'fields'=>['title'=> 2.3, 'redirect.title'=>['boost'=> 2.0, 'in_dismax'=> 'redirects_or_shingles'], 'suggest'=>['is_plain'=> true, 'boost'=> 1.05, 'in_dismax'=> 'redirects_or_shingles',], 'category'=> 1.8, 'heading'=> 1.3, 'text'=>['boost'=> 0.4, 'in_dismax'=> 'text_and_opening_text',], 'opening_text'=>['boost'=> 0.5, 'in_dismax'=> 'text_and_opening_text',], 'auxiliary_text'=> 0.2, 'file_text'=> 0.2,], 'phrase_rescore_fields'=>['text'=> 0.14, 'text.plain'=> 0.2,], 'dismax_settings'=>['text_and_opening_text'=>['tie_breaker'=> 0.2,],],]], 'perfield_builder'=>['builder_class'=> \CirrusSearch\Query\FullTextSimpleMatchQueryBuilder::class, 'settings'=>['default_min_should_match'=> '1', 'default_query_type'=> 'most_fields', 'default_stem_weight'=> 3.0, 'fields'=>['title'=> 0.3, 'redirect.title'=>['boost'=> 0.27, 'in_dismax'=> 'redirects_or_shingles'], 'suggest'=>['is_plain'=> true, 'boost'=> 0.20, 'in_dismax'=> 'redirects_or_shingles',], 'category'=> 0.05, 'heading'=> 0.05, 'text'=>['boost'=> 0.6, 'in_dismax'=> 'text_and_opening_text',], 'opening_text'=>['boost'=> 0.5, 'in_dismax'=> 'text_and_opening_text',], 'auxiliary_text'=> 0.05, 'file_text'=> 0.5,], 'phrase_rescore_fields'=>['all'=> 0.06, 'all.plain'=> 0.1,],],], 'perfield_builder_title_filter'=>['builder_class'=> \CirrusSearch\Query\FullTextSimpleMatchQueryBuilder::class, 'settings'=>['default_min_should_match'=> '1', 'default_query_type'=> 'most_fields', 'default_stem_weight'=> 3.0, 'filter'=>['type'=> 'constrain_title', 'settings'=>['minimum_should_match'=> '3< 80%'],], 'fields'=>['title'=> 0.3, 'redirect.title'=>['boost'=> 0.27, 'in_dismax'=> 'redirects_or_shingles'], 'suggest'=>['is_plain'=> true, 'boost'=> 0.20, 'in_dismax'=> 'redirects_or_shingles',], 'category'=> 0.05, 'heading'=> 0.05, 'text'=>['boost'=> 0.6, 'in_dismax'=> 'text_and_opening_text',], 'opening_text'=>['boost'=> 0.5, 'in_dismax'=> 'text_and_opening_text',], 'auxiliary_text'=> 0.05, 'file_text'=> 0.5,], 'phrase_rescore_fields'=>['all'=> 0.06, 'all.plain'=> 0.1,],],],]
 CirrusSearch - List of FullTextQueryBuilderProfiles used to generate an elasticsearch query by parsing user input.
 
 $phraseRescorePlaceHolder
 CirrusSearch - List of profiles for function score rescores.
 
 return ['classic'=>['i18n_msg'=> 'cirrussearch-qi-profile-classic', 'supported_namespaces'=> 'all', 'rescore'=>[$phraseRescorePlaceHolder, ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 1.0, 'score_mode'=> 'multiply', 'type'=> 'function_score', 'function_chain'=> 'classic_allinone_chain']]], 'classic_noboostlinks'=>['i18n_msg'=> 'cirrussearch-qi-profile-classic-noboostlinks', 'supported_namespaces'=> 'all', 'rescore'=>[$phraseRescorePlaceHolder, ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 1.0, 'score_mode'=> 'multiply', 'type'=> 'function_score', 'function_chain'=> 'optional_chain'],]], 'empty'=>['i18n_msg'=> 'cirrussearch-qi-profile-empty', 'supported_namespaces'=> 'all', 'rescore'=>[],], 'wsum_inclinks'=>['i18n_msg'=> 'cirrussearch-qi-profile-wsum-inclinks', 'supported_namespaces'=> 'all', 'rescore'=>[$phraseRescorePlaceHolder, ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 1.0, 'score_mode'=> 'total', 'type'=> 'function_score', 'function_chain'=> 'wsum_inclinks'], ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 1.0, 'score_mode'=> 'multiply', 'type'=> 'function_score', 'function_chain'=> 'optional_chain'],],], 'wsum_inclinks_pv'=>['i18n_msg'=> 'cirrussearch-qi-profile-wsum-inclinks-pv', 'supported_namespaces'=> 'content', 'fallback_profile'=> 'wsum_inclinks', 'rescore'=>[$phraseRescorePlaceHolder, ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 1.0, 'score_mode'=> 'total', 'type'=> 'function_score', 'function_chain'=> 'wsum_inclinks_pv'], ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 1.0, 'score_mode'=> 'multiply', 'type'=> 'function_score', 'function_chain'=> 'optional_chain'],],], 'popular_inclinks_pv'=>['supported_namespaces'=> 'content', 'fallback_profile'=> 'popular_inclinks', 'i18n_msg'=> 'cirrussearch-qi-profile-popular-pv', 'rescore'=>[$phraseRescorePlaceHolder, ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 1.0, 'score_mode'=> 'total', 'type'=> 'function_score', 'function_chain'=> 'wsum_inclinks_pv+'], ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 1.0, 'score_mode'=> 'multiply', 'type'=> 'function_score', 'function_chain'=> 'optional_chain'],],], 'popular_inclinks'=>['supported_namespaces'=> 'all', 'i18n_msg'=> 'cirrussearch-qi-profile-popular-inclinks', 'rescore'=>[$phraseRescorePlaceHolder, ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 100.0, 'score_mode'=> 'total', 'type'=> 'function_score', 'function_chain'=> 'wsum_inclinks'], ['window'=> 8192, 'window_size_override'=> 'CirrusSearchFunctionRescoreWindowSize', 'query_weight'=> 1.0, 'rescore_query_weight'=> 1.0, 'score_mode'=> 'multiply', 'type'=> 'function_score', 'function_chain'=> 'optional_chain'],],],]
 

Detailed Description

A fallback method is a way to interact (correct/fix/suggest a better query) with the search results.

Functionality related to the (Wikimedia-specific) weighted_tags search feature.

Field definitions for the (Wikimedia-specific) weighted_tags search feature.

Index field representing the source_text data.

Index field representing a short technical text.

Boost score when certain field is matched with certain term.

Append functions to a FunctionScore \Search\Rescore.

Simple TextIndexField subclass useful to customize COPY_TO_SUGGEST.

Index field representing double.

Index field representing keyword.

Index field representing integer.

Index field representing datetime field.

Index field representing boolean value.

Finds pages based on how well they match a given topic, based on scores provided by the (Wikimedia-specific) articletopic ORES model.

Multiple methods can be chained together the order in which they are applied is determined by the successApproximation method.

The actual work is then done in the rewrite method where the method can actually change/augment the current resultset.

\Fallbacks

\Wikimedia

See also
WeightedTagsHooks
https://www.mediawiki.org/wiki/Help:CirrusSearch#Articletopic

Keywords use special analyzer.

Config: [ 'field_name' => ['match1' => WEIGHT1, ...], ...] \Search

ShortText uses a language agnostic analyzer.

\Wikimedia

See also
WeightedTagsHooks

\Wikimedia

See also
ArticleTopicFeature

Variable Documentation

◆ $phraseRescorePlaceHolder

CirrusSearch\$phraseRescorePlaceHolder
Initial value:
= [
'window' => 512,
'window_size_override' => 'CirrusSearchPhraseRescoreWindowSize',
'rescore_query_weight' => 10,
'rescore_query_weight_override' => 'CirrusSearchPhraseRescoreBoost',
'query_weight' => 1.0,
'type' => 'phrase',
]

CirrusSearch - List of profiles for function score rescores.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html List of rescore profiles.

NOTE: writing a new custom profile is a complex task, you can use &cirrusDumpResult&cirrusExplain query params to dump score information at runtime. Transient var used to position the phrase rescore

◆ return

CirrusSearch\return[ 'default'=>[ 'builder_class'=> Query\FullTextQueryStringQueryBuilder::class, 'settings'=>[],], 'browser_tests'=>[ 'builder_class'=> Query\FullTextSimpleMatchQueryBuilder::class, 'settings'=>[ 'default_min_should_match'=> '1', 'default_query_type'=> 'most_fields', 'default_stem_weight'=> 0.3, 'fields'=>[ 'title'=> 2.3, 'redirect.title'=>[ 'boost'=> 2.0, 'in_dismax'=> 'redirects_or_shingles'], 'suggest'=>[ 'is_plain'=> true, 'boost'=> 1.05, 'in_dismax'=> 'redirects_or_shingles',], 'category'=> 1.8, 'heading'=> 1.3, 'text'=>[ 'boost'=> 0.4, 'in_dismax'=> 'text_and_opening_text',], 'opening_text'=>[ 'boost'=> 0.5, 'in_dismax'=> 'text_and_opening_text',], 'auxiliary_text'=> 0.2, 'file_text'=> 0.2,], 'phrase_rescore_fields'=>[ 'text'=> 0.14, 'text.plain'=> 0.2,], 'dismax_settings'=>[ 'text_and_opening_text'=>[ 'tie_breaker'=> 0.2,],],]], 'perfield_builder'=>[ 'builder_class'=> \CirrusSearch\Query\FullTextSimpleMatchQueryBuilder::class, 'settings'=>[ 'default_min_should_match'=> '1', 'default_query_type'=> 'most_fields', 'default_stem_weight'=> 3.0, 'fields'=>[ 'title'=> 0.3, 'redirect.title'=>[ 'boost'=> 0.27, 'in_dismax'=> 'redirects_or_shingles'], 'suggest'=>[ 'is_plain'=> true, 'boost'=> 0.20, 'in_dismax'=> 'redirects_or_shingles',], 'category'=> 0.05, 'heading'=> 0.05, 'text'=>[ 'boost'=> 0.6, 'in_dismax'=> 'text_and_opening_text',], 'opening_text'=>[ 'boost'=> 0.5, 'in_dismax'=> 'text_and_opening_text',], 'auxiliary_text'=> 0.05, 'file_text'=> 0.5,], 'phrase_rescore_fields'=>[ 'all'=> 0.06, 'all.plain'=> 0.1,],],], 'perfield_builder_title_filter'=>[ 'builder_class'=> \CirrusSearch\Query\FullTextSimpleMatchQueryBuilder::class, 'settings'=>[ 'default_min_should_match'=> '1', 'default_query_type'=> 'most_fields', 'default_stem_weight'=> 3.0, 'filter'=>[ 'type'=> 'constrain_title', 'settings'=>[ 'minimum_should_match'=> '3< 80%'],], 'fields'=>[ 'title'=> 0.3, 'redirect.title'=>[ 'boost'=> 0.27, 'in_dismax'=> 'redirects_or_shingles'], 'suggest'=>[ 'is_plain'=> true, 'boost'=> 0.20, 'in_dismax'=> 'redirects_or_shingles',], 'category'=> 0.05, 'heading'=> 0.05, 'text'=>[ 'boost'=> 0.6, 'in_dismax'=> 'text_and_opening_text',], 'opening_text'=>[ 'boost'=> 0.5, 'in_dismax'=> 'text_and_opening_text',], 'auxiliary_text'=> 0.05, 'file_text'=> 0.5,], 'phrase_rescore_fields'=>[ 'all'=> 0.06, 'all.plain'=> 0.1,],],],]

CirrusSearch - List of FullTextQueryBuilderProfiles used to generate an elasticsearch query by parsing user input.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html