Help:CirrusSearch

This page is a translated version of the page Help:CirrusSearch and the translation is 31% complete.
PD Let op: Als u deze pagina bewerkt, gaat u akkoord met het vrijgeven van uw bijdragen onder de CC0. Zie Helppagina’s Publiek Domein voor meer informatie. PD

De snelste manier om informatie op Wikimedia-projecten te vinden, is door rechtstreeks te zoeken. Op elke pagina bevindt zich een veld zoeken.

CirrusSearch is een MediaWiki extensie die gebruikmaakt van Elasticsearch om de standaard zoekfunctie van MediaWiki van geavanceerde zoekfuncties te voorzien. De Wikimedia Foundation gebruikt CirrusSearch op alle Wikimedia-projecten. Deze pagina beschrijft de functies van CirrusSearch. Indien u hier geen antwoord vindt op uw vraag, kunt u op de overlegpagina terecht, waar iemand ze zal beantwoorden.

Voor informatie over de MediaWiki extensie : Extension:CirrusSearch .

Voor het gebruik op Wikidata, zie Help:Extension:WikibaseCirrusSearch .

Hoe het werkt

Voer zoekwoorden en woordgroepen (phrases) in, en druk op ↵ Enter of Return op het toetsenbord of gebruik het vergrootglas, Zoeken of de knop Ga.

Als een pagina dezelfde titel heeft als die u hebt ingevoerd, springt u rechtstreeks naar die pagina. Anders doorzoekt het alle pagina's op de wiki en presenteert het een lijst met artikelen die overeenkomen met uw zoektermen, of een bericht dat u informeert dat geen enkele pagina alle sleutelwoorden en woordgroepen bevat.

Als u op de knop "Zoeken" klikt zonder iets in te vullen, wordt u naar Special:Search geleid, wat u extra zoekopties geeft (ook beschikbaar in elke lijst met zoekresultaten)

Het kan handig zijn om een zoekopdracht te beperken tot pagina's binnen een bepaalde namespace, bijvoorbeeld alleen zoeken binnen de pagina's User. Controleer de namespaces die u nodig hebt voor deze zoekopdracht.

Alle hieronder vermelde sleutelwoorden zijn hoofdlettergevoelig en in kleinere letters.

Wat is er verbeterd?

CirrusSearch biedt drie grote verbeteringen ten opzichte van de standaard MediaWiki-zoekfunctie, namelijk:

  • Betere ondersteuning voor het zoeken in andere talen.
  • Sneller bijwerken van de zoekindex, wat betekent dat veranderingen in artikelen veel sneller in de zoekresultaten worden weergegeven.
  • Uitbreiding van sjablonen, wat betekent dat alle inhoud uit een sjabloon nu wordt weergegeven in de zoekresultaten.

Hoe vaak wordt de zoekindex bijgewerkt?

Er zijn twee belangrijkste zoekindexen die u moet overwegen:

De eerste is de full-text zoeken, op Special:Search. Deze index wordt in bijna realtime bijgewerkt. Veranderingen in pagina's moeten binnen enkele minuten in de zoekresultaten verschijnen, maar 30 minuten wordt nog steeds als normale werking beschouwd. Veranderingen van sjablonen moeten binnen enkele minuten van kracht worden in artikelen die het sjabloon bevatten, het kan tot en met enkele uren duren, afhankelijk van het aantal pagina's dat het sjabloon gebruikt. Een 'null' bewerking in het artikel zal de wijziging forceren, maar dat zou niet nodig moeten zijn als alles goed gaat.

De tweede index die u moet overwegen is het fuzzy auto-complete zoeken op titel. Deze index wordt één keer per dag bijgewerkt en weerspiegelt wat in de volledige zoekindex is gevonden op het moment dat de index werd bijgewerkt. Afhankelijk van de timing kan het bij een nieuwe pagina twee dagen duren om te worden gevonden in de fuzzy titel autocomplete. Als dit onaanvaardbaar is voor een bepaald gebruik, kan binnen de zoekopties voor gebruikers het aanvullen van de titel worden gewijzigd in klassiek zoeken naar voorvoegsels die de zoekindex voor full-text zoeken gebruikt.

Zoeksuggesties

De zoeksuggesties die u krijgt wanneer u typt in het zoekvak dat naar de kandidatenpagina's wordt weergegeven, zijn gesorteerd op basis van een ruwe maatstaf voor de kwaliteit van het artikel. Hierbij wordt rekening gehouden met het aantal inkomende wikilinks, de grootte van de pagina, het aantal externe links, het aantal koppen en het aantal doorverwijzingen.

Zoeksuggesties kunnen worden overgeslagen en queries gaan direct naar de zoekresultatenpagina. Voeg een tilde ~ toe voor de query. Voorbeeld: "~Frida Kahlo". De zoeksuggesties worden nog steeds weergegeven, maar als u op elk gewenst moment op de Enter-toets drukt, gaat u naar de pagina met zoekresultaten.

Voor sommige talen is het accent/diacritische opvouwen ingeschakeld; de details zijn taalspecifiek.

The algorithm used to rank suggestions is described in more detail at Extension:CirrusSearch/CompletionSuggester#Ranking criteria.

Zoeken in volledige tekst

