From Celeste Wiki
Jump to navigation Jump to search

<languages /> <translate> The quickest way to find information in Wikimedia projects is to look it up directly. On every page there is a <tvar|search>Template:Int</> box. </translate>

<translate> CirrusSearch is a MediaWiki extension that uses Elasticsearch to provide enhanced search features over the [[<tvar|helps>Special:MyLanguage/Help:Searching</>|default MediaWiki search]]. The Wikimedia Foundation uses CirrusSearch for all [[<tvar|wmproj>m:Special:MyLanguage/Wikimedia_projects</>|Wikimedia projects]].</translate> <translate> This page describes the features of CirrusSearch.</translate> <translate> If your question is not answered here, feel free to ask on the [[<tvar|talk>Help talk:CirrusSearch</>|talk page]] and someone will answer it for you.</translate>

<translate> For information on the MediaWiki extension see <tvar|1>Template:Ll</>.

How it works[edit source]

</translate> <translate> Enter key words and phrases and press Enter or Return on your keyboard. Or click the magnifying glass icon, Search, or Go button.</translate> <translate> If a page has the same title as what you entered you will be directed to that page.</translate> <translate> Otherwise, it searches all pages on the wiki, and presents a list of articles that matched your search terms, or a message informing you that no page has all the key words and phrases.</translate>

<translate> If you click the "<tvar|1>Template:Int</>" button without filling in anything, you will be taken to "Special:Search" which gives you extra searching options (also available from any search results list) </translate>

<translate> You may find it useful to restrict a search to pages within a particular [[<tvar|1>Special:MyLanguage/Help:Namespaces</>|namespace]] e.g., only search within the <tvar|2>User</> pages.</translate> <translate> Check the namespaces you require for this search.</translate>

<span class="citation wikicite" id="endnote_<translate> All keywords mentioned below are case-sensitive and in lower case.</translate>">^ 


What's improved?[edit source]

CirrusSearch features three main improvements over the default MediaWiki search, namely:

  • Better support for searching in different languages.</translate>


  • Faster updates to the search index, meaning changes to articles are reflected in search results much faster.</translate>


  • Expanding templates, meaning that all content from a template is now reflected in search results.

How frequently is the search index updated?[edit source]

</translate> <translate> Updates to the search index are done in near real time.</translate> <translate> Changes to pages should appear immediately in the search results.</translate> <translate> Changes to templates should take effect in articles that include the template in a few minutes.</translate> <translate> The templates changes use the job queue, so performance may vary.</translate> <translate> A [[<tvar|purge>Special:MyLanguage/Manual:Purge</>|null edit]] to the article will force the change through, but that shouldn't be required if everything is going well.</translate>


Search suggestions[edit source]

</translate> <translate> The search suggestions you get when you type into the search box that drops down candidate pages is sorted by a rough measure of article quality.</translate> <translate> This takes into account the number of incoming wikilinks, the size of the page, the number of external links, the number of headings, and the number of redirects.</translate> <translate> Search suggestions can be skipped and queries will go directly to the search results page. Add a tilde <tvar|tilde>~</> before the query. Example "~Frida Kahlo". The search suggestions will still appear, but hitting the Enter key at any time will take you to the search results page.</translate>

<translate> Accent/diacritic folding is turned on for some languages; the details are language-specific. </translate>


Full text search[edit source]

</translate> <translate> A "full text search" is an "indexed search". All pages are stored in the wiki database, and all the words in the non-redirect pages are stored in the search database, which is an index to practically the full text of the wiki. Each visible word is indexed to the list of pages where it is found, so a search for a word is as fast as looking up a single-record.</translate>[1] <translate> Furthermore, for any changes in wording, the search index is updated within seconds.</translate>

<translate> There are many indexes of the "full text" of the wiki to facilitate the many types of searches needed. The full wikitext is indexed many times into many special-purpose indexes, each parsing the wikitext in whatever way optimizes their use. Example indexes include:

  • "auxiliary" text, includes hatnotes, captions, ToC, and any wikitext classed by an HTML attribute <tvar|searchaux>class=searchaux</>.
  • "Lead-in" text is the wikitext between the top of the page and the first heading.
  • The "category" text indexes the listings at the bottom.
  • Templates are indexed. If the transcluded words of a template change, then all the pages that transclude it are updated. (This can take a long time depending on a job queue.) If the subtemplates used by a template change, the index is updated.
  • Document contents that are stored in the File/Media namespace are now indexed. Thousands of formats are recognized.


<translate> There is support for dozens of languages, but all languages are wanted.</translate> <translate> There is a list of currently supported languages at [<tvar|url></>]; see their [<tvar|doc></> documentation on contributing] to submit requests or patches.</translate> <translate> Third-party open-source libraries are also used to support additional languages not covered by Elasticsearch.</translate>

<translate> CirrusSearch will optimize your query, and run it. The resulting titles are weighted by relevance, and heavily post-processed, 20 at a time, for the search results page. For example snippets are garnered from the article, and search terms are highlighted in bold text.

Search results will often be accompanied by various preliminary reports. These include Did you mean (spelling correction), and, when no results would otherwise be found it will say Showing results for (query correction) and search instead for (your query).

Search features also include:

  • Sorting navigation suggestions by the number of incoming links.
  • Starting with the tilde character <tvar|tilde>~</> to disable navigation and suggestions in such a way that also preserves page ranking.
  • Smart-matching characters by normalizing (or "folding") non-keyboard characters into keyboard characters.</translate>


  • Words and phrases that match are highlighted in bold on the search results page. The highlighter is a cosmetic analyzer, while the search-indexing analyzer actually finds the page, and these may not be 100% in sync, especially for regex. The highlighter can match more or less accurately than the indexer.</translate>


Words, phrases, and modifiers[edit source]

</translate> <translate> The basic search term is a word or a "phrase in quotes".</translate> <translate> Details vary by language, especially for languages without spaces, but search typically recognizes a "word" to be:</translate>


  • a string of digits
  • a string of letters
  • subwords between letters/digit transitions, such as in <tvar|txt2r>txt2regex</>
  • subwords inside a compoundName using camelCase


<translate> A "stop word" is a word that is ignored (because it is common, or for other reasons).</translate> <translate> The list of stop words is language-specific and not all languages support stop words.</translate>[2] <translate> A given search term matches against content (rendered on the page). To match against wikitext instead, use the <tvar|insource>insource</> search parameter (See section below). Each search parameter has its own index, and interprets its given term in its own way.</translate>[3]

<translate> Spacing between words, phrases, parameters, and input to parameters, can include generous instances of whitespace and greyspace characters.</translate> <translate> "Greyspace characters" are all the non-alphanumeric characters <tvar|characters>~!@#$%^&()_+-={}|[]\:";'<>?,./</>.</translate> <translate> A mixed string of greyspace characters and whitespace characters, is "greyspace", and is treated as one big word boundary.</translate> <translate> Greyspace is how indexes are made and queries are interpreted.</translate>[4]

<translate> Two exceptions are where 1) an embedded:colon is one word (it being treated as a letter), and 2) an embedded comma , such as in <tvar|123>1,2,3</>, is treated as a number. Greyspace characters are otherwise ignored unless, due to query syntax, they can be interpreted as modifier characters.

