Jump to content

Search/Old/CirrusSearchFeatures: Difference between revisions

From mediawiki.org
< Search‎ | Old
Content deleted Content added
Line 115: Line 115:


[[Category:Search]]
[[Category:Search]]

===hastemplate:===
You can filter pages to just those that use a template by adding <code>hastemplate:</code> to the search. We try to emulate the template inclusion syntax so <code>hastemplate:"quality image"</code> finds pages with <code>Template:Quality Image</code> and <code>hastemplate:"|quality image"</code> would find transclusions of <code>Quality Image</code> from the main namespace. You can omit the quotes if the template's title you are looking for does not contain a space. <code>-hastemplate:</code> will filter pages that contain that template.

You can combine all sorts of fun search syntax to get only only middle quality images of china <code>File:-hastemplate:"quality image" -hastemplate:"low quality" incategory:china</code>.

===boost-templates:""===
You can boost pages scores based on what templates they contain. This can be done directly in the search via <code>boost-templates:""</code> or you can set the default for all searches via the new <code>cirrussearch-boost-templates</code> message. <code>boost-templates:""</code> replaces the contents of <code>cirrussearch-boost-templates</code> if the former is specified. The syntax is a bit funky but was chosen for simplicity. Some examples:
;<code>File:boost-templates:"Template:Quality Image|200%" incategory:china</code>
:Find files in the China category sorting quality images first.
;<code>File:boost-templates:"Template:Quality Image|200% Template:Low Quality|50%" incategory:china</code>
:Find files in the China category sorting quality images first and low quality images last.
;<code>File:boost-templates:"Template:Quality Image|200% Template:Low Quality|50%" popcorn</code>
:Find files about popcorn sorting quality images first and low quality images last. Remember that through the use of the <code>cirrussearch-boost-templates</code> message this can be reduced to just <code>popcorn</code>.

Sorry for the inconsistent <code>-</code> 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 <code>hastemplate:</code>.

Revision as of 14:54, 30 December 2013

So this information can be turned into a help page one day:

PD Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info. PD


First and foremost CirrusSearch is a workalike for the current search system, MWSearch. Everything here should work unless it is explicitly mentioned as being different in this document.

This is distilled from CirrusSearch's browser tests at http://git.wikimedia.org/tree/mediawiki%2Fextensions%2FCirrusSearch.git/master/tests%2Fbrowser%2Ffeatures.

Updates

Updates to the search index are done in near real time. You should be able to search for your changes as soon as you make them. Changes to templates should take effect in articles that include the template in a few minutes. The templates changes use the job queue so performance may vary. A null edit to the article will force the change through but that shouldn't be required if everything is going well.

Search suggestions

The search suggestions you get when you type into the search box that drops down candidate pages is substantively the same with articles sorted by the number of incoming links. Worth noting is that if you start your search with ~ we won't find any articles as you type and you can safely hit enter at any time to jump to the search results page.

ASCII/accents/diacritics folding is turned on for English text, but there are some formatting problems with the result. See 52656.

Full text search (the kind that lands you on the search results page) searching in title, redirects, headings, and article text so it shouldn't present any surprises. The big change here is that templates are expanded.

There are some relevant open bugs:

In search terminology, support for "stemming" means that a search for "swim" will also include "swimming" and "swimmed".

Filters (intitle:, and incategory:)

We've tightened up the syntax around these quite a bit.

  • intitle:foo
    • Find articles whose title contains foo. Stemming is enabled for foo.
  • intitle:"foo bar"
    • Find articles whose title contains foo and bar. Stemming is enabled for foo and bar.
  • intitle:foo bar
    • Find articles whose title contains foo and whose title or text contains bar.
  • -intitle:foo bar
    • Find articles whose title does not contain foo and whose title or text contains bar.
  • intitle: foo bar
    • Syntax error, devolves into searching for articles whose title or text contains intitle:, foo, and bar.
  • incategory:Music
    • Find articles that are in Category:Music
  • incategory:"music history"
    • Find articles that are in Category:Music_history
  • incategory:"musicals" incategory:"1920"
    • Find articles that are in both Category:Musicals and Category:1920
  • -incategory:"musicals" incategory:"1920"
    • Find articles that are not in Category:Musicals but are in Category:1920
  • cow*
    • Find articles whose title or text contains words that start with cow

prefix:

The prefix: syntax in its current form is relied upon for a bunch of functionality so it's been recreated as exactly as possible.

  • prefix:cow
    • Find articles whose title starts with cow in the content namespaces
  • domestic prefix:cow
    • Find articles whose title starts with cow and that contain domestic and are in the content namespaces
  • domestic prefix:cow/
    • Find all subarticles of all cow articles in content namespaces that contain the word domestic. This is a very common search and is frequently build using a special url parameter called 'prefix'.
  • domestic prefix:Talk:cow/
    • Find all subarticles of the talk page for cow containing domestic
  • cow prefix:Pink Floyd/
    • Find all subarticles of all Pink Floyd articles in the content namespaces which contain cow. The space is is significant.

Note that the old rule of having to put prefix: at the end of the query still applies.

Special Prefixes

  • morelike:Endothermic
    • Find articles whose text is similar to Endothermic.
  • Talk:Foo
    • Find articles in the talk namespace whose title or text contains the word foo

Did you mean

Did you mean suggestions are designed to notice if you misspell an uncommon phrase that happens to be an article title. If so, they'll let you know. They also seem to suggest more things then they ought to sometimes.

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.

Putting a ~ after a search term activates fuzzy search. You can also put a number from 0 to 1 to control the "fuzziness," e.g. nigtmare~.9 or lighnin~.1. Closer to one is less fuzzy.

Phrase search and proximity

Surrounding some words in 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" Yes Yes N N
"flowers algernon"~1 Yes Yes N N
"flowers algernon"~2 Yes Yes Yes N
"flowers algernon"~0 Yes N N N
"flowers algernon"~10 Yes Yes Yes Yes

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" Yes N N N
"flowers"~ Yes Yes N N
"flowers algernon" N N Yes N
"flowers algernon"~ N N Yes Yes
"flowers algernon"~1 N N Yes N
"flowers algernon"~1~ N N Yes Yes

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 and hastemplate:"|quality image" would find transclusions of 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 contain that template.

You can combine all sorts of fun search syntax to get only 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.

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