Een "zoeken in volledige tekst" is een "zoeken op index". Alle pagina's worden opgeslagen in de wiki-database, en alle woorden in de niet-doorverwijspagina's worden bewaard in de zoekdatabase, die een index is voor de praktisch volledige tekst van de wiki. Elk zichtbaar woord wordt geïndexeerd in de lijst met pagina's waar het wordt gevonden, dus een zoekopdracht naar een woord is net zo snel als het opzoeken van een enkel record.[1] Voorts wordt de zoekindex binnen enkele seconden bijgewerkt na eventuele wijzigingen in de tekst.

Er zijn veel indexen van de "volledige tekst" van de wiki om de vele soorten zoekopdrachten die nodig zijn te vergemakkelijken. De volledige wikitext wordt vaak geïndexeerd op vele indexen voor speciale doeleinden, waarbij elk de wikitext op de manier analyseert die het gebruik optimaliseert. Voorbeelden van indexen zijn:

  • "Hulptekst", inclusief "hatnotes", bijschriften, inhoudsopgave en alle wikitext die is geclassificeerd met een HTML-attribuut class=searchaux.
  • "Lead-in" tekst is de wikitext tussen de bovenkant van de pagina en de eerste kop.
  • De tekst "categorie" indexeert de aanbiedingen onderaan.
  • Sjablonen zijn geïndexeerd. Als de getranscludeerde woorden van een sjabloon veranderen, worden alle pagina's die het transcluderen bijgewerkt. (Dit kan lang duren, afhankelijk van een taakwachtrij.) Als de subsjablonen die door een sjabloon worden gebruikt, veranderen, wordt de index bijgewerkt.
  • Documentinhoud die is opgeslagen in de namespace File/Media wordt nu geïndexeerd. Duizenden formaten worden herkend.

Er is ondersteuning voor tientallen talen, maar alle talen zijn gewild. Er is een lijst van de nu ondersteunde talen op elasticsearch.org; zie hun documentatie over bijdragen om verzoeken of patches in te dienen. Er worden Open source bibliotheken van derden gebruikt om aanvullende talen te ondersteunen die niet onder Elasticsearch vallen.

CirrusSearch zal uw query optimaliseren en uitvoeren. De resulterende titels worden gewogen op relevantie en sterk nabewerkt, 20 tegelijk, voor de zoekresultatenpagina. Bijvoorbeeld, uit het artikel worden fragmenten gehaald en in de tekst worden zoekwoorden in een dikke tekst benadrukt.

Zoekresultaten gaan vaak vergezeld van verschillende voorlopige rapporten. Deze omvatten Bedoelde u (spellingcorrectie), en als er anders geen resultaten zouden worden gevonden, staat er Resultaten weergeven voor (querycorrectie) en zoeken in plaats van (uw zoekopdracht).

Zoekfuncties omvatten ook:

  • Sorteren van navigatievoorstellen naar het aantal inkomende links.
  • Begin met het tilde-tekens ~ om navigatie en suggesties te uitschakelen op een manier die ook de paginavolgorde behoudt.
  • Smart-matching karakters door niet-toetsenbord karakters te normaliseren (of weer te geven) in toetsenbord karakters.
  • Op de zoekresultatenpagina worden woorden en woordgroepen die overeenkomen, in het gedrukte getal onderstreept. De highlighter is een cosmetische analyse hulpmiddel, terwijl de zoek-indexing analyzer de pagina eigenlijk vindt, en deze kunnen niet 100% synchroniseren, vooral voor reguliere expressies. De highlighter kan meer of minder nauwkeurig overeenkomen met de indexator.

Woorden, woordgroepen en modifiers

De basis zoekterm is een woord of een "woordgroep tussen aanhalingstekens". Details variëren per taal, vooral voor talen zonder spaties, maar zoekmachines herkennen meestal een "woord" als:

  • een reeks cijfers
  • een reeks letters
  • Subwoorden tussen letters/cijferovergangen, zoals in txt2regex
  • subwoorden in een samengestelde naam met behulp van CamelCase

Een "stopwoord" is een woord dat wordt genegeerd (omdat het gebruikelijk is, of om andere redenen). De lijst met stopwoorden is taal-specifiek en niet alle talen ondersteunen stopwoorden.[2] Een bepaalde zoekterm komt overeen met content (weergegeven op de pagina). Om in plaats daarvan te matchen met wikitext, gebruikt u de zoekparameter insource (zie sectie hieronder). Elke zoekparameter heeft zijn eigen index en interpreteert de gegeven term op zijn eigen manier.[3]

Spatiëring tussen woorden, woordgroepen, parameters en invoer van parameters kan royale gevallen van witruimte en grijsruimtetekens omvatten. "Grijsruimtetekens" zijn alle niet-alfanumerieke ~!@#$%^&()_+-={}|[]\:";'<>?,./ karakters. Een gemengde reeks van grijsruimtetekens en witruimtetekens, is 'grijsruimte' en wordt behandeld als één grote woordgrens. Grijsruimte is de manier waarop indexen worden gemaakt en queries worden geïnterpreteerd.[4]

Twee uitzonderingen zijn waar 1) een embedded:colon één woord is (het wordt behandeld als een letter), en 2) een ingesloten komma ,, zoals in 1,2,3, wordt behandeld als een getal. Grijsruimtetekens worden anders genegeerd, tenzij ze vanwege de querysyntaxis kunnen worden geïnterpreteerd als wijzigingstekens.

