Help:CirrusSearch/cs

Nejrychlejší způsob, jak najít informace v projektech Wikimedie, je přímé vyhledání. Na každé stránce je pole .

CirrusSearch je rozšíření MediaWiki, které využívá Elasticsearch k poskytování vylepšených vyhledávacích funkcí oproti výchozímu vyhledávání MediaWiki. Nadace Wikimedia používá CirrusSearch pro všechny projekty Wikimedie. Tento článek popisuje vlastnosti CirrusSearch. Pokud zde není vaše otázka zodpovězena, můžete ji položit na diskusní stránce a někdo vám na ni odpoví.

Informace o rozšíření MediaWiki naleznete na stránce.

Pro jeho použití na Wikidata, se podívejte na.



Jak na to
Zadejte klíčová slova a fráze a stiskněte Enter nebo Return na klávesnici. Nebo klikněte na ikonu lupy, tlačítko Hledat (search) nebo Přejít (go). Pokud má stránka stejný název, jaký jste zadali, budete na tuto stránku přesměrováni. V opačném případě prohledá všechny stránky na wiki a zobrazí seznam článků, které odpovídají vašim hledaným výrazům, nebo zprávu informující, že žádná stránka neobsahuje všechna klíčová slova a fráze.

Pokud kliknete na tlačítko "", aniž byste cokoliv vyplnili, budete přesměrováni na stránku "Special:Search", která vám nabízí další možnosti vyhledávání (také dostupné z libovolného seznamu výsledků vyhledávání)

Může být užitečné omezit vyhledávání na stránky v určitém jmenném prostoru, např. hledat pouze na stránkách. Zkontrolujte jmenné prostory, které pro toto vyhledávání požadujete.



Co se zlepšilo?
CirrusSearch poskytuje tři hlavní zlepšení oproti výchozímu vyhledávači MediaWiki a to:


 * Lepší služby pro vyhledávání v různých jazycích.
 * Rychlejší obnovení indexování, takže změny ve článcích se odrazí ve výsledcích vyhledávání daleko dříve.
 * Rozšíření na šablony a tím i veškerý obsah zapsaný v šablonách se nyní zobrazí i ve výsledcích hledání.



Jak často se aktualizuje index vyhledávání?
There are two primary search indexes to consider:

The first is full-text search, on Special:Search. This index is updated in near real time. Změny stránek by se měly zobrazit ve výsledcích vyhledávání okamžitě. Změny šablon by se měly u článků, které šablonu obsahují, projevit během několika minut, ale může to také trvat až několik hodin v závislosti na počtu stránek používajících šablonu. Editace beze změny článku prosadí změny šablon, ale není to třeba, pokud nedojde k chybě.

The second index to consider is the fuzzy auto-complete title search. This index is updated once a day and mirrors what was found in the full-text search index at the time the index was updated. Depending on timing a new page could take two days to be found in the fuzzy title autocomplete. If this is unacceptable for a particular use case, within user search options the title completion can be changed to classic prefix search which uses the full-text search index.



Návrhy na vyhledávání
Návrhy vyhledávání, které se vám zobrazí, když zadáte text do vyhledávacího pole, které rozbalí kandidátské stránky, jsou seřazeny podle hrubé míry kvality článku. To bere v úvahu počet příchozích wikilinků, velikost stránky, počet externích odkazů, počet nadpisů a počet přesměrování. Návrhy vyhledávání lze přeskočit a dotazy přejdou přímo na stránku s výsledky vyhledávání. Před dotaz přidejte vlnovku. Příklad "~Frida Kahlo". Návrhy vyhledávání se budou i nadále zobrazovat, ale stisknutím klávesy Enter se kdykoli dostanete na stránku s výsledky vyhledávání.

Přízvuk/diakritika jsou pro některé jazyky zapnuty. Podrobnosti jsou specifické pro daný jazyk.



Fultextové vyhledávání
"Fulltextové vyhledávání" je "indexované vyhledávání". Všechny stránky jsou uloženy ve wiki databázi a všechna slova na stránkách bez přesměrování jsou uložena ve vyhledávací databázi, která je indexem prakticky celého textu wiki. Každé viditelné slovo je indexováno v seznamu stránek, kde se nachází, takže hledání slova je stejně rychlé jako vyhledání jediného záznamu. Kromě toho, pro jakékoli změny ve znění, je index vyhledávání aktualizován během několika sekund.

