הדרך המהירה ביותר למצוא מידע במיזמי ויקימדיה היא לחפש אותו באופן ישיר. בכל דף ישנה תיבת "חיפוש".
CirrusSearch היא הרחבת מדיה ויקי שמשתמשת ב-Elasticsearch כדי לספק יכולות חיפוש משופרות ביחס לחיפוש ברירת המחדל של מדיה ויקי. קרן ויקימדיה משתמשת ב-CirrusSearch עבור כל מיזמי ויקימדיה. דף זה מתאר את המאפיינים והאפשרויות של CirrusSearch. אם השאלה שלכם לא נענתה כאן, אפשר לשאול אותה בדף השיחה ומישהו יענה עליה.
למידע על הרחבת מדיה ויקי, ראו Extension:CirrusSearch .
למידע על השימוש בה בויקינתונים, ראו Help:Extension:WikibaseCirrusSearch .
איך זה עובדיש להזין מילות מפתח וביטויים ולהקיש "Enter" במקלדת, או ללחוץ על סמל זכוכית המגדלת, כפתור "חיפוש", או "Go".
אם יש דף ששמו זהה למחרוזת החיפוש, תנווטו ישירות אליו. אחרת, החיפוש יתבצע בכל הדפים בוויקי ויציע רשימה של ערכים שמתאימים למחרוזת החיפוש, או שתתקבל הודעה שתיידע אותכם על כך שלא נמצא דף שמכיל את כל מילות החיפוש.
בלחיצה על לחצן "חיפוש" ללא מילוי מידע כלשהו, תועברו לדף "Special:Search" המכיל אפשרויות חיפוש נוספות (אליהן ניתן להגיע גם מדף התוצאות של חיפוש רגיל).
אפשרות שימושית היא הגבלה של תוצאות החיפוש למרחב שם מסוים, למשל חיפוש רק בדפי User. בחרו את מרחבי השם הרצויים לחיפוש.
את כל מילות המפתח המופיעות להלן יש לכתוב באותיות קטנות (lowercase).
מה השתפר?CirrusSearch כוללת שלושה שיפורים עיקריים ביחס לחיפוש ברירת המחדל של MediaWiki:
קיימים שני אינדקסי חיפוש:
הראשון הוא חיפוש בטקסט המלא, ב"Special:Search". האינדקס הזה מתעדכן כמעט בזמן אמת. שינויים בדפים אמורים להופיע בתוצאות החיפוש תוך כמה דקות, אך גם זמן עדכון של חצי שעה נחשב לתקין. שינויים בתבניות אמורים להשתקף בערכים המכילים את התבניות בתוך דקות, אך עלול להיווצר עיכוב של עד כמה שעות בהתאם לכמות הדפים המשתמשים בתבנית. עריכה ריקה בדף תכפה את עדכון השינוי שבוצע בתבנית המוכלת בו, אך פעולה זו אינה נדרשת כשהכל עובד בצורה תקינה.
האינדקס השני הוא זה שאחראי להשלמה האוטומטית של כותרות ערכים בתיבת החיפוש, באמצעות התאמת מחרוזות מקורבת (fuzzy search). האינדקס הזה מתעדכן אחת ליום, ומשקף את מה שנמצא באינדקס של חיפוש הטקסט המלא בזמן העדכון. כתלות בתזמון, ייתכן שיעברו יומיים עד שכותרתו של דף חדש תופיע באינדקס של השלמת הכותרות האוטומטית. במקרים בהם זהו אינו זמן סביר, מתוך אפשרויות החיפוש של המשתמש ניתן לשנות את השלמת הכותרות כך שתתבסס על אינדקס החיפוש של טקסט מלא.
הצעות חיפושבזמן שמקלידים לתוך תיבת החיפוש נפתחת תחתיה רשימה עם הצעות, הממויינת לפי מדד מקורב של איכות הערכים. מדד זה לוקח בחשבון את כמות הדפים המקשרים אל הערך, את גודלו, ואת כמויות הקישורים החיצוניים, כותרות המשנה, וההפניות.
ניתן לדלג על הצעות חיפוש ושאילתות יועברו ישירות לדף תוצאות החיפוש. לשם כך, הוסיפו טילדה ~
לפני השאילתה. לדוגמה: "~פרידה קאלו". הצעות החיפוש עדיין יופיעו, אך לחיצה על מקש Enter בכל עת תעביר אותך לדף תוצאות החיפוש.
התעלמות מסימנים דיאקריטיים (למשל, התייחסות אל é כאל e) מופעלת בשפות מסוימות; הפרטים משתנים משפה לשפה.
The algorithm used to rank suggestions is described in more detail at Extension:CirrusSearch/CompletionSuggester#Ranking criteria.
חיפוש בטקסט מלא"חיפוש בטקסט מלא" הוא "חיפוש באמצעות אינדקס". כל הדפים שמורים במסד הנתונים של הויקי, וכל המילים בדפים שאינם דפי הפניה שמורות במסד הנתונים של החיפוש, שהוא למעשה אינדקס לטקסט המלא של הויקי. האינדקס קושר בין כל מילה לבין רשימת הדפים בהם היא נמצאת, כך שחיפוש מילה בין כל דפי הויקי מתבצע במהירות של חיפוש רשומה בודדת.[1] בנוסף, כל שינוי במילים מתעדכן באינדקס בתוך שניות.
קיימים אינדקסים שונים של "הטקסט המלא" של הויקי, כדי לייעל את סוגי החיפוש השונים שמתאימים למטרות שונות. טקסט הויקי המלא ממופתח (מאורגן באינדקס) פעמים רבות לתוך אינדקסים ייעודיים שונים, שכל אחד מהם מנתח את טקסט הויקי באופן שממטב את השימוש עבורו. דוגמאות לאינדקסים:
מצויה תמיכה בעשרות שפות. רצויה תמיכה בכל השפות. רשימת השפות הנתמכות מופיעה בelasticsearch.org; ראו את התיעוד בנושא תרומות לשליחת בקשות או תוספות. ספריות קוד פתוח של צד שלישי מספקות תמיכה בשפות נוספות.
חיפוש CirrusSearch יבצע מיטוב לשאילתה שלכם, ויריץ אותה. כותרות הדפים המתקבלות ממושקלות לפי רלוונטיות ומעובדות עבור דף תוצאות החיפוש, 20 בכל פעם. למשל, נאספים קטעי טקסט קצרים מתוך הערכים, ומילות החיפוש מסומנות בטקסט מודגש.
תוצאות החיפוש מלוות לפעמים בתוספות כמו "האם התכוונת..." (תיקוני איות), וכאשר אין תוצאות כלל, יופיע "מציג תוצאות עבור..." (תיקוני שאילתה) ו"הצג תוצאות עבור" (השאילתה המקורית).
אפשרויות ותכונות נוספות של החיפוש:
~
כדי לבטל ניווט והצעות באופן ששומר על דירוג הדפים.מילים וביטויים שמתאימים לחיפוש מסומנים בכתב מודגש בדף תוצאות החיפוש. ההדגשה מבוצעת על ידי מנתח-טקסט קוסמטי, בעוד מנתח אינדקס החיפוש הוא זה שמוצא בפועל את הדף; שני מנתחי הטקסט האלה עלולים להיות לא מתואמים ב-100%, במיוחד במקרה של ביטויים רגולריים. המדגיש יכול למצוא התאמות טוב יותר או פחות מאשר מנתח האינדקס.
מילים, ביטויים ומְאַיְּכִים (modifiers)מונח החיפוש, שהוא רכיב החיפוש הבסיסי, הוא מילה, או "ביטוי בתוך מרכאות". הפרטים משתנים משפה לשפה, במיוחד בשפות בהן אין רווחים, אבל החיפוש בדרך כלל מזהה "מילה" בתור:
"מילת עצירה" היא מילה שהחיפוש מתעלם ממנה (כי היא שכיחה במיוחד, מילת קישור, או מסיבה אחרת). רשימת מילות העצירה משתנה משפה לשפה, ואין תמיכה למילות עצירה בכל השפות.[2] החיפוש מבצע התאמה בין המונח אותו מחפשים לבין התוכן (כפי שמוצג בדף). כדי לחפש בקוד המקור, יש להשתמש בפרמטר החיפוש insource (ראו סעיף להלן). לכל פרמטר חיפוש יש אינדקס משלו, והוא מפענח את מונח החיפוש בדרכו.[3]
ברווחים שבין מילים, ביטויים, פרמטרים, וקלט של פרמטרים, ניתן להכניס תווי "רווח לבן" (רווחים, טאבים וכד') ותווי "רווח אפור". תווי "רווח אפור" הם כל התווים שאינם אותיות ומספרים ~!@#$%^&()_+-={}|[]\:";'<>?,./. מחרוזת מעורבת של תווי "רווח לבן" ותווי "רווח אפור" נחשבת למחרוזת רווח אפור אחת ארוכה, ומטופלת כמפרידת-מילים אחת גדולה. "רווח אפור" הוא האמצעי ליצירת אינדקסים ולפענוח שאילתות.[4]
שני יוצאים מן הכלל הם 1) נקודתיים:מוטמעות, הנחשבות לאות ולא למפריד כאשר הן מוטמעות ללא רווחים בין שתי מילים (ולכן הדוגמה הזו היא למעשה מילה אחת ארוכה לצורך החיפוש, ולא שתיים), ו-2) פסיק מוטמע , בתוך רצף ספרות, כמו למשל במחרוזת 1,2,3, הנחשב לספרה (ולכן גם הדוגמה הזו תיחשב למילה יחידה). ברוב המקרים האחרים החיפוש מתעלם מתווי "רווח אפור", למעט במקרים בהם תחביר השאילתה גורם לכך שהם יפורשו כתווים מאייכים (modifiers).
המאייכים הם ~ * \? - " ! . בהתאם למיקום שלהם בתחביר השאילתה, הם יכולים להשפיע על מונח, על פרמטר, או על השאילתה כולה. מאייכים המתאימים למילה או לביטוי הם הכוכבית וסימן השאלה (המשמשים כתָוֵי-כֹּל, wildcards), חיפוש על פי קרבה, וחיפוש על ידי התאמת מחרוזות מקורבת ("חיפוש עמום", fuzzy search). לכל פרמטר יכולים להיות מאייכים משלו, אבל באופן כללי:
~
מיד אחרי המילה או הביטוי (ומספר המציין את רמת אי-הדיוק המותרת).~
בתחילת השאילתה.\?
, בתור תַּו-כֹּל (wildcard) בתוך מילה, כדי לציין שבמקומו יכולה להופיע אות כלשהי. תו-כל נוסף הוא הכוכבית *, המציינת שבמקומה יכולות להופיע אפס או יותר אותיות. למשל, שאילתת החיפוש ספ\?ד
תמצא דפים המכילים את המילה "ספרד" וגם דפים המכילים את המילה "ספיד"; שאילתת החיפוש ספ*ד
תמצא גם דפים המכילים "ספרואיד", "ספרינגפילד", וכן "ספד".כאשר מחפשים מילים שמתחילות בסימנים
-או
!, כמו
-אופן
(שמופיע למשל בביטויים "חד-אופן" ו"תלת-אופן") או
!Kung
(שם אפריקאי שמתחיל בעיצור שמתועתק לסימן קריאה), החיפוש ימצא כותרות והפניות שמתאימות בדיוק למילת החיפוש (שכוללת את הסימן המיוחד,
-או
!, תוך "התעלמות" מהמשמעות המיוחדת שלו), אבל
בנוסף אליהןהוא ימצא גם את כל הדפים ש
לאמכילים את המילים
אופן
או
Kung
(ללא הסימן המיוחד), בגלל המשמעות המיוחדת (שלילה לוגית) של הסימנים
-ו-
!; כלומר, החיפוש ימצא כמעט את כל הדפים בויקי. כדי לחפש מופעים של מונחים כאלה בתוך טקסט שאיננו כותרות או הפניות, יש להשתמש בפרמטר החיפוש
insource(ראו
סעיףלהלן).
שני תווים משמשים כתַּו-כֹּל (wildcard, תו שיכול לייצג אותיות שונות): הכוכבית *
, וסימן שאלה (שלפניו לוכסן), \?
. שניהם יכולים להופיע באמצע או בסוף מילה. סימן השאלה מייצג תו אחד בדיוק, והכוכבית מייצגת כמות כלשהי (אפס או יותר) של תווים. מכיוון שמשתמשים רבים מנסחים את שאילתת החיפוש בצורת שאלה, החיפוש בנוי כך שיתעלם מכל סימן שאלה שמופיע בשאילתה, אלא אם כן נעשה שימוש בלוכסן כתו מילוט \?, ורק אז מפורש סימן השאלה כתו-כל שמייצג אות אחת.
A phrase search can be initiated by various hints to the search engine. Each method of hinting has a side-effect of how tolerant the matching of the word sequence will be. For greyspace, camelCase, or txt2number hints:
txt 2 number
or txt-2.number
.invisible hand
within the text meetings invisible hand shake
.A "search instead" report is triggered when a universally unknown word is ignored in a phrase.
Each one of the following types of phrase-matching contains and widens the match-tolerances of the previous one:
"exact]phrase"
.camelcase
, in all lowercase, because CirrusSearch is not case sensitive in matching.Note that CamelCase matching is not enabled for all languages.
Some parameters interpret greyspace phrases, but other parameters, like insource
only interpret the usual "phrase in quotes".
In search terminology, support for "stemming" means that a search for "swim" will also include "swimming" and "swimmed", but may not include irregular forms like "swam".
Note that all stemming is case insensitive.
Note how the "exact phrase" search interpreted the embedded:colon character as a letter, but not the embedded_underscore character. A similar event occurs with the comma , character inside a number.
Given in:this:word
, CirrusSearch, when in an "exact phrase" context, (which includes the insource parameter context), will not match in
, this
, or word
, but will then only match in:this:word
.
Otherwise, remember that for CirrusSearch words are letters, numbers, or a combination of the two, and case does not matter.
The common word search employs the space character and is aggressive with stemming, and when the same words are joined by greyspace characters or camelCase they are aggressive with phrases and subwords.
When common words like "of" or "the" are included in a greyspace-phrase, they are ignored, so as to match more aggressively.
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.[5] 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 parserFunction
and parser<stems> function<stems>
.
Making inquiries with numbers, we would find that:
plan9
, plans 9
, planned 9th
, (planned) 9.2
, "plans" (9:24)
plan9
(case insensitive)plan9
or planet4589
.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.
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.
exact phrase
.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.
Quotes turn off stemming, "but appending"~ the tilde reactivates the stemming.
insourceInsource 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 |state={{{state|autocollapse}}}
.
i
, which is even less efficient.
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.[6] 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.[7] 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:
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.
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
.
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 ("
).
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.)
Exclude content from the search indexContent 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 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.
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.)
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.
Intitle and incategory are old search parameters. Incategory no longer searches any subcategory automatically, but you can now add multiple category pagenames manually.
Since MediaWiki 1.31-wmf.23 Regular expression searches are supported for intitle:
Everything written in the #Regular expression searches is also valid for these searches, including warnings.
DeepcategoryDeep 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:
The DeepCat gadget that previously implemented the parameter was sunsetted in January 2020.
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/he.)
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:
CirrusSearch -linksto: Help:CirrusSearch
finds articles that mention "CirrusSearch" but not in a wikilink.
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.
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.
For installations with the Translate extension, inlanguage is important for highly refined searches and page counts.
will produce search results in that language only.
For example
The contentmodel: keyword allows to limit the search to pages of a specific content model. For possible models cf. Content handlers. E.g.:
contentmodel:json
To find sub-pages.
For example
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.
ArticletopicThe 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 . 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 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.
PageidThe 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).
משקול דפים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:wasp|bee|ant
morelike:template:search|template:regex|template:usage
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"
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:
true
| false
) - use only the field data. Defaults to false
: the system will extract the content of the text
field to build the query.&cirrusMtlUseFields=yes&cirrusMltFields=title&cirrusMltMinTermFreq=1&cirrusMltMinDocFreq=1&cirrusMltMinWordLength=2
These settings can be made persistent by overriding cirrussearch-morelikethis-settings
in System message.
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
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.
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:
#
character to the end of the line is considered a comment, and ignored.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:
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.
insource:/regexp/
"טהור". כנראה שהוא בכל מקרה ייעצר ללא תוצאות אחרי כ-20 שניות, ובזמן הזה יחסום את החיפושים של משתמשים אחראיים.
חיפוש בסיסי מבוסס-אינדקס מוצא מילים כפי שהן מופיעות בדף. מקפים, סימני פיסוק וסוגריים, לוכסן וסימנים מתמטיים אחרים, לא משתתפים בחיפוש עצמו ומהווים רק גבולות עבור מילים; לא ניתן לכלול אותם בחיפוש. בדרך כלל, זו ההתנהגות בה מעוניינים המשתמשים. אולם, לעיתים רוצים לבצע חיפוש מדויק יותר.
כדי לעקוף את המגבלה התחבירית הזו של חיפושים מבוססי-אינדקס, ניתן להשתמש בחיפושי ביטוי רגולרי. אך מכיוון שחיפושים שמכילים רק ביטויים רגולריים הם איטיים וצורכים כמות משאבים גדולה ביותר, יש לשלבם תמיד עם חיפוש מבוסס-אינדקס אחד לפחות, שבעצם רץ ראשון ומצמצם את התחום בו החיפוש של הביטוי הרגולרי יצטרך לרוץ: הוא ירוץ רק בדפים שהתקבלו בתוצאות החיפוש מבוסס האינדקס.
חיפוש ביטוי רגולרי של "מחרוזת מדויקת" (כלומר עם מרכאות במקום לוכסנים) מתנהג כמו חיפוש בסיסי, ולא כמו חיפוש ביטוי רגולרי; כל התווים שאינם אותיות ומספרים "מאבדים" את המשמעות המיוחדת שיש להם כחלק מביטוי רגולרי. בכל חיפוש של ביטוי רגולרי המשתמש נדרש להוסיף מסנן פשוט כדי ליצור תחום חיפוש עבור המנוע של הביטויים הרגולריים. בדוגמאות לשאילתות החיפוש שלהלן, החלק שמפעיל חיפוש מבוסס-אינדקס (המסנן) מסומן בכתב מודגש, והחלק של חיפוש הביטוי הרגולרי מסומן בכתב נטוי:
הדוגמה האחרונה עובדת כאשר היא מהווה קישור שמוצב בדף, אבל {{FULLPAGENAME}} לא מתפרש בצורה מיוחדת בתיבת החיפוש.
לדוגמה, הקישור הפנימי [[Special:Search/insource:/ביטוי רגולרי/ prefix:{{FULLPAGENAME}}]] מוצא את מחרוזת החיפוש "ביטוי רגולרי" בדף הזה.
שאילתה ללא ציון מרחב שם וללא שימוש בתחילית (prefix) תפעיל חיפוש בתחום החיפוש שהוגדר כברירת המחדל של המשתמש (ושאותו ניתן לקבוע בכל דף תוצאות חיפוש, למשל ב-Special:Search). ישנם משתמשים שמשאירים את תחום ברירת המחדל שלהם כ"כל מרחבי השם", כלומר כל הויקי. במיזם ויקי גדול, ביצוע של חיפוש ביטוי רגולרי "טהור" במצב כזה ככל הנראה ייכשל, בשל התמשכות החיפוש אל מעבר למגבלת הזמן שלו.
חיפוש ביטוי רגולרי בעצם סורק כל דף בתחום החיפוש אות אחר אות. לעומתו, חיפוש מבוסס אינדקס עובר על מספר מצומצם של רשומות מתוך מסד נתונים נפרד מזה של הויקי, ונותן תוצאות כמעט מיידיות. לכן, כאשר משתמשים ב-insource:// (ביטוי רגולרי כלשהו), יש להוסיף מונחי חיפוש נוספים שיצמצמו ככל האפשר את תחום החיפוש של הביטוי הרגולרי. ישנם סוגי חיפוש רבים אשר מבוססים על אינדקס, ובכך מספקים במהירות תחום חיפוש מצומצם עבור /חיפוש הביטוי הרגולרי/. בסדר יורד של תועלת:
insource:""
עם מירכאות, כאשר מה שבתוכן מועתק מהביטוי הרגולרי למעט הלוכסנים (שמבטלים את המשמעות של התווים המיוחדים), הוא הסינון האידיאלי.intitle:
לחיפוש מילים בכותרת הדף, incategory:
לחיפוש ערכים בתוך קטגוריה מסוימת, ו-linksto:
לחיפוש ערכים שמקשרים לדף מסוים, הם כולם מסננים מעולים.hastemplate:
הוא מסנן טוב מאוד.namespace:
הוא חסר תועלת ממשית בתור מסנן, אם כי במקרים מסוימים הוא יכול לעזור לחיפוש ביטוי רגולרי איטי להצליח לסיים לפני תום מגבלת הזמן.על מנת לבדוק שאילתה של ביטוי רגולרי טהור, ניתן ליצור דף שמכיל מחרוזות עבור הבדיקה, ואז לבצע חיפוש שמסונן על ידי פרמטר prefix עם שם הדף המלא של דף הבדיקה. מחרוזות שמתאימות לשאילתה יודגשו בדף תוצאות החיפוש. החיפוש יבוצע בדף הזה, ובדפי המשנה שלו.
מונחי חיפוש שלא משפרים את יעילות חיפושי הביטויים הרגולריים הם האופרטורים שנועדו להשפיע על ה"ציון" של תוצאות החיפוש: morelike, boost-template, prefer-recent.
תווים מיוחדים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:
There are some notable differences from standard regex metacharacters:
\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:
.
metacharacter stands for any character including a newline, so .*
matches across lines.#
sign means something, and must be escaped.^
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.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:
\n
[^ -]
A newline (also a tabulation character can be found)[11] [^\n]
[ -]
Any character except a newline and tabulation \s
[^!-]
A whitespace character: space, newline, or tabulation \S
[!-]
Any character except whitespace
In these ranges, " " (space) is the character immediately following the control characters, "!" is the character immediately following space, and "" is U+10FFFF, the last character in Unicode. Thus, the range from " " to "" includes all characters except for control characters (of which articles may contain newlines and tabulation), while the range from "!" to "" includes all characters except for control characters and space.
Refining with an exact stringYou can start out intending an exact string search, but keep in mind:
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.
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/
/"This \" fails"/
always./"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:
/
delimiter character use \/
."
delimiter character use \"
.\~\@\#\&\*\(\)\-\+\{\}\[\]\|\<\>\?\.\\
."~@#&*()-+{}[]|\<>?.\"
.The simplest algorithm to create the basic string-finding expression using insource:/"regexp"/, need not take metacharacters into account except for the " and / characters:
the/str"ing
out. (The /" delimiters "/ are not shown.)"
with "\""
(previous double-quote: stop, concatenate, quote restart)./
with "\/"
(stop, concatenate, start).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:
The insource keyword does only search the page source content. To run regex searches on the title strings intitle:/regex/ can be used.
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.
חיפוש גאוגרפיSearching based on the (primary) coordinates associated with pages. Depends on Extension:GeoData and {{#coordinates:}}
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:
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.
Since MediaWiki 1.28, CirrusSearch supports indexing and searching of properties of files in the File:
namespace. This includes:
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.
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
3D
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.
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:
image/png
The MIME type search is not case-sensitive.
Search for file of given size, in kilobytes (kilobyte means 1024 bytes). The syntax is:
Examples:
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:
Where measure
can be:
Examples:
The ויקיבייס 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 resultsThere 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).
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:
&sort=incoming_links_asc
&sort=incoming_links_desc
&sort=last_edit_asc
&sort=last_edit_desc
&sort=create_timestamp_asc
&sort=create_timestamp_desc
&sort=just_match
&sort=relevance
&sort=random
&sort=none
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.
ראו גםThere's test2wiki, wiki2xml, wiki2dict, apache2handler, apache2ctl, etc.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4