De modificatoren zijn ~ * \? - " ! . Afhankelijk van de plaatsing in de syntaxis kunnen ze worden toegepast op een term, een parameter of op een hele query. Woord- en woordgroepmodificaties zijn de wildcard, nabijheid en fuzzy zoekopdrachten. Elke parameter kan zijn eigen modificatoren hebben, maar in het algemeen:

  • Een fuzzy-woord of fuzzy-woordgroep in zoekopdracht kan een tilde ~ karakter (en een getal dat de graad vertelt) achtervoegen.
  • Een tilde ~-teken voor de eerste term van een query garandeert zoekresultaten in plaats van eventuele navigatie.
  • Een wildcard teken in een woord kan een (escaped) vraagteken zijn \? voor één teken of een asterisk * voor nul of meer tekens.
  • Logica kan AND en OR interpreteren, maar parameters niet. Merk op dat de operatoren AND en OR nu niet op de traditionele logica functioneren! Zie voor meer informatie logische operatoren.
  • Logica begrijpt - of ! die aan een term voorafgaan om de gebruikelijke betekenis van de term om te keren van "matchen" naar "uitsluiten".
Woorden die beginnen met - of !, zoals -in-law of !Kung kunnen exact overeenkomen met titels en doorverwijzingen, maar zullen ook overeenkomen met elk document dat niet het ontkende woord bevat, wat meestal bijna alle documenten zijn. Als u wilt zoeken naar andere termen dan exacte overeenkomsten voor titels of doorverwijzingen, gebruikt u de zoekparameter insource (zie sectie hieronder).
  • Citaten rond woorden markeren een zoekopdracht naar "exacte uitdrukking". Voor parameters zijn zij ook nodig om de invoer van meer woorden aan te geven.
  • Stammen is automatisch, maar kan worden uitgeschakeld met behulp van een "exacte woordgroep".
De twee wildcard-tekens zijn de ster en het (escaped) vraagteken, en beide kunnen in het midden of aan het einde van een woord komen. Het escaped vraagteken \? staat voor één teken en de ster * staat voor een aantal tekens. Omdat veel gebruikers in plaats van een query te schrijven, een query stellen, wordt elk vraagteken genegeerd tenzij ze doelbewust escaped worden van de wildcard betekenis van \?.

Een woordgroepzoekopdracht kan worden geïnitieerd door verschillende hints naar de zoekmachine. Elke methode van hinten heeft als neveneffect hoe tolerant de afstemming van de woordvolgorde zal zijn. Voor greyspace, camelCase of txt2number hints:

  • gegeven words-joined_by_greyspace(characters) of wordsJoinedByCamelCaseCharacters vindt het words joined by... characters, in hun kale of grijsruimte vormen.
  • txt2number zal overeenkomen met txt 2 number of txt-2.number.
  • Stopwoorden zijn ingeschakeld voor de randgevallen (in de rand) van een grijsruimte of camelCase-woordgroep. Een voorbeeld met the, of, en a is dat the_invisible_hand_of_a overeenkomt met invisible hand binnen de tekst meetings invisible hand shake.

Een "zoek in plaats daarvan" wordt aangedreven wanneer een algemeen onbekend woord in een woordgroep wordt genegeerd.

Elk van de volgende soorten overeenkomstige woordgroepen bevat en verruimt de overeenkomst-tolerantie van het vorige:

  • Een "exacte woordgroep" "in citaten" zal (matchen met) grijsruimte tolereren. Als "exact_phrase" of "exact phrase" wordt gegeven, komt het overeen met "exact]phrase".
  • Een grijsruimte-woordgroep initieert stam- en stopwoord controles.
  • Met CamelCase zal het aanvullend overeenkomen met camelcase, in alle kleine letters, omdat CirrusSearch niet hoofdlettergevoelig is bij het matchen. Merk op dat het CamelCase matchen niet voor alle talen is ingeschakeld.

Sommige parameters interpreteren grijsruimte-woordgroepen, maar andere parameters, zoals insource, interpreteren alleen de gebruikelijke "woordgroep in citaten".

In zoekterminologie betekent ondersteuning voor "stammen" dat een zoekopdracht voor "swim" ook "swimming", "swimmed" bevat, maar niet onregelmatige vormen zoals "swam".
Woordgroep zoeken parserfunction parserFunction parser function parser-function parser:function parSer:funcTion
parserfunction      N  N  N  N
"parser function"  N  N      N  N
parser_function  N        N  N
parserFunction          N  N
"parser:function"  N  N  N  N    
"parser_function"  N  N      N  N
"parSer_funcTion"  N  N      N  N
parSer_FuncTion  N  N        

Let op, het gebruik van stammen is niet hoofdlettergevoelig!

Let op hoe de zoekopdracht "exacte woordgroep" het teken embedded:colon als een letter interpreteert, maar niet het embedded_underscore. Het vergelijkbare vindt plaats met de komma , in een getal.

Op basis van in:this:word zal CirrusSearch, wanneer het zich in een context van 'exacte woordgroep' bevindt (inclusief de context van de parameter insource), niet overeenkomen met in, this of word, maar zal het dan alleen overeenkomen met in:this:word.

Onthoud anders dat voor CirrusSearch woorden letters, cijfers of een combinatie van de twee zijn, hoofdletters doen er niet toe.