The modifiers are <tvar|mod>~ * \? - " ! </>. Depending on their placement in the syntax they can apply to a term, a parameter, or to an entire query. Word and phrase modifiers are the wildcard, proximity, and fuzzy searches. Each parameter can have their own modifiers, but in general:</translate>

  • <translate> A fuzzy-word or fuzzy-phrase search can suffix a tilde <tvar|1>~</> character (and a number telling the degree).</translate>
  • <translate> A tilde <tvar|tilde>~</> character prefixed to the first term of a query guarantees search results instead of any possible navigation.</translate>
  • <translate> A wildcard character inside a word can be an (escaped) question mark \? for one character or an asterisk <tvar|asterisk>*</> character for zero or more characters.</translate>
  • <translate> Truth-logic can interpret <tvar|and>AND</> and <tvar|or>OR</>, but parameters cannot. Note that the <tvar|and>AND</> and <tvar|or>OR</> operators currently do not function in the traditional truth-logic manner! For details see more on logical operators.</translate>
  • <translate> Truth-logic understands <tvar|dash>-</> or <tvar|exclaim>!</> prefixed to a term to invert the usual meaning of the term from "match" to "exclude".</translate>


  • <translate> Quotes around words mark an "exact phrase" search. For parameters they are also needed to delimit multi-word input.</translate>
  • <translate> Stemming is automatic but can be turned off using an "exact phrase".</translate>


<translate> A phrase search can be initiated by various hints to the search engine. Each method of hinting has a side-effect of how tolerant the matching of the word sequence will be. For greyspace, camelCase, or txt2number hints:</translate>

  • <translate> given <tvar|wjgrey>words-joined_by_greyspace(characters)</> or <tvar|wjcamel>wordsJoinedByCamelCaseCharacters</> it finds <tvar|wjb>words joined by</> ... <tvar|char>characters</>, in their bare forms or greyspace forms.</translate>
  • <translate> <tvar|txt2n>txt2number</> will match <tvar|t2n>txt 2 number</> or <tvar|t2np>txt-2.number</>.</translate>
  • <translate> Stop words are enabled for the edge cases (in the periphery) of a grey_space or camelCase phrase.</translate> <translate> An example using <tvar|1>the</>, <tvar|2>of</>, and <tvar|3>a</> is that <tvar|4>the_invisible_hand_of_a</> matches <tvar|6>invisible hand</> within the text <tvar|5>meetings invisible hand shake</>.</translate>

<translate> A "search instead" report is triggered when a universally unknown word is ignored in a phrase.

Each one of the following types of phrase-matching contains and widens the match-tolerances of the previous one:

  • An "exact phrase" "in quotes" will tolerate (match with) greyspace. Given <tvar|exact_phrase>"exact_phrase"</> or <tvar|exactphrase>"exact phrase"</> it matches <tvar|exactbracket>"exact]phrase"</>.</translate>


  • A greyspace_phrase initiates stemming and stop word checks.</translate>


  • Given <tvar|camel>CamelCase</> it will additionally match <tvar|camelcase>camelcase</>, in all lowercase, because CirrusSearch is not case sensitive in matching.</translate> <translate> Note that <tvar|1>CamelCase</> matching is not enabled for all languages.</translate>

<translate> Some parameters interpret greyspace phrases, but other parameters, like <tvar|insource>insource</> only interpret the usual "phrase in quotes". </translate>


<translate> Search phrase</translate> parserfunction parserFunction parser function parser-function parser:function parSer:funcTion
parserfunction Template:Tick Template:Tick Template:Cross Template:Cross Template:Cross Template:Cross
"parser function" Template:Cross Template:Cross Template:Tick Template:Tick Template:Cross Template:Cross
parser_function Template:Cross Template:Tick Template:Tick Template:Tick Template:Cross Template:Cross
parserFunction Template:Tick Template:Tick Template:Tick Template:Tick Template:Cross Template:Cross
"parser:function" Template:Cross Template:Cross Template:Cross Template:Cross Template:Tick Template:Tick
"parser_function" Template:Cross Template:Cross Template:Tick Template:Tick Template:Cross Template:Cross
"parSer_funcTion" Template:Cross Template:Cross Template:Tick Template:Tick Template:Cross Template:Cross
parSer_FuncTion Template:Cross Template:Cross Template:Tick Template:Tick Template:Tick Template:Tick

<translate> Note that all stemming is case insensitive.

Note how the "exact phrase" search interpreted the embedded:colon character as a letter, but not the embedded_underscore character. A similar event occurs with the comma <tvar|comma>,</> character inside a number.

Given <tvar|inthisword>in:this:word</>, CirrusSearch, when in an "exact phrase" context, (which includes the insource parameter context), will not match <tvar|in>in</>, <tvar|this>this</>, or <tvar|word>word</>, but will then only match <tvar|inthiswordcolon>in:this:word</>.

Otherwise, remember that for CirrusSearch words are letters, numbers, or a combination of the two, and case does not matter.

The common word search employs the space character and is aggressive with stemming, and when the same words are joined by greyspace characters or camelCase they are aggressive with phrases and subwords.

When common words like "of" or "the" are included in a greyspace-phrase, they are ignored, so as to match more aggressively. </translate>

<translate> A greyspace_phrase search term, or a camelCase, or a txt2number term, match the signified words interchangeably. You can use any of those three forms.</translate>[5] <translate> Now <tvar|camelcase>camelcase</> matches <tvar|camelCase>camelCase</> because Search is not case sensitive, but <tvar|camelCase2>camelCase</> matches <tvar|camelcase2>camelcase</> because camelCase is more aggressive.</translate> <translate> Like the rest of Search, subword "words" are not case-sensitive. By comparison the "exact phrase" is greyspace oriented and ignores numeric or letter-case transitions, and stemming. "Quoted phrases" are not case sensitive.</translate>

<translate> From the table we can surmise that the basic search <tvar|1>parser_function -"parser function"</> is the sum of the basic searches <tvar|2>parserFunction</> and <tvar|3>parser<stems> function<stems></>.

Making inquiries with numbers, we would find that:

  • <tvar|Plan9>Plan9</> or <tvar|Plan_9>Plan_9</> matches any of: <tvar|plan9>plan9</>, <tvar|plans9>plans 9</>, <tvar|planned9th>planned 9th</>, <tvar|planned92>(planned) 9.2</>, <tvar|plans>"plans" (9:24)</>
  • <tvar|plan92>"plan9"</> only matches <tvar|plan93>plan9</> (case insensitive)
  • <tvar|planast>Plan*9</> matches <tvar|plan94>plan9</> or <tvar|planet>planet4589</>.


<translate> The star <tvar|asterisk>*</> wildcard matches a string of letters and digits within a rendered word, but never the beginning character.</translate> <translate> One or more characters must precede the <tvar|asterisk1>*</> character.</translate>


  • When <tvar|1>*</> matches numbers, a comma is considered part of one number, but the decimal point is considered a greyspace character, and will delimit two numbers.</translate>


  • Inside an "exact phrase" <tvar|1>*</> is treated as a greyspace character and not a wild card character, so it delimits words.

The <tvar|quest>\?</> wildcard represents one letter or number; <tvar|bsq>*\?</> is also accepted, but <tvar|bsqast>\?*</> is not recognized.

The wildcards are for basic word, phrase, and insource searches, and may also be an alternative to (some) advanced regex searches (covered later).