Existuje mnoho rejstříků "plného textu" wiki, které usnadňují mnoho typů potřebných vyhledávání. Celý wikitext je mnohokrát indexován do mnoha speciálních rejstříků, z nichž každý analyzuje wikitext jakýmkoli a různým způsobem optimalizuje jeho použití. Příklady indexů zahrnují:


 * "Doplňkový" text, zahrnuje horní poznámky, titulky, ToC a jakýkoli wikitext klasifikovaný pomocí HTML atributu class=searchaux.
 * Úvodní text je wikitext mezi horní částí stránky a prvním nadpisem.
 * Text "kategorie" indexuje výpisy ve spodní části.
 * Šablony jsou indexovány. Pokud se přeložená slova šablony změní, aktualizují se všechny stránky, které ji převádějí. (To může trvat dlouho v závislosti na frontě úloh.) Pokud se změní podšablony používané šablonou, index se aktualizuje.
 * Obsah dokumentu, který je uložen ve jmenném prostoru File/Media, je nyní indexován. Jsou rozpoznány tisíce formátů.

Je zde podpora pro většinu jazyků, která se rozšiřuje o další. Na webu elasticsearch.org je seznam momentálně podporovaných jazyků, podívejte se na jejich dokumentaci přispívání zasíláním požadavků nebo oprav. K podpoře dalších jazyků, které Elasticsearch nepokrývá, se také používají open-source knihovny třetích stran.

CirrusSearch optimalizuje váš dotaz a spustí jej. Výsledné tituly jsou váženy podle relevance a intenzivně post-zpracovány, 20 najednou, pro stránku s výsledky vyhledávání. Z článku se shromažďují například úryvky a hledané výrazy jsou zvýrazněny tučně.

Výsledky vyhledávání budou často doprovázeny různými předběžnými zprávami. Patří mezi ně Měli jste na mysli (oprava pravopisu), a pokud by jinak nebyly nalezeny žádné výsledky, zobrazí se Zobrazují se výsledky pro (oprava dotazu) a hledat místo toho (váš dotaz).

Funkce vyhledávání také zahrnují:


 * Řazení navigačních návrhů podle počtu příchozích odkazů.
 * Počínaje znakem vlnovky  pro deaktivaci navigace a návrhů takovým způsobem, aby bylo zachováno hodnocení stránky.
 * Chytré porovnávání znaků normalizací (nebo "skládáním") neklávesnicových znaků do znaků klávesnice.
 * Shodující se slova a fráze jsou na stránce s výsledky vyhledávání zvýrazněny tučně. Zvýrazňovač je kosmetický analyzátor, zatímco analyzátor indexování vyhledávání stránku skutečně najde, a ta nemusí být 100% synchronizovaná, zejména u regulárních výrazů. Zvýrazňovač může odpovídat více či méně přesněji než indexátor.



Slova, fráze a modifikátory
Základní hledaný výraz je slovo nebo "fráze v uvozovkách". Podrobnosti se liší podle jazyka, zejména u jazyků bez mezer, ale vyhledávání obvykle rozpozná "slovo" jako:


 * řetězec číslic
 * řetězec písmen
 * dílčí slova v přechodech mezi písmeny a číslicemi, například v txt2regex
 * podslova uvnitř složeného názvu pomocí camelCase

"Stop word" (stop slovo) je slovo, které je ignorováno (protože je běžné nebo z jiných důvodů). Seznam stop words je specifický pro jazyk a ne všechny jazyky podporují stop slova. Daný hledaný výraz se shoduje s obsahem (vykresleným na stránce). Chcete-li místo toho najít shodu s wikitextem, použijte vyhledávací parametr insource (viz sekce níže). Každý parametr vyhledávání má svůj vlastní index a interpretuje daný termín svým vlastním způsobem.

Mezery mezi slovy, frázemi, parametry a vstupy do parametrů mohou obsahovat velké množství bílých znaků a šedých znaků (greyspace characters). "Šedé znaky" jsou všechny nealfanumerické znaky ~!@#$%^&_+-={}|[]\:";'<>?,./ . Smíšený řetězec šedých znaků a bílých znaků je "šedý prostor" (greyspace) a je považován za jednu velkou hranici slova. Greyspace je způsob, jakým se vytvářejí indexy a interpretují dotazy.

Dvě výjimky jsou případy, kdy 1) vložená:dvojtečka je jedno slovo (zachází se s ním jako s písmenem) a 2) vložená čárka, , jako například v 1,2,3 , je považována za číslo. Znaky šedého prostoru jsou jinak ignorovány, pokud je nelze kvůli syntaxi dotazu interpretovat jako modifikační znaky.