De gewone woordzoeker maakt gebruik van het spatieteken en is agressief met stammen, en wanneer dezelfde woorden worden vergezeld door grijsruimtetekens of camelCase, zijn ze agressief met woordgroepen en subwoorden.

Wanneer in een grijsruimte-woordgroep gebruikelijke woorden zoals "van" of "de" worden opgenomen, worden ze genegeerd, zodat ze agressiever overeenkomen.

Een gijsruimte-woordgroep zoekterm, een camelCase of een txt2number term komt overeen met de aangegeven woorden. U kunt elk van die drie vormen gebruiken.[5] camelcase komt overeen met camelCase omdat Search niet gevoelig is voor hoofdletters, maar camelcase past bij camelcase omdat camelCase agressiever is. Net als de rest van Search zijn de subwoorden "woorden" niet gevoelig voor hoofdletters. Bij vergelijking is de "exacte woordgroep" grijsruimte georiënteerd en negeert hij de numerieke of letter-case overgangen en stemming. "woordgroepen tussen quotes" zijn niet gevoelig voor hoofdletters.

Uit de tabel kunnen we vermoeden dat het basiszoeken parser_function -"parser function" de som is van het zoeken parserFunction en parser<stems> function<stems>.

Door met nummers te zoeken, zouden we zien dat:

  • plan9 of Plan_9 past bij elk van: plan9, plans 9, planned 9th, (planned) 9.2, "plans" (9:24)
  • "plan9" past bij plan9 (hooflettergevoelig)
  • Plan*9 past bij plan9 en planet4589.

De ster *, het jokerteken komt overeen met een reeks letters en cijfers binnen een opgebouwde woord, maar nooit het beginteken. Een of meer tekens moeten aan het * teken voorafgaan.

  • Wanneer * overeenkomt met getallen, wordt een komma beschouwd als onderdeel van een getal, maar het decimale punt wordt beschouwd als een grijsruimte-teken en zal het als twee getallen zien.
  • Binnen een "exacte woordgroep" wordt * behandeld als een grijsruimte-teken en niet als een wildcardteken, dus het scheidt de woorden.

De \? wildcard vertegenwoordigt één letter of nummer; *\? wordt ook geaccepteerd, maar \?* wordt niet erkend.

De wildcards zijn voor basiswoord, woordgroep en insource zoekopdrachten, en kunnen ook een alternatief zijn voor (sommige) geavanceerde reguliere expressie zoekopdrachten (later behandeld).

Het plaatsen van een tilde ~ teken na een woord of woordgroep activeert een fuzzy zoekopdracht.

  • Voor een woordgroep wordt het een nabijheid (proximity) zoekopdracht genoemd, omdat nabijheid woorden worden getolereerd tot een benadering in plaats van exacte woordgroep.
  • Bijvoorbeeld, "exact one two phrase"~2 komt overeen met exact phrase.
  • Voor een woord betekent het extra tekens of gewijzigde tekens.
  • Voor een woordgroep vereist een fuzzy zoeken een geheel getal dat aangeeft hoeveel extra woorden er in passen, maar voor een woord kan een fuzzy zoekopdracht een decimale breuk hebben, standaard als word~0.5 (word~.5), waarbij maximaal twee letters verwisseld, veranderd of toegevoegd kunnen worden gevonden, maar nooit de eerste twee letters.
  • Voor een dichtbijzijn woordgroep kan een groot aantal worden gebruikt, maar dat is een "dure" (langzame) zoekopdracht.
  • Voor een woord is word~2 het meest fuzzy met een bewerkingsafstand van 2 (voorkeur), en $wordtild9 is het minst fuzzy, en $wordtillde12 is helemaal niet fuzzy.
flowers algernon Flowers for Algernon flowers are for Algernon Flowers a1 2b 3c 4f 5j 6l 7j 8p q9 z10 for Algernon
"flowers algernon"    N  N  N
"flowers algernon"~0    N  N  N
"flowers algernon"~1      N  N
"flowers algernon"~2        N
"flowers algernon"~11        
"algernon flowers"~1  N  N  N  N
"algernon flowers"~2    N  N  N
"algernon flowers"~3      N  N
"algernon flowers"~4        N
"algernon flowers"~13        

Voor de nabijheid die nodig is om in omgekeerde (rechts naar links) volgorde te overeenkomen, tel en verwerpt u alle extra woorden en voeg dan twee keer de totale telling van de overgebleven woorden minus één toe. (Met andere woorden, voeg twee keer zoveel delen toe als het aantal delen). Voor het volledige algoritme voor nabijheid zie Elasticsearch slop.

Quotes sluiten het stammen uit, "but appending"~ de tilde reactiveert het stammen.

flowers flower Flowers for Algernon flower for Algernon
flowers         Stammen is actief.
"flowers"    N    N Nabijheid zoeken schakelt stammen uit.
"flowers"~         Nabijheid plus stammen door het toevoegen van een tilde.
"flowers for algernon"  N  N    N Nabijheid zoeken schakelt stammen uit.
"flowers for algernon"~  N  N     Nabijheid plus stammen door het toevoegen van een tilde.
"flowers algernon"~1  N  N    N Nabijheid zoeken schakelt stammen uit.
"flowers algernon"~1~  N  N     Nabijheid plus stammen door het toevoegen van een tilde.

Insource

1.24
Gerrit change 137733

