Prefer phrase matches
If you don't have too much special syntax in your query we'll give perfect phrase matches a boost. I'm being intentionally vague because I'm not sure exactly what "too much special syntax" should be. Right now if you add any explicit phrases to your search we'll turn off this feature.
Fuzzy search
Putting a ~ after a search term (but not double quotes) activates fuzzy search. You can also put a number from 0 to 1 to control the "fuzziness" fraction, e.g. nigtmare~.9 or lighnin~.1 or lighnin~0.1. Closer to one is less fuzzy.
Phrase search and proximity
Surrounding some words with quotes declares that you are searching for those words close together. You can add a ~ and then a number after the second quote to control just how close you mean. The proper name for this "closeness" is "phrase slop". The default "phrase slop" is 1.
| flowers algernon | Flowers for Algernon | flowers are for Algernon | Flowers is a science fiction short story and subsequent novel for Algernon |
"flowers algernon" | | | | |
"flowers algernon"~1 | | | | |
"flowers algernon"~2 | | | | |
"flowers algernon"~0 | | | | |
"flowers algernon"~10 | | | | |
Quotes and exact matches
Quotes turn on exact term matches. You can add a ~ to the quote to go back to the more aggressive matcher you know and love.
| flowers | flower | Flowers for Algernon | flower for Algernon |
flowers | | | | |
"flowers" | | | | |
"flowers"~ | | | | |
"flowers algernon" | | | | |
"flowers algernon"~ | | | | |
"flowers algernon"~1 | | | | |
"flowers algernon"~1~ | | | | |
prefer-recent:
You can give recently edited articles a boost in the search results by adding "prefer-recent:" to the beginning of your search. By default this will scale 60% of the score
exponentially with the time since the last edit, with a half life of 160 days. This can be modified like this: "prefer-recent:<proportion_of_score_to_scale>,<half_life_in_days>". proportion_of_score_to_scale must be a number between 0 and 1 inclusive. half_life_in_days must be greater than 0 but allows decimal points. This number works pretty well if very small. I've tested it around .0001, which is 8.64 seconds.
This will eventually be on by default for Wikinews, but there is no reason why you can't activate it in any of your searches.
hastemplate:
You can filter pages to just those that use a template by adding hastemplate:
to the search. We try to emulate the template inclusion syntax so hastemplate:"quality image"
finds pages with Template:Quality Image
andhastemplate:":quality image"
would find transclusions of the article Quality Image
from the main namespace. You can omit the quotes if the template's title you are looking for does not contain a space. -hastemplate:
will filter pages that do not contain that template.
You can combine all sorts of fun search syntax to get only middle quality images of china File:-hastemplate:"quality image" -hastemplate:"low quality" incategory:china
.
boost-templates:
You can boost pages' scores based on what templates they contain. This can be done directly in the search via boost-templates:""
or you can set the default for all searches via the new cirrussearch-boost-templates
message.boost-templates:""
replaces the contents of cirrussearch-boost-templates
if the former is specified. The syntax is a bit funky but was chosen for simplicity. Some examples:
File:boost-templates:"Template:Quality Image|200%" incategory:china
- Find files in the China category sorting quality images first.
File:boost-templates:"Template:Quality Image|200% Template:Low Quality|50%" incategory:china
- Find files in the China category sorting quality images first and low quality images last.
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
cirrussearch-boost-templates
message this can be reduced to just popcorn
.
Don't try to add decimal points to the percentages. They don't work and search scoring is such that they are unlikely to matter much.
A word of warning about
cirrussearch-boost-templates
: if you add really really big or small percentages they can poison the full text scoring. Think, for example, if enwiki boosted featured articles by a million percent. Then searches for terms mentioned in featured articles would find the featured articles before exact title matches of the terms. Phrase matching would be similarly blown away so a search like
brave new world
would find a featured article with those words scattered throughout it instead of the article for
Brave New World.
Sorry for the inconsistent -
in the name. Sorry again but the quotes are required on this one. Sorry also for the funky syntax. Sorry we don't try to emulate the template transclusion syntax like we do with hastemplate:
.
insource:
insource:
will search text just in the wikitext. This will pick up template parameter names, URLs in link tags, etc. It has two flavors:
insource:foo
and insource:"foo bar"
- These work pretty similarly to
intitle:
or regular text search in that they are fast but ignore punctuation.
insource:/foo/
and insource:/foo/i
- These run Regular expressions against the page source. They aren't efficient and we only allow a few of them to run at a time on the search cluster but they are very powerful. This link contains an explanation of the syntax and this link contains an actual grammar for the Regular Expression language. The version with the extra
i
runs the expression case insensitive and is even less efficient. Note that if the regexp contains whitespace, you must either escape each space character (\ ) or put everything after insource:
in quotes (insource:"/foo bar/"). - Tip: These return much much faster if there are other filters. Instead of searching for
insource:/self-absorbed/
search for insource:self-absorbed insource:/self-absorbed/
.
Auxiliary Text
Cirrus considers some text in the page to be "auxiliary" to what the page is actually about. Examples include table contents, image captions, and "This article is about the XYZ. For ZYX see ZYX" style links. You can also mark article text as auxiliary by adding the searchaux
class to the html element containing the text.
Auxiliary text is worth less than the rest of the article text and it is in the snippet only if there are no main article snippets matching the search.
Lead Text
Cirrus assumes that non-auxiliary text that is between the top of the page and the first heading is the "lead in" paragraph. Matches from the lead in paragraph are worth more in article ranking.
Commons Search
By default when the search contains the file namespace, Cirrus will search commons as well. You can disable this behavior by adding local:
to the search. If you are using a namespace prefix to select the namespace the syntax looks likefile:local:foo
. If you aren't using a namespace prefix to select the namespace then the syntax looks like local:foo
.
See also; wikipedia in limba ROMANA; Dra Olga magdalena12