Modifikátory jsou ~ * \? - " ! . V závislosti na jejich umístění v syntaxi se mohou vztahovat na termín, parametr nebo na celý dotaz. Modifikátory slov a frází jsou vyhledávány pomocí zástupných znaků, promixity (vyhodnocování blízkosti) a fuzzy vyhledávání (vyhledávání přibližných shod). Každý parametr může mít své vlastní modifikátory, ale obecně platí:


 * Hledání fuzzy slov nebo fuzzy frází může mít jako příponu znak tilda  (plus číslo udávající stupeň).
 * Znak tilda $tilda před prvním výrazem dotazu zaručuje výsledky hledání namísto jakékoli možné navigace.
 * Zástupný znak uvnitř slova může být ukončující otazník \? pro jeden znak nebo hvězdička * hvězdička pro nula nebo více znaků.
 * Truth-logic (pravdivostní logika) umí interpretovat AND a OR, ale parametry už ne. Všimněte si, že operátory AND a OR v současnosti nefungují tradičním způsobem truth-logic! Podrobnosti viz logické operátory.
 * Truth-logic ví, že - nebo ! předponou před termínem se invertuje obvyklý význam termínu z "match" (shoda) na "exclude" (vyloučit).


 * Quotes (citace) kolem slov označují hledání "přesné fráze". U parametrů jsou také potřebné k oddělování víceslovného vstupu.
 * Stemming (odvozování) je automatický, ale lze jej vypnout pomocí "exact phrase" (přesné fráze).

Hledání fráze může být zahájeno různými nápovědami pro vyhledávač. Každá metoda nápověd má vedlejší účinek na to, jak tolerantní bude shoda slovní sekvence. Tipy pro greyspace, camelCase nebo txt2number:


 * daný words-joined_by_greyspace(characters) nebo wordsJoinedByCamelCaseCharacters najde words joined by ... characters, v jejich holé formě nebo ve formě šedého prostoru.
 * txt2number bude odpovídat  nebo.
 * Zastavovací slova jsou povolena pro okrajové případy (na periferii) fráze grey_space nebo camelCase. Příkladem použití the, of a a je, že the_invisible_hand_of_a odpovídá  v textu.

Hlášení "search instead" (hledej místo toho) se spustí, když je ve frázi ignorováno všeobecně neznámé slovo.

Každý z následujících typů frázové shody obsahuje a rozšiřuje toleranci shody předchozího:


 * "Přesná fráze" "v uvozovkách" bude tolerovat (shodovat se) šedý prostor. Zadaný "exact_phrase" nebo "exact phrase" odpovídá.
 * Greyspace_phrase iniciuje kontrolu stop a stop word.
 * Daný CamelCase bude dodatečně odpovídat, všechna písmena malá, protože CirrusSearch nerozlišuje malá a velká písmena při shodě. Upozorňujeme, že shoda CamelCase není povolena pro všechny jazyky.

Některé parametry interpretují fráze šedého prostoru, ale jiné parametry, například, interpretují pouze obvyklou "frázi v uvozovkách".

Všimněte si, že všechny stemmingy nerozlišují malá a velká písmena.

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, character inside a number.

Given, CirrusSearch, when in an "exact phrase" context, (which includes the insource parameter context), will not match  ,  , or  , but will then only match.

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.

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. Now camelcase matches camelCase because Search is not case sensitive, but camelCase matches camelcase because camelCase is more aggressive. 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.

From the table we can surmise that the basic search parser_function -"parser function" is the sum of the basic searches  and.

Making inquiries with numbers, we would find that:


 * Plan9 or Plan_9 matches any of:,  ,  ,  ,
 * "plan9" only matches  (case insensitive)
 * Plan*9 matches  or.

The star * wildcard matches a string of letters and digits within a rendered word, but never the beginning character. One or more characters must precede the * character.


 * When * matches numbers, a comma is considered part of one number, but the decimal point is considered a greyspace character, and will delimit two numbers.
 * Inside an "exact phrase" * is treated as a greyspace character and not a wild card character, so it delimits words.