Insource-zoekopdrachten kunnen worden gebruikt om elk woord te vinden dat op een pagina wordt weergegeven, maar het is gemaakt voor het vinden van elke woordgroep die u zou kunnen vinden - inclusief MediaWiki opmaak (ook bekend als wikicode), op elke pagina behalve doorverwijzingen. Deze woordgroep gaat volledig voorbij aan grijsruimte: insource: "state state autocollapse" komt overeen met |state={{{state|autocollapse}}}.

insource: word
insource: "word1 word2"
Grijsruimte tekens worden genegeerd, net als bij woordzoeken en zoekopdrachten met exacte woordgroepen.
insource:/regexp/
insource:/regexp/i
Dit zijn reguliere expressies. Ze zijn niet efficiënt, dus er zijn er maar een paar tegelijk toegestaan in het zoekcluster, maar ze zijn erg krachtig. De reguliere expressie is standaard hoofdlettergevoelig. Met de extra i kan worden gekozen voor hoofdletterongevoeligheid, wat nog minder efficiënt is.

Insource complementeert zichzelf. Aan de ene kant heeft het een volledige tekstzoekopdracht voor elk woord in de wikitext, onmiddellijk. Aan de andere kant kan het een reguliere expressie zoekopdracht verwerken voor elke string.[6] Een regex scant alle teksten in een bepaalde lijst van pagina's; ze hebben geen woordindex om dingen te versnellen, en het proces wordt onderbroken als het langer dan twintig seconden loopt. De regexs lopen als laatste in een query, dus om onnodige scanning op karakterniveau te beperken, moet elke regex query andere zoekwoorden bevatten om het aantal documenten dat gescand moet worden te beperken.[7] Vaak is de beste kandidaat om toe te voegen aan de regex-query insource:/arg/ insource:/arg/ 2, waarbij arg hetzelfde is (en geen jokertekens gebruikt).

De syntaxis voor de regex is $source geen spatie en dan /regexp/. (Geen andere parameter verbiedt een spatie. Alle parameters behalve insource:/regexp/ accepteren spatie na de dubbele punt.)

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

  • Both search wikitext only.
  • Neither finds things "sourced" by a transclusion.
  • Neither does stemmed, fuzzy, or proximity searches.
  • Both want the fewest results, and both work faster when accompanied by another clause.

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. 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. See #Regular expression searches below.

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.
When possible, please avoid running a bare regexp search. See how this is always possible at #Regular expression searches, below.
To search for words that begin with - or !, such as -in-law or !Kung, use a case-insensitive insource query together with a simple search on the "plain" version of the term (to avoid a bare regexp search). For example, "in-law" insource:/-in-law/i or "kung" insource:/!kung/i.

Voorvoegsel en naamruimte

Prepending a namespace term like file: to a search query limits results to a specific namespace , instead of searching the entire wiki. The default namespace is "Main".

Only one namespace name can be set from the search box query. It must be the first term in the query, or, if used as part of a prefix: term, must appear as the last term in the query.

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. Your search domain, as a profile of namespaces, can be set here. The namespaces list will then present itself on the first page of future search results to indicate the search domain of the search results. To unset this, select the default namespace (shown in parentheses), select "Remember", and press Search.

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. 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.

A namespace term overrides the search bar, and a prefix: term overrides a namespace.

To specify a namespace name, prefix it with a colon, e.g., talk:. Use all: to search across all namespaces, or : (a single colon) to search just the main article namespace.

The all: term does not include the File: namespace, which includes media content held at Commons such as PDF, which are all indexed and searchable. When File is involved, a namespace modifier local: has an effect, otherwise it is ignored.

As with search parameters, local: and all: must be lowercase. Namespaces names, though, are case insensitive.

Namespace aliases are accepted.

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

prefix:

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

Given a namespace only, prefix: will match all its pagenames. Given one character only, it cannot be - (dash), ' (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. This term always goes at the end, so that pagename characters may contain quotation marks (").

prefix:cow Find pages in mainspace whose title starts with the three letters c o w.
domestic   prefix:cow Find pages in mainspace whose title starts with the three letters c o w, and that contain the word "domestic".
domestic   prefix:cow/ List any existing subpages of Cow but only if they contain the word "domestic". This is a very common search and is frequently built using a special URL parameter called prefix=.
domestic   prefix:Talk:cow/ List any subpages of Talk:cow, but only if they contain the word "domestic".
1967   prefix:Pink Floyd/ List any subpages of Pink Floyd, but only if it also contains the word "1967".

The Translate extension creates a sort of "language namespace" of translated versions of a page. However, unlike namespace or prefix, which create the initial search domain, the inlanguage parameter is a filter of it. (See the next section.)

Inhoud uitsluiten van de zoekindex

Content can be excluded from the search index by adding class="navigation-not-searchable". This will instruct CirrusSearch to ignore this content from the search index (see taak T162905 for more context).

Additionally content can be marked as auxiliary information by adding class="searchaux". 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. This distinction is used for items such as image thumbnail descriptions, 'see also' sections, etc.

Filters

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

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.) 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).

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

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