Putting a tilde <tvar|tilde>~</> character after a word or phrase activates a fuzzy search.

  • For a phrase it is termed a proximity search, because proximal words are tolerated to an approximate rather than exact phrase.
  • For example, <tvar|exact12p>"exact one two phrase"~2</> matches <tvar|exact>exact phrase</>.
  • For a word it means extra characters or changed characters.
  • For a phrase a fuzzy search requires a whole number telling it how many extra words to fit in, but for a word a fuzzy search can have a decimal fraction, defaulting to <tvar|word05>word~0.5</> (<tvar|wordtilde>word~.5</>), where at most two letters can be found swapped, changed, or added, but never the first two letters.
  • For a proximity phrase, a large number can be used, but that is an "expensive" (slow) search.
  • For a word <tvar|wordtilde1>word~2</> is most fuzzy with an edit distance of 2 (default), and <tvar|wordtilde9>word~1</> is least fuzzy, and <tvar|wordtilde12>word~0</> is not fuzzy at all.


flowers algernon Flowers for Algernon flowers are for Algernon Flowers a1 2b 3c 4f 5j 6l 7j 8p q9 z10 for Algernon
"flowers algernon" Template:Tick Template:Cross Template:Cross Template:Cross
"flowers algernon"~0 Template:Tick Template:Cross Template:Cross Template:Cross
"flowers algernon"~1 Template:Tick Template:Tick Template:Cross Template:Cross
"flowers algernon"~2 Template:Tick Template:Tick Template:Tick Template:Cross
"flowers algernon"~11 Template:Tick Template:Tick Template:Tick Template:Tick
"algernon flowers"~1 Template:Cross Template:Cross Template:Cross Template:Cross
"algernon flowers"~2 Template:Tick Template:Cross Template:Cross Template:Cross
"algernon flowers"~3 Template:Tick Template:Tick Template:Cross Template:Cross
"algernon flowers"~4 Template:Tick Template:Tick Template:Tick Template:Cross
"algernon flowers"~13 Template:Tick Template:Tick Template:Tick Template:Tick

<translate> For the closeness value necessary to match in reverse (right to left) order, count and discard all the extra words, then add twice the total count of remaining words minus one.</translate> <translate> (In other words, add twice the number of segments).</translate> <translate> For the full proximity algorithm, see [<tvar|esslop></> Elasticsearch slop].</translate>

<translate> Quotes turn off stemming, <tvar|appendtilde>"but appending"~</> the tilde reactivates the stemming. </translate>

flowers flower Flowers for Algernon flower for Algernon
flowers Template:Tick Template:Tick Template:Tick Template:Tick <translate> Stemming is in effect.</translate>
"flowers" Template:Tick Template:Cross Template:Tick Template:Cross <translate> Proximity search turns off stemming. </translate>
"flowers"~ Template:Tick Template:Tick Template:Tick Template:Tick <translate> Proximity plus stemming by suffixing a tilde. </translate>
"flowers for algernon" Template:Cross Template:Cross Template:Tick Template:Cross <translate> Proximity search turns off stemming. </translate>
"flowers for algernon"~ Template:Cross Template:Cross Template:Tick Template:Tick <translate> Proximity plus stemming by suffixing a tilde. </translate>
"flowers algernon"~1 Template:Cross Template:Cross Template:Tick Template:Cross <translate> Proximity search turns off stemming. </translate>
"flowers algernon"~1~ Template:Cross Template:Cross Template:Tick Template:Tick <translate> Proximity plus stemming by suffixing a tilde. </translate>


Insource[edit source]

</translate> Template:MW version

<translate> Insource searches can be used to find any one word rendered on a page, but it's made for finding any phrase you might find - including MediaWiki markup (aka wikicode), on any page except redirects. This phrase completely ignores greyspace: <tvar|issa>insource: "state state autocollapse"</> matches <tvar|state>|state={{{state|autocollapse}}}</>. </translate>

insource: word
insource: "word1 word2"
<translate> Greyspace characters are ignored, just as they are with word searches and exact-phrase searches.</translate>
<translate> These are regular expressions. They aren't efficient, so only a few are allowed at a time on the search cluster, but they are very powerful. The regular expression matches case-sensitively by default; case-insensitivity can be opted in with the extra <tvar|i>i</>, which is even less efficient.</translate>

<translate> Insource complements itself. On the one hand it has full text search for any word in the wikitext, instantly. On the other hand it can process a regexp search for any string of characters.</translate>[6] <translate> Regexes scan all the textual characters in a given list of pages; they don't have a word index to speed things up, and the process is interrupted if it runs for more than twenty seconds.</translate> <translate> Regexes run last in a query, so to limit needless character-level scanning, every regex query should include other search terms to limit the number of documents that need to be scanned.</translate>[7] <translate> Often the best candidate to add to the regex query <tvar|insourcearg>insource:/arg/</> is <tvar|insourcearg2>insource:arg</>, where arg is the same (and uses no wildcards).</translate>

<translate> The syntax for the regexp is <tvar|insource>insource:</> no space, and then <tvar|regexp>/regexp/</>. (No other parameter disallows a space. All the parameters except <tvar|regex>insource:/regexp/</> accept space after their colon.)

Insource indexed-search and regexp-search roles are similar in many respects:

  • Both search wikitext only.
  • Neither finds things "sourced" by a [[<tvar|transclusion>Special:MyLanguage/Help:Transclusion</>|transclusion]].
  • Neither does stemmed, fuzzy, or proximity searches.
  • Both want the fewest results, and both work faster when accompanied by another clause.


