Template documentationedit documentation

Use this template to search and display search results in a wiki page.

Parameters[edit source]

  • 1 or query - Required! Search query. See mw:Help:CirrusSearch for all available search operators. For example:
    • water - Search all pages with "water" in the text or title
    • -water - Search all pages without "water" in the text or title
    • intitle:water - Search all pages with "water" in the title
    • -intitle:water - Search all pages without "water" in the title
    • incategory:Water - Search all pages in Category:Water
    • -incategory:Water - Search all pages not in Category:Water
    • linksto:Water - Search all pages that link to Water
    • -linksto:Water - Search all pages that don't link to Water
    • inlanguage:es - Search all Spanish pages
    • -inlanguage:en - Search all non-English pages
    • hastemplate:Page_data - Search all pages with Template:Page data
    • -hastemplate:Page_data - Search all pages without Template:Page data
    • subpageof:Water - Search all subpages of Water
    • -subpageof:Water - Search all pages that are not a subpage of Water
  • namespace - Namespace to search, defaults to the main namespace. For example:
    • namespace=2 - Search user pages (see namespace numbers)
    • namespace=* - Search all namespaces
  • limit - Max number of results, defaults to 10. For example:
    • limit=100 - Limit to 100 search results
    • limit=max - Maximum allowed number of results (5000)
  • sort - Sort criteria, defaults to 'relevance'. Allowed values:
    • sort=create_timestamp_asc - Oldest pages first
    • sort=create_timestamp_desc - Most recent pages first
    • sort=incoming_links_asc - Least linked pages first
    • sort=incoming_links_desc - Most linked pages first
    • sort=last_edit_asc - Most recently edited pages first
    • sort=last_edit_desc - Least recently edited pages first
    • sort=random - Random sorting
    • sort=relevance - Sort by relevance as determined by the search engine
  • format - Format of the search results, defaults to 'list'. Allowed values:
    • format=list - Return an unordered list (<ul>) of search results, linked to their pages
    • format=card - Return pretty search cards (see Template:Search results/card)
    • format=count - Return the total number of search results as a plain number
    • format=plain - Return a comma-separated list of plain titles for further processing
    • format=json - Return a JSON object for further processing, for example in a Lua module

Examples[edit source]

Basic[edit source]

{{Search results|panel}}

Search operators[edit source]

{{Search results|panel incategory:Photovoltaics linksto:Solar_energy}}

Parameters[edit source]

{{Search results|panel|limit=5|sort=create_timestamp_asc}}

Card format[edit source]

{{Search results|panel|format=card|limit=5}}

Search in more than one category[edit source]

Searching the term 'water' in pages that belong to both Category: Projects and Category:Literature reviews:

{{Search results|water incategory:"Projects" incategory:"Literature reviews"|limit=5|format=list}}

Template data[edit source]

Use this template to search and display search results in a wiki page.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Query1 query

Search query

Example
solar panel
Stringrequired
Namespacenamespace

Namespace to search (use * for all)

Default
0
Example
2
Numberoptional
Limitlimit

Max number of results (use 'max' for maximum allowed)

Default
10
Example
100
Numberoptional
Sortsort

Sort criteria

Suggested values
create_timestamp_asc create_timestamp_desc incoming_links_asc incoming_links_desc last_edit_asc last_edit_desc random relevance
Default
relevance
Stringoptional
Formatformat

Format of the search results

Suggested values
list card count plain json
Default
list
Example
card
Stringsuggested
Classclass

Additional CSS class

Suggested values
grid columns
Example
grid
Stringoptional

See also[edit source]

Cookies help us deliver our services. By using our services, you agree to our use of cookies.