Intitle en incategory

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.

  • cow*
    • Find articles whose title or text contains words that start with cow
  • intitle:foo
    • Find articles whose title contains foo. Stemming is enabled for foo.
  • intitle:"fine line"
    • Find articles whose title contains fine line. Stemming is disabled.
  • intitle:foo bar
    • Find articles whose title contains foo and whose title or text contains bar.
  • -intitle:foo bar
    • Find articles whose title does not contain foo and whose title or text contains bar.
  • incategory:Music
    • Find articles that are in Category:Music
  • incategory:"music history"
    • Find articles that are in Category:Music_history
  • incategory:"musicals" incategory:"1920"
    • Find articles that are in both Category:Musicals and Category:1920
  • -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.

1.31
Gerrit change 413896

Since MediaWiki 1.31-wmf.23 Regular expression searches are supported for intitle:

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

Everything written in the #Regular expression searches is also valid for these searches, including warnings.

When possible, please avoid running a bare regexp search. See how this is always possible at #Regular expression searches, below.

Deepcategory

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 SPARQL Category service from WDQS. Keywords are deepcategory or deepcat. Example:

  • 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.

Linksto

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/nl.)

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

To find all wikilinks to a "Help:Cirrus Search", if "Help:Searching" and "H:S" are redirects to it:

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

CirrusSearch -linksto: Help:CirrusSearch finds articles that mention "CirrusSearch" but not in a wikilink.

Hastemplate

You can specify template usage with 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.

  • hastemplate: "quality image", finds "Template:Quality image" usage in your default search domain (namespaces).
  • hastemplate: portal:contents/tocnavbar, finds mainspace usage of a "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

For installations with the Translate extension, inlanguage is important for highly refined searches and page counts.

inlanguage: language code

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
inlanguage:en

Contentmodel

The contentmodel: keyword allows to limit the search to pages of a specific content model. For possible models cf. Content handlers. E.g.:

  • To see only JSON pages:
contentmodel:json

subpageof

To find sub-pages.

subpageof: ParentPage

For example

  • To find all subpages of CirrusSearch.
subpageof:CirrusSearch
  • Use double quotes if the parent page contains spaces.
subpageof:"Requests for comment"
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.

Articletopic

The articletopic: keyword allows filtering search results by topic. For possible topics see Help:CirrusSearch/articletopic . E.g. articletopic:books will filter the search results to articles about books. articletopic:books|films will filter to articles about books or films. articletopic:books articletopic:films will filter to articles which are about both books and films.

Only mainspace articles belong into topics, and topics are only available on Wikipedias. 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).

Topic models are derived via machine learning from ORES. Any given article receives a score on dozens of different topics, and therefore may appear under different keywords. For instance, the article on Albert Einstein may appear as a "physics" article and a "biography" article. All Wikipedias have scores available -- some have local-language topic models that have coverage on all articles. 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. 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.

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

Pageid

The pageid: keyword restricts search results to the given set of page IDs. 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).

Page weighting

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

  • 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
    • Find articles about stinging insects.
  • morelike:template:search|template:regex|template:usage
    • Find templates about regex searching for template usage on the wiki.

morelike is a "greedy" keyword, meaning that it cannot be combined with other search queries. If you want to use other search queries, use morelikethis in your search:

  • morelikethis:bee hastemplate:"featured article"
    • Find articles about bees that also have the "featured article" template.

The 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:

  • cirrusMltMinDocFreq: Minimum number of documents (per shard) that need a term for it to be considered.
  • cirrusMltMaxDocFreq: Maximum number of documents (per shard) that have a term for it to be considered.
  • cirrusMltMaxQueryTerms: Maximum number of terms to be considered.
  • cirrusMltMinTermFreq: Minimum number of times the term appears in the input to doc to be considered. For small fields (title) this value should be 1.
  • cirrusMltMinWordLength: Minimal length of a term to be considered. Defaults to 0.
  • cirrusMltMaxWordLength: The maximum word length above which words will be ignored. Defaults to unbounded (0).
  • cirrusMltFields (comma separated list of values): These are the fields to use. Allowed fields are title, text, auxiliary_text, opening_text, headings and all.
  • cirrusMltUseFields (true|false): use only the field data. Defaults to false: the system will extract the content of the text field to build the query.
  • cirrusMltPercentTermsToMatch: The percentage of terms to match on. Defaults to 0.3 (30 percent).
  • Example:
    &cirrusMtlUseFields=yes&cirrusMltFields=title&cirrusMltMinTermFreq=1&cirrusMltMinDocFreq=1&cirrusMltMinWordLength=2
    

These settings can be made persistent by overriding cirrussearch-morelikethis-settings in System message.

Prefer-recent

Adding prefer-recent: anywhere in the query gives recently edited articles a slightly larger than normal boost in the page-ranking rules. Prefer-recent is only applied when using the default relevance sort order.

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 prefer-recent:0.6,160. This plays well with other page ranking rules, and is intended for most searches.

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

For example

prefer-recent:,7

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. For a simple "sort by date" in highly refined search results, where page ranking and boosting are largely meaningless, just boost the entire score.

  • 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

You can boost pages' scores based on what templates they contain. This can be applied to all search queries by declaring boosts via MediaWiki:Cirrussearch-boost-templates, or ad-hoc in individual queries via the boost-templates:"" operator. If the boost-templates operator is set in a query, then the contents of cirrussearch-boost-templates are ignored. Similar to the prefer-recent feature, boost-templates is applied as part of the default relevance sort order. It has no effect on other search orders.

The syntax of the message is as follows:

  • Everything from a # character to the end of the line is considered a comment, and ignored.
  • Every non-blank line is interpreted as the exact name of a template that should receive boosting (including namespace prefix), followed by a pipe "|" character, followed by a number, followed by a "%" character.