<translate> But indexed searches all ignore greyspace; wildcards searches do not match greyspace, so regexes are the only way to find an exact string of any and all characters, for example a sequence of two spaces.</translate> <translate> Regexes are an entirely different class of search tool that make matching a literal string easy (basic, beginner use), and make matching by metacharacter expressions possible (advanced use) on the wiki.</translate> <translate> See [[<tvar|regexanchor>#Regular expression searches</>]] below.</translate>

<span class="citation wikicite" id="endnote_<translate> The insource parameter treats words with embedded colons as one word. This affects search queries for templates, parser functions, URLs, wikilinks, HTML tags, and comments.</translate>">^ 




Prefix and namespace[edit source]

For Search, a namespace term functions to specify the initial search domain. Instead of searching the entire wiki, the default is the main namespace (mainspace).

Only one namespace name can be set from the search box query. It is either the first term or in the last term, in a prefix parameter. </translate>

<translate> Two or more namespaces may be searched from the Advanced pane of the search bar found on the top of every search results page, Special:Search.</translate> <translate> Your search domain, as a profile of namespaces, can be set here.</translate> <translate> The namespaces list will then present itself on the first page of future search results to indicate the search domain of the search results.</translate> <translate> To unset this, select the default namespace (shown in parentheses), select "Remember", and press Search.</translate>

<translate> The search bar graphically sets and indicates a search domain. "Content pages" (mainspace), "Multimedia" (File), "Everything" (all plus File), "Translations", etc., are hyperlinks that can activate the query in that domain, and then indicate this by going inactive (dark). But the query will override the search bar.</translate> <translate> When a namespace or prefix is used in the query the search bar activations and indications may be misleading, so the search bar and the search box are mutually exclusive (not complementary) ways to set the search domain.</translate>

<translate> A namespace term overrides the search bar, and a prefix term overrides a namespace. </translate>

<translate> Enter a namespace name, or enter <tvar|all>all:</>, or enter a <tvar|colon>:</> colon for mainspace.</translate> <translate> All does not include the File namespace. File includes media content held at Commons such as PDF, which are all indexed and searchable.</translate>

<translate> When File is involved, a namespace modifier <tvar|local>local:</> has an effect, otherwise it is ignored.

Namespace aliases are accepted. </translate>

talk: "Wind clock" <translate> Find pages in the Talk namespace whose title or text contains the phrase "wind clock".</translate>
file: "Wind clock" <translate> Find pages in File namespace, whose title, text, or media content contains the phrase "wind clock".</translate>
file: local: "Wind clock" <translate> Filter out results from Commons wiki.</translate>
local: "Wind clock" <translate> Ignored.</translate> <translate> Searches mainspace. Local is ignored unless File is involved.</translate>

<translate> As with search parameters, local and all must be lowercase. Namespaces names are case insensitive. </translate>

<translate> The <tvar|prefixcolon>prefix:</> parameter matches any number of first-characters of all pagenames in one namespace.</translate>[8] <translate> When the first letters match a namespace name and colon, the search domain changes.</translate>

<translate> Given a namespace only, prefix will match all its pagenames. Given one character only, it cannot be - dash or ' quote or " double quote. The last character cannot be a colon.

For pagenames that match, their subpage titles match by definition.

The prefix parameter does not allow a space before a namespace, but allows whitespace before a pagename. </translate>

prefix:cow c_o_w>c o w</>.</translate>
domestic   prefix:cow c_o_w2>c o w</>, and that contain the word "<tvar|domestic2>domestic</>".</translate>
domestic   prefix:cow/ Cow>Cow</> but only if they contain the word "<tvar|domestic5>domestic</>".</translate> <translate> This is a very common search and is frequently built using a special URL parameter called <tvar|prefixequal>prefix=</>.</translate>
domestic   prefix:Talk:cow/ talkcow2>Talk:cow</>, but only if they contain the word "<tvar|domestic6>domestic</>".</translate>
1967   prefix:Pink Floyd/ <translate> List any subpages of Pink Floyd, but only if it also contains the word "1967".</translate>

<translate> The prefix parameter goes at the end so that pagename characters may contain " quotation marks. </translate>

<translate> The [[<tvar|extrans>Special:MyLanguage/Extension:Translate</>|Translate extension]] creates a sort of "language namespace", of translated versions of a page.</translate> <translate> But unlike namespace or prefix, which create the initial search domain, the <tvar|inlang>inlanguage</> parameter is a filter of it. (See the next section.)</translate>


Exclude content from the search index[edit source]

Content can be excluded from the search index by adding <tvar|css-class>class="navigation-not-searchable"</>. This will instruct CirrusSearch to ignore this content from the search index (see <tvar|phab>T162905</> for more context). </translate>

<translate> Additionally content can be marked as auxiliary information by adding <tvar|css-class>class="searchaux"</>.</translate> <translate> This will instruct CirrusSearch to move the content from the main text to an auxiliary field which has lower importance for search and snippet highlighting.</translate> <translate> This distinction is used for items such as image thumbnail descriptions, 'see also' sections, etc.</translate>


Filters[edit source]

</translate> <translate> A filter will have multiple instances, or negated instances, or it can run as a standalone filtering a search domain.</translate> <translate> A query is formed as terms that filter a search domain.</translate>

<translate> Adding another word, phrase, or parameter filters more. A highly refined search result may have very many Y/N filters when every page in the results will be addressed. (In this case ranking is largely irrelevant.)</translate> <translate> Filtering applies critically to adding a regex term; you want as few pages as possible before adding a regex (because it can never have a prepared index for its search).</translate>

<translate> A namespace is a specified search domain but not a filter because a namespace will not run standalone.</translate> <translate> A prefix will negate so it is a filter.</translate> <translate> The search parameters below are filters for which there may be multiple instances.</translate>

<translate> Insource (covered above) is also a filter, but <tvar|regexp>insource:/regexp/</> is not a filter. Filters and all other search parameters are lowercase. (Namespaces are an exception, being case insensitive.) </translate>


Intitle and incategory[edit source]

Word and phrase searches match in a title and match in the category box on bottom of the page. But with these parameters you can select titles only or category only. </translate>

  • cow*


    • Find articles whose title or text contains words that start with cow</translate>
  • intitle:foo


    • Find articles whose title contains foo. Stemming is enabled for foo.</translate>
  • intitle:"fine line"


    • Find articles whose title contains fine line. Stemming is disabled.</translate>
  • intitle:foo bar


    • Find articles whose title contains foo and whose title or text contains bar.</translate>
  • -intitle:foo bar


    • Find articles whose title does not contain foo and whose title or text contains bar.</translate>
  • incategory:Music


    • Find articles that are in Category:Music</translate>
  • incategory:"music history"


    • Find articles that are in Category:Music_history</translate>
  • incategory:"musicals" incategory:"1920"


    • Find articles that are in both Category:Musicals and Category:1920</translate>
  • -incategory:"musicals" incategory:"1920"


    • Find articles that are not in Category:Musicals but are in Category:1920

Intitle and incategory are old search parameters. Incategory no longer searches any subcategory automatically, but you can now add multiple category pagenames manually. </translate>

Template:MW version <translate> Since <tvar|ver>Template:Ll</> Regular expression searches are supported for intitle: </translate>

intitle:/regex/, intitle:/regex/i

<translate> Everything written in the [[<tvar|1>#Regular expression searches</>|#Regular expression searches]] is also valid for these searches, including warnings. </translate>


Deepcategory[edit source]

<translate> Deep category search allows to search in category and all subcategories. The depth of the tree is limited by 5 levels currently (configurable) and the number of categories is limited by 256 (configurable). The deep search uses [[<tvar|1>Special:MyLanguage/Wikidata Query Service/Categories</>|SPARQL Category service from WDQS]]. Keywords are deepcategory or deepcat. Example: </translate>

  • deepcat:"musicals"


    • Find articles that are in Category:Musicals or any of the subcategories.

The DeepCat gadget that previously implemented the parameter was sunsetted in January 2020. </translate>

<translate> Note that some deepcat searches return incomplete results.</translate> <translate> See bug <tvar|1>T246568</> for more details.</translate>


Linksto[edit source]

Linksto finds wikilinks to a given name, not links to content. The input is the canonical, case sensitive, page name. It must match the title line of the content page, exactly, before any title modifications of the letter-case. (It must match its {{FULLPAGENAME}}, e.g. Help:CirrusSearch.) </translate>

<translate> Linksto does not find redirects. It only finds [[wikilinks]], even when they are made by a template.</translate> <translate> It does not find a link made by a URL, even if that URL is an internal wiki link. </translate>

<translate> To find all wikilinks to a "<tvar|hcs>Help:Cirrus Search</>", if "<tvar|helpSearching>Help:Searching</>" and "<tvar|HS>H:S</>" are redirects to it: </translate>

  1. linksto: "Help:Cirrus Search"
  2. linksto: Help:Searching
  3. linksto: H:S

<translate> <tvar|linksto>CirrusSearch -linksto: Help:CirrusSearch</> finds articles that mention "<tvar|CirrusSearch>CirrusSearch</>" but not in a wikilink.

Hastemplate[edit source]

You can specify template usage with <tvar|hastemplate>hastemplate: template</>. Input the canonical pagename to find all usage of the template, but use any of its redirect pagenames finds just that naming. Namespace aliases are accepted, capitalization is entirely ignored, and redirects are found, all in one name-search. (Compare boost-template no default namespace; linksto no namespace aliases, case-sensitive, no redirects; intitle no redirects.)

Hastemplate finds secondary (or meta-template) usage on a page: it searches the post-expansion inclusion. This is the same philosophy as for words and phrases from a template, but here it's for templates from a template. The page will be listed as having that content even though that content is not seen in the wikitext.

  • <tvar|hastempquality>hastemplate: "quality image"</>, finds "<tvar|tempquality>Template:Quality image</>" usage in your default search domain (namespaces).</translate>


  • <tvar|hastportal>hastemplate: portal:contents/tocnavbar</>, finds mainspace usage of a "<tvar|tocnavbar>Contents/TOCnavbar</>" template in the Portal namespace.

For installations with the Translate extension, hastemplate searches get interference wherever Template:Translatable template name wraps the template name of a translatable template. Use insource instead.

Inlanguage[edit source]

For installations with the Translate extension, <tvar|inlang>inlanguage</> is important for highly refined searches and page counts. </translate>

inlanguage: <translate> language code</translate>

<translate> will produce search results in that language only.

For example

  • to count all Japanese pages on the wiki


all: inlanguage: ja


  • to filter out German and Spanish pages in the Help namespace


help: -inlanguage: de -inlanguage: es


  • to ignore Translate, and where English is the base language, add



Contentmodel[edit source]

<translate> The <tvar|contentmodel>contentmodel:</> keyword allows to limit the search to pages of a specific content model. For possible models cf. [[<tvar|cthandle>Special:MyLanguage/Content handlers</>|Content handlers]]. E.g.:

  • To see only JSON pages:




subpageof[edit source]

To find sub-pages. </translate>

subpageof: <translate> ParentPage</translate>

<translate> For example

  • To find all subpages of CirrusSearch.




  • Use double quotes if the parent page contains spaces.


subpageof:"Requests for comment"

<span class="citation wikicite" id="endnote_<translate> unlike prefix:, do not include the page namespace in the keyword value. If you want to limit to sub-pages of a particular namespace use the namespace filter.</translate>">^ 

Articletopic[edit source]

<translate> The <tvar|1>articletopic:</> keyword allows filtering search results by topic. For possible topics see <tvar|2>Template:Ll</>.</translate> <translate> E.g. <tvar|1>articletopic:books</> will filter the search results to articles about books.</translate> <translate> <tvar|1>articletopic:books|films</> will filter to articles about books or films.</translate> <translate> <tvar|1>articletopic:books articletopic:films</> will filter to articles which are about both books and films.</translate>

<translate> Only mainspace articles belong into topics, and topics are only available on Wikipedias.</translate> <translate> Unlike other filters, articletopic also does page weighting: articles which are a stronger match for a topic will be higher in the search results (while articles which aren't about that subject at all will be removed from the result set completely).</translate>

<translate> Topic models are derived via machine learning from <tvar|1>ORES</>.</translate> <translate> Any given article receives a score on dozens of different topics, and therefore may appear under different keywords.</translate> <translate> For instance, the article on Albert Einstein may appear as a "physics" article and a "biography" article.</translate> <translate> All Wikipedias have scores available -- some have local-language topic models that have coverage on all articles.</translate> <translate> Other languages do not have local ORES models, and are using English-language scores assigned to articles in the local language that also exist in English Wikipedia.</translate> <translate> The languages with such "cross-wiki" scores do not have 100% coverage -- depending on the language, it may only be something like 60% of articles that have topics available.</translate>

<translate> Topic-related search data is updated weekly, so recently created articles might not show up in topic-based search queries. </translate>

Pageid[edit source]

<translate> The <tvar|1>pageid:</> keyword restricts search results to the given set of page IDs.</translate> <translate> This is not really useful for manual searching; it can be used by software tools for checking whether a set of pages match the given set of search conditions (e.g. for re-validating cached search results).</translate>


Page weighting[edit source]

Weighting determines snippet, suggestions, and page relevance. The normal weight is one. Additional weighting is given through multipliers.

If the query is just words, pages that match them in order are given a boost. If you add any explicit phrases to your search, or for certain other additions, this "prefer phrase" feature is not applied.

Morelike[edit source]


  • morelike:page name 1|page name 2|...|page name n


    • Find articles whose text is most similar to the text of the given articles.


  • morelike:wasp|bee|ant
    • <translate> Find articles about stinging insects.</translate>
  • morelike:template:search|template:regex|template:usage
    • <translate> Find templates about regex searching for template usage on the wiki.</translate>

<translate> <tvar|more>morelike</> is a "greedy" keyword, meaning that it cannot be combined with other search queries. If you want to use other search queries, use <tvar|morethis>morelikethis</> in your search: </translate>

  • morelikethis:bee hastemplate:"featured article"
    • <translate> Find articles about <tvar|biz>bees</> that also have the "<tvar|tmpl>featured article</>" template.</translate>

<translate> The <tvar|morelike>morelike:</> query works by choosing a set of words in the input articles and run a query with the chosen words. You can tune the way it works by adding the following parameters to the search results URL:

  • <tvar|1>cirrusMltMinDocFreq</>: Minimum number of documents (per shard) that need a term for it to be considered.</translate>


  • <tvar|1>cirrusMltMaxDocFreq</>: Maximum number of documents (per shard) that have a term for it to be considered.</translate>


  • <tvar|1>cirrusMltMaxQueryTerms</>: Maximum number of terms to be considered.</translate>


  • <tvar|1>cirrusMltMinTermFreq</>: Minimum number of times the term appears in the input to doc to be considered. For small fields (<tvar|title>title</>) this value should be 1.</translate>


  • <tvar|1>cirrusMltMinWordLength</>: Minimal length of a term to be considered. Defaults to 0.</translate>


  • <tvar|1>cirrusMltMaxWordLength</>: The maximum word length above which words will be ignored. Defaults to unbounded (0).</translate>


  • <tvar|1>cirrusMltFields</> (comma separated list of values): These are the fields to use. Allowed fields are <tvar|title>title</>, <tvar|text>text</>, <tvar|auxtext>auxiliary_text</>, <tvar|opening>opening_text</>, <tvar|headings>headings</> and <tvar|all>all</>.</translate>


  • <tvar|1>cirrusMltUseFields</> (<tvar|true>true</>|<tvar|false>false</>): use only the field data. Defaults to <tvar|false2>false</>: the system will extract the content of the <tvar|text2>text</> field to build the query.</translate>


  • <tvar|1>cirrusMltPercentTermsToMatch</>: The percentage of terms to match on. Defaults to 0.3 (30 percent).</translate>


  • Example: <tvar|1>&cirrusMtlUseFields=yes&cirrusMltFields=title&cirrusMltMinTermFreq=1&cirrusMltMinDocFreq=1&cirrusMltMinWordLength=2</>

These settings can be made persistent by overriding <tvar|cirrusmlt>cirrussearch-morelikethis-settings</> in [[<tvar|hlpsysmsg>Special:MyLanguage/Help:System message</>|System message]]. </translate>

Prefer-recent[edit source]

<translate> Adding <tvar|pr>prefer-recent:</> anywhere in the query gives recently edited articles a slightly larger than normal boost in the page-ranking rules.</translate> <translate> Prefer-recent is only applied when using the default <tvar|1>relevance</> [[<tvar|2>#Explicit sort orders</>|sort order]].</translate>

<translate> It defaults to boost only 60% of the score, in a large, 160 day window of time, which can be entered in the query as <tvar|pr2>prefer-recent:0.6,160.</> This plays well with other page ranking rules, and is intended for most searches. </translate>

<translate> You can manipulate the rules: <tvar|pr-boost>prefer-recent:boost,recent</></translate> <translate> Technically "boost" is the proportion of score to scale, and "recent" is the half life in days.</translate> <translate> The boost is more than the usual multiplier, it is an exponential boost.</translate> <translate> The factor used in the exponent is the time since the last edit. </translate>

<translate> For example </translate>


<translate> Pages older than 7 days are boosted half as much, and pages older than 14 days are boosted half as much again, and so on.</translate> <translate> For a simple "sort by date" in highly refined search results, where page ranking and boosting are largely meaningless, just boost the entire score.</translate>

  • prefer-recent:1,7 (weeks)
  • prefer-recent:1,1 (days)
  • prefer-recent:1,0.0007 (minutes)
  • prefer-recent:1,0.0001 (8.64 seconds)
  • prefer-recent:1,0.00001 (seconds)


Boost-templates[edit source]

</translate> <translate> You can boost pages' scores based on what templates they contain. This can be done directly in the search via <tvar|bt>boost-templates:""</> or you can set the default for all searches via the <tvar|cbt>MediaWiki:cirrussearch-boost-templates</> message. <tvar|btempty>boost-templates:""</> replaces the contents of <tvar|cbtempty>cirrussearch-boost-templates</> if the former is specified. The syntax is a bit funky but was chosen for simplicity.</translate> <translate> Like prefer-recent, boost-templates is only applied when using the default <tvar|1>relevance</> [[<tvar|2>#Explicit sort orders</>|sort order]].</translate> <translate> Some examples:</translate>

File:boost-templates:"Template:Quality Image|200%" incategory:china


Find files in the China category sorting quality images first.


File:boost-templates:"Template:Quality Image|200% Template:Low Quality|50%" incategory:china


Find files in the China category sorting quality images first and low quality images last.</translate>


<tvar|tqpop>File:boost-templates:"Template:Quality Image|200% Template:Low Quality|50%" popcorn</>
Find files about popcorn sorting quality images first and low quality images last. Remember that through the use of the <tvar|sbt1>cirrussearch-boost-templates</> message this can be reduced to just <tvar|popcorn>popcorn</>.

Don't try to add decimal points to the percentages. They don't work and search scoring is such that they are unlikely to matter much.

A word of warning about <tvar|csbt>cirrussearch-boost-templates</>: if you add really really big or small percentages they can poison the full text scoring. Think, for example, if enwiki boosted featured articles by a million percent. Then searches for terms mentioned in featured articles would find the featured articles before exact title matches of the terms. Phrase matching would be similarly blown away so a search like <tvar|bnws>brave new world</> would find a featured article with those words scattered throughout it instead of the article for Brave New World. </translate>


Regular expression searches[edit source]



<translate> A basic indexed search finds words rendered visible on a page. Hyphenation and punctuation marks and bracketing, slash and other math and computing symbols, are merely boundaries for the words. It is not possible to include them in an indexed search.</translate> <translate> Mostly that search behavior is wanted by the user. However, sometimes one wants to have the ability for a more precise search.</translate>

<translate> To get around the syntactic deficiency of index-based searches regexp searches can be used.</translate> <translate> But as queries with only regexp expressions are very slow and resource consuming, they should always be combined with an index-based search, such that the regexp search-domain gets limited to the results of one or more index-based search.</translate>

<translate> An "exact string" regexp search is a basic search; it will simply "quote" the entire regexp, or "backslash-escape" all non-alphanumeric characters in the string. All regexp searches also require that the user develops a simple filter to generate the search domain for the regex engine to search (index based search domain marked bold, regexp part marked in italics): </translate>

  • insource:"" insource:/debian\.reproducible\.net/
  • insource:"c:\program files (x86)" insource:/C\:\\Program Files \(x86\)/i
  • insource:"<tag>{{template}}</tag>" insource:/"<tag>{{template}}<"\/"tag>"/
  • insource:"[[title|link label]]'s" insource:/"[[title|link label]]'s"/
  • insource:/regexp/ prefix:{{FULLPAGENAME}}

<translate> The last example works from a link on a page, but <tvar|fullpagename>{{FULLPAGENAME}}</> doesn't function in the search box.

For example: <tvar|exampleofsearch>[[Special:Search/insource:/regex/ prefix:{{FULLPAGENAME}}]]</> [[<tvar|exampleofsearch2>Special:Search/insource:/regex/ prefix:Help:CirrusSearch</>| finds the term regex on this page]].

A query with no namespace specified and no prefix specified searches your default search domain, (settable on any search-results page, i.e. at [[<tvar|ss>Special:Search</>]]). Some users keep their default search domain at "all namespaces", i.e. the entire wiki. On a large wiki if this user does a bare regexp search it will probably fail, incurring a timeout, before completing the search. </translate>

<translate> A regex search actually scours each page in the search domain character-by character.</translate> <translate> By contrast, an indexed search actually queries a few records from a database separately maintained from the wiki database, and provides nearly instant results.</translate> <translate> So when using an <tvar|insource>insource://</> (a regexp of any kind), consider creating one the other search terms that will limit the regex search domain as much as possible.</translate> <translate> There are many search terms that use an index and so instantly provide a more refined search domain for the /regexp/. In order of general effectiveness:</translate>


  • insource:"" with quotation marks, duplicating the regexp except without the slashes or escape characters, is ideal.</translate>


  • intitle (without regex search), incategory, and linksto are excellent filters.</translate>


  • hastemplate: is a very good filter.</translate>


  • "word1 word2 word3", with or without the quotation marks, are good.</translate>


  • namespace: is practically useless, but may enable a slow regexp search to complete.


<translate> To test a bare regexp query you can create a page with test patterns, and then use the prefix parameter with that fullpagename.</translate> <translate> The match will be highlighted.</translate> <translate> It searches that page (in the database) and its subpages. </translate>

<translate> Search terms that do not increase the efficiency of a regexp search are the page-scoring operators: morelike, boost-template, and prefer-recent. </translate>


Metacharacters[edit source]

</translate> <translate> This section covers how to escape metacharacters used in regexp searches</translate> <translate> For the actual meaning of the metacharacters see the [<tvar|link1></> explanation of the syntax].</translate>[9]


<translate> For example:

  • to search a namespace, gauge the number of pages with a single term that is a namespace. This will list the number of pages in that namespace.</translate>


  • starting out to find again what you may have seen, like "wiki-link" or "(trans[in]clusion)" start with namespace and insource filters.

Refining with an exact string[edit source]

  • refinining an ongoing search process with what you want to see, like "2 + 2 = 4", or "" This is ideally the best use of regex, because it adds it as a single regexp term while refining a search, the limited number of pages the regexp must crawl is can be seen.

You can start out intending an exact string search, but keep in mind:

  • regex only search the wikitext not the rendered text, so there are some differences around the markup, and even the number of space characters must match precisely.</translate>


  • You are obligated to supply an accompanying filter.</translate>


  • You must learn how to escape regex metacharacters.

There are two ways to escape metacharacters. They are both useful at times, and sometimes concatenated side-by-side in the escaping of a string.

  • Backslash-escape one of them \char. The insource:/regexp/ uses slashes to delimit the regexp. Giving /reg/exp/ is ambiguous, so you must write /reg\/exp/.</translate>


  • Put a string of them in double quotes "string". Because escaping a character can't hurt, you can escape any character along with any possible metacharacters in there. Escaping with quotes is cleaner.</translate>


  • You can't mix methods, but you can concatenate them.

Double-quotes escaping using insource:/"regexp"/ is an easy way to search for many kinds of strings, but you can't backslash-escape anything inside a double-quoted escape.

  • <tvar|pntemp>/"[[page/name|{{temp-late"/</> instead of <tvar|pntemp-late>/\[\[page\/name\|\{\{temp\-late/</>
  • <tvar|literal>/"literal back\slash"/</> is as good as <tvar|literal2>/literal back\\slash/</>
  • But <tvar|thisfails>/"This \" fails"/</> always.
  • And <tvar|thisdepends>/"This \/ depends"/</>. It finds the <tvar|vvv>\/</> literally, which is not the <tvar|slash>/</> you probably wanted.

Backslash-escape using insource:/regexp/ allows escaping the " and / delimiters, but requires taking into account metacharacters, and escaping any:

  • To match a <tvar|slash2>/</> delimiter character use <tvar|vvv2>\/</>.</translate>


  • To match a <tvar|quote>"</> delimiter character use <tvar|slashquote>\"</>.</translate>


  • The escaped metacharacters would be <tvar|grawlix2>\~\@\#\&\*\(\)\-\+\{\}\[\]\|\<\>\?\.\\</>.</translate>


  • The equivalent expression escaped with double-quotes is <tvar|grawlix3>"~@#&*()-+{}[]|\<>?.\"</>.

The simplest algorithm to create the basic string-finding expression using insource:/"regexp"/, need not take metacharacters into account except for the " and / characters:</translate> <translate>

  1. Write <tvar|str_ing>the/str"ing</> out. (The /" delimiters "/ are not shown.)</translate>


  1. Replace <tvar|doublequote>"</> with <tvar|slashdoublequote>"\""</> (previous double-quote: stop, concatenate, quote restart).</translate>


  1. Replace <tvar|slash4>/</> with <tvar|vvv3>"\/"</> (stop, concatenate, start).</translate>


  1. You get <tvar|insource>insource:/"the"\/"str"\""ing"/</>, showing concatenation of the two methods.</translate>


<translate> The square-bracket notation for creating your own character-class also escapes its metacharacters. To target a literal right square bracket in your character-class pattern, it must be backslash escaped, otherwise it can be interpreted as the closing delimiter of the character-class pattern definition.</translate> <translate> The first position of a character class will also escape the right square bracket. Inside the delimiting square brackets of a character class, the dash character also has special meaning (range) but it too can be included literally in the class the same way as the right square bracket can.</translate> <translate> For example both of these patterns target a character that is either a dash or a right square bracket or a dot: <tvar|code1>[-.\]]</> or <tvar|code2>[].\-]</>.</translate>

<translate> For general examples using metacharacters:

  • <tvar|insource0>insource:"2+2=4" insource:/"2+2=4"/</> matches "2 + 2 = 4", with zero spaces between the characters.</translate>


  • <tvar|insource01>insource:"2 + 2 = 4" insource:/2 ?\+ ?2 ?= ?4\./</> match with zero or one space in between. The equals = sign is not a metacharacter, but the plus + sign is.


  • insource:"<tag>[[link|2\3?]]\</tag>" insource:/"<tag>[[link|2\3?]]<"\/"tag>"/

<translate> There are some notable differences from standard regex metacharacters:

  • The <tvar|code1>\n</> or <tvar|code2>\r\n</> are not reserved for matching a newline.</translate> <translate> To search for a string that contains a newline, you can do a search like <tvar|1>insource:/[^\}]\}\}[^\} \|]{2}\<noinclude/i</> which means not a curly brace, then two curly braces, then any two characters except a curly brace, space, or pipe, then a <tvar|2><noinclude></> tag.</translate> <translate> The "any character except" will include a newline in the search.</translate> <translate> Note thas this search was designed only to match to the following string:</translate>



  • The dot . metacharacter stands for any character including a newline, so .* matches across lines.</translate>


  • The number # sign means something, and must be escaped.</translate>[10]


  • The ^ and $ are not needed. Like "grep" (global per line, regular expression, print each line), each insource:// is a "global per document, regular expression, search-results-list each document" per document.</translate>


  • <tvar|1><</> and <tvar|2>></> support a multi-digit numeric range like <tvar|3>[0-9]</> does, but without regard to the number of character positions, or the range in each position, so <tvar|4><9-10></> works, and even <tvar|5><1-111></> works.

Regex on titles[edit source]

</translate> <translate> The <tvar|1>insource</> keyword does only search the page source content.</translate> <translate> To run regex searches on the title strings <tvar|1>intitle:/regex/</> can be used.</translate>


Advanced example[edit source]

For example, using metacharacters to find the usage of a template called Val having, inside the template call, an unnamed parameter containing a possibly signed, three to four digit number, possibly surrounded by space characters, and on the same page, inside a template Val call, a named argument <tvar|fmtcomma>fmt=commas</> having any allowable spaces around it, (it could be the same template call, or a separate one): </translate>

hastemplate:val insource:"fmt commas" insource:/\{\{ *[Vv]al *\|[^}]*fmt *= *commas/ insource:/\{\{ *[Vv]al *\|[^}]*[-+]?[0-9]{3,4} *[|}]/

<translate> Note that the = sign in "fmt commas" is not needed but that adding it would not change the search results.</translate> <translate> It is fast because it uses two filters so that every page the regexp crawls has the highest possible potential.</translate>


Geo Search[edit source]

bounded[edit source]

</translate> <translate> You can limit search to pages identified as being near some specified geographic coordinates.</translate> <translate> The coordinates can either be specified as a <lat>,<lon> pair, or by providing a page title from which to source the coordinates.</translate> <translate> A distance to limit the search to can be prepended if desired.</translate> <translate> Examples:</translate>

  • neartitle:"San Francisco"
  • neartitle:"100km,San Francisco"
  • nearcoord:37.77666667,-122.39
  • nearcoord:42km,37.77666667,-122.39


boosted[edit source]

</translate> <translate> You can alternatively increase the score of pages within a specified geographic area.</translate> <translate> The syntax is the same as bounded search, but with boost- prepended to the keyword.</translate> <translate> This effectively doubles the score for pages within the search range, giving a better chance for nearby search results to be near the top.</translate>

  • boost-neartitle:"San Francisco"
  • boost-neartitle:"100km,San Francisco"
  • boost-nearcoord:37.77666667,-122.39
  • boost-nearcoord:42km,37.77666667,-122.39


File properties search[edit source]

</translate> Template:MW version

<translate> Since MediaWiki 1.28, CirrusSearch supports indexing and searching of properties of files in the <tvar|file>File:</> namespace. This includes:

  • file media type
  • MIME type
  • size
  • width & height
  • resolution
  • bit depth for files that support these




filetype[edit source]

Searching for file type allows to retrieve files according to their classification, such as office documents, videos, raster images, vector images, etc. The following types currently exist: </translate>

  • TEXT

<translate> This list may be extended in the future. See also <tvar|mediatype>MEDIATYPE_*</> constants in <tvar|defines>Defines.php</>.

The syntax of the search is: <tvar|filetype>filetype:{type}</>. Example:

<tvar|ftvideo>filetype:video</> - looks for all videos

The filetype search is not case-sensitive.

filemime[edit source]

Matches file MIME type. The syntax is:

<tvar|filemime>filemime:{MIMEtype}</> - look for files of this MIME type

The argument can be quoted to specify exact match. Without quotes, partial matches to components of MIME type will be accepted too.

Examples: </translate>

  • filemime:"image/png" - <translate> look for files with MIME type exactly <tvar|1>image/png</></translate>
  • filemime:pdf - <translate> look for all PDF documents</translate>
  • -filemime:pdf - <translate> skip all PDF documents (notably on Commons)</translate>

<translate> The MIME type search is not case sensitive.

filesize[edit source]

Search for file of given size, in kilobytes (kilobyte means 1024 bytes). The syntax is: </translate>

  • <translate> <tvar|1>filesize:{number}</> or <tvar|2>filesize:>{number}</></translate> - <translate> file with size at least given number</translate>
  • filesize:<{number} - <translate> file with size no more than given number</translate>
  • filesize:{number},{number} - <translate> file with size between given numbers</translate>

<translate> Examples: </translate>

  • <translate> <tvar|1>filesize:>20</> or <tvar|2>filesize:20</></translate> - <translate> files 20KB and bigger</translate>
  • filesize:<1024 - <translate> files smaller than 1MB</translate>
  • filesize:100,500 - <translate> files with sizes between 100KB and 500KB</translate>


File measures[edit source]

It is possible to search for specific file measures: width, height, resolution (which is defined as square root of height × width), and bit depth. Not all files may have these properties. The syntax is: </translate>

  • {measure}:{number} - <translate> file with measure that equals to given number</translate>
  • {measure}:>{number} - <translate> file with measure that is at least given number</translate>
  • {measure}:<{number} - <translate> file with measure that is no more than given number</translate>
  • {measure}:{number},{number} - <translate> file with measure that is between given numbers</translate>

<translate> Where <tvar|measure>measure</> can be:

<tvar|filew1>filew</> or <tvar|filew2>filewidth</> - file width

<tvar|fileh1>fileh</> or <tvar|fileh2>fileheight</> - file height

<tvar|fres>fileres</> - file resolution (see above)

<tvar|fbd>filebits</> - file bit depth


<tvar|fw800>filew:>800 fileh:>600</> - files that are at least 800x600 pixels in size

<tvar|fb16>filebits:16</> - files with 16-bit color depth

<tvar|fh100k>fileheight:100,500</> - file between 100 and 500 pixels high

Wikibase search[edit source]

</translate> <translate> The <tvar|1>Template:Ll</> extension defines some search keywords in order to make it easier to search for certain Wikibase items. This is useful on <tvar|2>Template:Ll</> and other Wikibase sites, including to search for images with Structured data on Wikimedia Commons.</translate> <translate> See <tvar|1>Template:Ll</> for details.</translate>


Cross-wiki search results[edit source]

The search on Wikimedia projects includes [[<tvar|iwsearch>Special:MyLanguage/Cross-wiki Search Result Improvements</>|improved]] cross-wiki search results (also known as interwiki search results, sister projects search results). </translate>


Explicit sort orders[edit source]

</translate> <translate> In addition to the default relevance based sort CirrusSearch can provide results a few other explicit sort orders.</translate> <translate> Specifying a sorting order other than <tvar|1>relevance</> will disable all search keywords that affect scoring, such as <tvar|2>prefer-recent</> or <tvar|3>boost-templates</>.</translate> <translate> The keywords will still be parsed, but they will have no effect.</translate>

<translate> Sorting options are currently available from the MediaWiki API by providing the <tvar|1>srsort</> parameter.

Sorting options can be manually added to a search URL by adding <tvar|1>&sort=order</>, for example <tvar|2></>.

Valid sort orders include: </translate>

<translate> Sort order</translate> <translate> Description</translate>
incoming_links_asc <translate> Lowest to highest number of incoming links.</translate> <translate> This is approximately from least to most popular.</translate>
incoming_links_desc <translate> Highest to lowest number of incoming links.</translate> <translate> This is approximately from most to least popular.</translate>
last_edit_asc <translate> From least recently to most recently edited</translate>
last_edit_desc <translate> From most to least recently edited</translate>
create_timestamp_asc <translate> From least to most recently created</translate>
create_timestamp_desc <translate> From most to least recently created</translate>
just_match <translate> A simple relevance sort based only on text matching</translate>
relevance <translate> A relevance sort taking into account many features of the document</translate>
random <translate> Randomized</translate>
none <translate> Unsorted, arbitrarily ordered lists.</translate> <translate> Preferred for large result sets.</translate>


Interface for advanced options[edit source]

[[<tvar|image-asi>File:AdvSearch Screen 20170620.png</>|thumb|Advanced Search Interface]]

The [[<tvar|url>Special:MyLanguage/Extension:AdvancedSearch</>|AdvancedSearch]] extension adds an improved interface to the search page allowing the use of several options described above in a user-friendly manner. See [[<tvar|hlpadvsearch>Special:MyLanguage/Help:AdvancedSearch</>|here for the user manual]].

See also[edit source]



  • [[<tvar|completion>Extension:CirrusSearch/CompletionSuggester</>|Completion Suggester]] - the incremental search feature of CirrusSearch</translate>


  • [[<tvar|glossary>Wikimedia Discovery/Search/Glossary</>]] - definitions, context, and links for terms related to search.</translate>


  • See [[<tvar|oldsearch>Search/Old#Timeline</>]] for more on the development and debut of of CirrusSearch.</translate>


  • See [[<tvar|helps>Special:MyLanguage/Help:Searching</>|Help:Searching]] for MWSearch, used by the many wikis that don't have a search extension.

External links[edit source]



Notes and references[edit source]


  1. <translate> Note that the [[<tvar|tagline>Special:MyLanguage/Manual:Tagline (Site Subtitle)</>|tagline]] is not part of the actual content. To see the searchable content for a page append <tvar|cirrusdump>?action=cirrusdump</> to the URL.</translate>
  2. <translate> Stop words are rarely called for in CirrusSearch, except for when they are in certain kinds of phrases, as explained below.</translate>
  3. <translate> CirrusSearch parameters do not use a consistent way to handle these search terms.</translate>
  4. <translate> [<tvar|elanalyers></> The same analyzer] used to index the wikitext is also used to interpret the query.</translate>
  5. <translate> For example, common terms on this wiki,, are, redundantly, (searched):</translate> <translate>
    • udp2log or udp2log2 (though the extra 2 will affect ranking)
    • html2wt or wt2html
    • log2ip or ip2log
    There's test2wiki, wiki2xml, wiki2dict, apache2handler, apache2ctl, etc. </translate>
  6. <translate> CirrusSearch regex do not address the newline character directly, but a dot <tvar|dot>.</> will match a newline.</translate>
  7. <translate> A slow regex search cannot disable search, but can disable another's regex search, since there are only a limited number of regex searches allowed at a time.</translate>
  8. <translate> Prefix does not match on first-characters of fullpagenames, so you cannot search two namespaces at once just because they start with the same letters, such as both namespace and namespace talk in one query.</translate>
  9. <translate> For the formal definition see the [<tvar|link2></> Lucene grammar for regular expressions].</translate>
  10. <translate> [<tvar|url></> Class RegExp], Lucene RegExp syntax</translate>

[[Category:Search{{#translation:}}]] [[Category:Help{{#translation:}}]]