The \? wildcard represents one letter or number; *\? is also accepted, but \?* 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 ~ 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, "exact one two phrase"~2 matches.
 * 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 word~0.5 ( 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 word~2 is most fuzzy with an edit distance of 2 (default), and word~1 is least fuzzy, and word~0 is not fuzzy at all.

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. (In other words, add twice the number of segments). For the full proximity algorithm, see Elasticsearch slop.

Citace vypínají stopování, "but appending"~ vlnovka reaktivuje stopování.

Insource
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: insource: "state state autocollapse" matches.

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. 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. 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. Often the best candidate to add to the regex query insource:/arg/ is insource:arg, where arg is the same (and uses no wildcards).

The syntax for the regexp is insource: no space, and then /regexp/. (No other parameter disallows a space. All the parameters except 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 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.

Prefix and namespace
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.

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.

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

When File is involved, a namespace modifier  has an effect, otherwise it is ignored.

Namespace aliases are accepted.

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

The prefix: parameter matches any number of first-characters of all pagenames in one namespace. 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 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.

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

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

Exclude content from the search index
Content can be excluded from the search index by adding. This will instruct CirrusSearch to ignore this content from the search index (see for more context).

Additionally content can be marked as auxiliary information by adding. 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 and 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
 * Najděte články, jejichž název neobsahuje foo a jejichž nadpis nebo text obsahuje lištu.
 * 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.

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

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.

Note that some deepcat searches return incomplete results. See bug for more details.

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

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

finds articles that mention "CirrusSearch" but not in a wikilink.

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

Articletopic
The articletopic: keyword allows filtering search results by topic. For possible topics see. 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
 * Vyhledá články, jejichž text je podobný textu uvedených článků.
 * morelike:wasp|bee|ant
 * Najít články o bodavém hmyzu.
 * morelike:template:search|template:regex|template:usage
 * Najít články o vyhledávacím způsobu regex pro použití šablony na 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.

Dotaz morelike: funguje tak, že ve vstupních článcích vybere sadu slov a spustí dotaz s vybranými slovy. Způsob, jakým to funguje, můžete vyladit přidáním následujících parametrů do adresy URL výsledků vyhledávání:

These settings can be made persistent by overriding  in System message.
 * 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 ( | ): use only the field data. Defaults to : the system will extract the content of the   field to build the query.
 * cirrusMltPercentTermsToMatch : The percentage of terms to match on. Defaults to 0.3 (30 percent).
 * Example:

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  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
Hledání můžete urychlit specifikováním, které šablony stránky používají. Toho se dá docílit přímo vepsáním  do vyhledávacího pole nebo můžete nastavit toto hledání zapnutím nové vlajky. přepíše obsah vlajky, pokud je fráze specifikovaná. Syntaxe je trochu neohrabaná, ale byla zvolena pro svou jednoduchost. Like prefer-recent, boost-templates is only applied when using the default  sort order. Some examples:


 * File:boost-templates:"Template:Quality Image|200%" incategory:china
 * Najde soubory v kategorii China se seřazením od nejkvalitnějších obrázků.


 * File:boost-templates:"Template:Quality Image|200% Template:Low Quality|50%" incategory:china
 * Najde soubory v kategorii China se seřazením s nejkvalitnějšími obrázky na vrchu a nejméně kvalitními jako poslední.


 * 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  message this can be reduced to just.

Nepřidávejte desetinná místa do procent. Nefungují a výsledky vyhledávání by pak nemusely odpovídat.

A word of warning about : if you add really huge 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  would find a featured article with those words scattered throughout it instead of the article for Brave New World.

Regular expression searches
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:"&lt;tag>{ {template}}&lt;/tag>" insource:/"&lt;tag>{ {template}}&lt;"\/"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: 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.

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:

To search for a string that contains a newline, you can do a search like  which means not a curly brace, then two curly braces, then any two characters except a curly brace, space, or pipe, then a  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:
 * The  or   are not reserved for matching a newline.


 * The dot  metacharacter stands for any character including a newline, so   matches across lines.
 * The number  sign means something, and must be escaped.
 * 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   does, but without regard to the number of character positions, or the range in each position, so   works, and even   works.

Substitutions for some metacharacters
While character classes,  ,   are not supported, in case of an acute need to use them in a regular expression, you may use these workarounds:

In these ranges, " " (space) is used as the character immediately following control characters, "!" – the character immediately following it, and "􏿽" as the U+10FFFD character, which is the last allowed 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.


 * instead of
 * is as good as
 * But  always.
 * And .  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   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 , showing concatenation of the two methods.

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:"[ [link|2\3?]]\" insource:/"[ [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  having any allowable spaces around it, (it could be the same template call, or a separate one):



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 and

bounded
You can limit search to pages identified as being near some specified geographic coordinates. The coordinates can either be specified as a &lt;lat>,&lt;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
Since MediaWiki 1.28, CirrusSearch supports indexing and searching of properties of files in the  namespace. This includes:
 * file media type
 * MIME type
 * size
 * width & height
 * resolution
 * bit depth for files that support these

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:



This list may be extended in the future. See also  constants in.

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
 * 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  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 extension defines some search keywords in order to make it easier to search for certain Wikibase items. This is useful on and other Wikibase sites, including to search for images with Structured data on. See 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. 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  will disable all search keywords that affect scoring, such as   or. The keywords will still be parsed, but they will have no effect.

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

 Guidance: 

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



 Valid sort orders include: 

Interface for advanced options


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.