Good examples:

 Template:Important|150%
 Template:Very_Very_Important|300%
 Template:Less_important|50%

Bad examples:

 Template:Foo|150.234234% # decimal points are not allowed.
 Foo|150% # technically valid, but acts on transclusions of Foo (main space article) instead of Template:Foo.

Some examples:

boost-templates:"Template:Quality_Image|200%" incategory:china
Find files in the China category, sorting quality images first.
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.
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 cirrussearch-boost-templates message this can be reduced to just popcorn.

Decimal points are not permitted in percentage values. Search scoring is such that fractions of a percent are unlikely to make a difference.

Beware that if you add very low or very high percentages via cirrussearch-boost-templates, they can poison the full-text scoring. For example, if Wikipedia were to boost the "Featured article" template by 1 million percent, then, searches for any term mentioned in featured articles, would rank the featured article above even the dedicated article about that term.

Phrase matching would be similarly blown away, so a search like brave new world would return a featured article as first result even if it merely has those three words mentioned throughout it, instead of the more relevant article about Brave New World itself.

Regular expression searches

  Waarschuwing: Do not run a bare insource:/regexp/ search. It will probably timeout after 20 seconds anyway, while blocking the queries of responsible users.

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. Mostly that search behavior is wanted by the user. However, sometimes one wants to have the ability for a more precise search.

To get around the syntactic deficiency of index-based searches regexp searches can be used. 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.

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):

  • insource:"debian.reproducible.net" 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}}

The last example works from a link on a page, but {{FULLPAGENAME}} doesn't function in the search box.

For example: [[Special:Search/insource:/regex/ prefix:{{FULLPAGENAME}}]] 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 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.

A regex search actually scours each page in the search domain character-by character. By contrast, an indexed search actually queries a few records from a database separately maintained from the wiki database, and provides nearly instant results. So when using an insource:// (a regexp of any kind), consider adding other search terms that will limit the regex search domain as much as possible. 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:

  • insource:"" with quotation marks, duplicating the regexp except without the slashes or escape characters, is ideal.
  • intitle (without regex search), incategory, and linksto are excellent filters.
  • hastemplate: is a very good filter.
  • "word1 word2 word3", with or without the quotation marks, are good.
  • namespace: is practically useless, but may enable a slow regexp search to complete.

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

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

Metacharacters

This section covers how to escape metacharacters used in regexp searches. For the actual meaning of the metacharacters see the explanation of the syntax.[9]

The use of an exact string requires a regexp, but the regexp term obligates the search to limit itself. Add a regexp term, never search a bare regexp. Start by noting the number of pages in a previous search before committing an exact string search. Querying with an exact string requires a filtered search domain.

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

There are some notable differences from standard regex metacharacters:

  • The \n or \r\n are not reserved for matching a newline.

To search for a string that contains a newline, you can do a search like 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 ‎<noinclude> tag. The "any character except" will include a newline in the search. Note thas this search was designed only to match to the following string:

}}

<noinclude>
  • The dot . metacharacter stands for any character including a newline, so .* matches across lines.
  • The number # sign means something, and must be escaped.

[10]

  • The ^ and $ are not implemented. 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.
  • < and > support a multi-digit numeric range like [0-9] does, but without regard to the number of character positions, or the range in each position, so <9-10> works, and even <1-111> works.

Substitutions for some metacharacters

While character classes \n, \s, \S are not supported, in case of an acute need to use them in a regular expression, you may use these workarounds:

PCRE CirrusSearch Description
\n [^ -􏿿] A newline (also can find a tabulation character)
[^\n] [ -􏿿] Any character except for a newline (and tabulation; you can add it to character set to include it as well)
\s [^!-􏿿] A white space character: space, newline, or tabulation
\S [!-􏿿] Any character except for white space characters (not a space, not a newline, and not a tabulation)

In these ranges, " " (space) is used as the character immediately following control characters, "!" – the character immediately following it, and "􏿿" as the U+10FFFF character, which is the last character in Unicode. Thus, the range from " " to "􏿿" includes all characters except for control ones, of which articles may contain newlines and tabs, while the range from "!" to "􏿿" includes all characters except for control ones and the space.

Refining with an exact string

  • refining an ongoing search process with what you want to see, like "2 + 2 = 4", or "site.org" 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.
  • You are obligated to supply an accompanying filter.
  • 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/.
  • 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.
  • 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.

  • /"[[page/name|{{temp-late"/ instead of /\[\[page\/name\|\{\{temp\-late/
  • /"literal back\slash"/ is as good as /literal back\\slash/
  • But /"This \" fails"/ always.
  • And /"This \/ depends"/. It finds the \/ literally, which is not the / 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 / delimiter character use \/.
  • To match a " delimiter character use \".
  • The escaped metacharacters would be \~\@\#\&\*\(\)\-\+\{\}\[\]\|\<\>\?\.\\.
  • The equivalent expression escaped with double-quotes is "~@#&*()-+{}[]|\<>?.\".

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

  1. Write the/str"ing out. (The /" delimiters "/ are not shown.)
  1. Replace " with "\"" (previous double-quote: stop, concatenate, quote restart).
  1. Replace / with "\/" (stop, concatenate, start).
  1. You get insource:/"the"\/"str"\""ing"/, showing concatenation of the two methods.
While refining a regexp on a search results page, keep in mind that the snippet "wikitext" has modified spacing. Regex are sensitive to space characters, so copying from snippets is dangerous.

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. 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. For example both of these patterns target a character that is either a dash or a right square bracket or a dot: [-.\]] or [].\-].

For general examples using metacharacters:

  • insource:"2+2=4" insource:/"2+2=4"/ matches "2 + 2 = 4", with zero spaces between the characters.
  • 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>"/

Regex on titles

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

Advanced example

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 fmt=commas having any allowable spaces around it, (it could be the same template call, or a separate one):

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

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

Geo Search

Searching based on the (primary) coordinates associated with pages. Depends on Extension:GeoData and {{#coordinates:}}

bounded

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

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

boosted

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

  • 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

1.28
Gerrit change 311061

Since MediaWiki 1.28, CirrusSearch supports indexing and searching of properties of files in the File: namespace. This includes:

  • file media type
  • MIME type
  • size
  • width & height
  • resolution
  • bit depth for files that support these
While these predicates are useful only for files, they by themselves do not limit search to the File: namespace. It is recommended to include this namespace in a search or restrict the search to only this namespace when using these conditionals.

filetype

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:

  • UNKNOWN
  • BITMAP
  • DRAWING
  • AUDIO
  • VIDEO
  • MULTIMEDIA
  • OFFICE
  • TEXT
  • EXECUTABLE
  • ARCHIVE

This list may be extended in the future. See also MEDIATYPE_* constants in Defines.php.

The syntax of the search is: filetype:{type}. Example:

filetype:video - looks for all videos

The filetype search is not case-sensitive.

filemime

Matches file MIME type. The syntax is:

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:

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

The MIME type search is not case-sensitive.

filesize

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

  • filesize:{number} or filesize:>{number} - file with size at least given number
  • filesize:<{number} - file with size no more than given number
  • filesize:{number},{number} - file with size between given numbers

Examples:

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

File measures

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:

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

Where measure can be:

filew or filewidth - file width

fileh or fileheight - file height

fileres - file resolution (see above)

filebits - file bit depth

Examples:

filew:>800 fileh:>600 - files that are at least 800×600 pixels in size

filebits:16 - files with 16-bit color depth

fileheight:100,500 - file between 100 and 500 pixels high

Wikibase search

The Wikibase extension defines some search keywords in order to make it easier to search for certain Wikibase items. This is useful on Wikidata and other Wikibase sites, including to search for images with Structured data on Wikimedia Commons . See Help:WikibaseCirrusSearch for details.

Cross-wiki search results

There are two kinds of cross-wiki results that may be shown when searching on Wikipedia.

Cross-project search (also known as interwiki search, sister search, or sister projects search) shows additional results from other projects (Wiktionary, Wikisource, Wikiquote, etc.) shown to the side on the Wikipedia results page. Cross-project search is available on most Wikipedias with sister projects.

Cross-language search (see blog post) refers to additional results shown below the main results that are from a Wikipedia in a different language. Cross-language search uses a heavily modified and optimized version of a light-weight language detector called TextCat . Cross-language search is currently only available on a few Wikipedias (see TextCat link for details).

Explicit sort orders

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

Sorting options are currently available from the MediaWiki API by providing the srsort parameter.

Guidance:

Sorting options can be manually added to a search URL by adding &sort=order, for example:

Valid sort orders include:

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

Interface for advanced options

 
Advanced Search Interface

The AdvancedSearch extension adds an improved interface to the search page allowing the use of several options described above in a user-friendly manner. See here for the user manual.

See also

  • See Help:Zoeken for MWSearch, used by the many wikis that don't have a search extension.

External links

Notes and references

  1. Merk op dat de tagline (site subtitel) geen deel uitmaakt van de eigenlijke inhoud. Om de doorzoekbare inhoud voor een pagina te zien, voeg ?action=cirrusdump toe aan de URL.
  2. Stopwoorden worden zelden in CirrusSearch gebruikt, behalve wanneer ze in bepaalde soorten woordgroepen staan, zoals hieronder wordt uitgelegd.
  3. CirrusSearch-parameters gebruiken geen consistente manier om deze zoekwoorden te behandelen.
  4. Dezelfde analyzer die wordt gebruikt om de wikitext te indexeren, wordt ook gebruikt om de query te interpreteren.
  5. Bijvoorbeeld, veel voorkomende termen op deze wiki, MediaWiki.org, zijn, redundant, (gezocht):
    • udp2log of udp2log2 (hoewel de extra 2 van invloed zijn op de rangschikking)
    • html2wt of wt2html
    • log2ip of ip2log
    Er zijn test2wiki, wiki2xml, wiki2dict, apache2handler, apache2ctl, etc.
  6. CirrusSearch regex (reguliere expressie) adresseert het teken voor de nieuwe regel niet rechtstreeks, maar een punt . overeenkomt met een nieuwe regel.
  7. Een trage regex zoekopdracht kan de zoekopdracht niet uitschakelen, maar kan de regex zoekopslag van een ander uitschakelen omdat er slechts een beperkt aantal regex zoekopdrachten per keer toegestaan zijn.
  8. 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.
  9. For the formal definition see the Lucene grammar for regular expressions.
  10. Class RegExp, Lucene RegExp syntax