Help:CirrusSearch/zh

CirrusSearch是MediaWiki的新搜索引擎. 它在旧搜索引擎LuceneSearch上作出了重大改进. 该页将会说明新的功能或与旧版的差异.

常见问题
如果你的疑问并未得到解答，请在讨论页提问，热心用户将会为你解答.

作了哪些改进？
新搜索引擎较之于旧搜索引擎有三大改进，即：


 * 更好的支持以不同语言搜索.
 * 更快的更新搜索索引，即页面修改能更快在搜索引擎中显示出来.
 * 展开模板，即页面中在模板中的全部内容也能被搜索引擎搜索到.

更新
搜索结果的索引列表会被及时更新. 当你改变了关键字时，新的结果也能立即显示处理. 对模板的变更将会在数分钟内起作用. 由于采用任务调度模式来处理这些变更，所以实际情况可能略有不同. 对文章的编辑，即使不包含任何改变，也会强制系统进行刷新——所以正常情况下不要进行这样的操作.

搜索建议
当你在搜索框中键入关键字时，下拉框提供的搜索建议的排列顺序与各词条所拥有的导入链接数有关. 如果你在关键词前加入“～”，将不会匹配任何词条. 同时，你可以随时按回车键进入搜索结果页.

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

全文搜索
全文搜索功能（类似“在结果页中查找”）会搜索网页标题、重定向链接、小标题以及正文，所以搜索结果相对稳定. 本次主要的改动在于模板的扩充.

过滤器（intitle: 、incategory: 和linksto: ）


我们对以下这些搜索语法进行了强化：


 * intitle:foo
 * 查找标题为"foo"的词条. “词干提取”功能也将被启用.
 * intitle:"foo bar"
 * 查找标题同时包含“foo”和“bar”的词条. “词干提取”功能也将被启用.
 * intitle:foo bar
 * 查找标题包含“foo”或包含“bar”的词条.
 * -intitle:foo bar
 * 查找标题既不包含“foo”、也不包含“bar”的词条.
 * intitle: foo bar
 * 这是错误的语法. 将查找标题或内容包含“foo”或包含“bar”的词条.
 * incategory:Music
 * 查找属于“Music”分类的词条
 * incategory:"music history"
 * 查找属于“Music_history”分类的词条
 * incategory:"musicals" incategory:"1920"
 * 查找同时属于“Musicals”和“1920”分类的词条
 * -incategory:"musicals" incategory:"1920"
 * 查找属于“1920”分类，但不属于“musicals”的词条
 * cow*
 * 查找标题或正文中包含以“cow”开头词汇的词条
 * linksto:Help:CirrusSearch
 * 查找含有链接的词条
 * -linksto:Help:CirrusSearch CirrusSearch
 * 查找一篇包含“CirrusSearch”字样，但本身并不含有链接的词条Help:CirrusSearch

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
 * 查找所有标题以“cow”开头的词条.
 * domestic prefix:cow
 * 查找所有包含“domestic”并且标题以“cow”开头的词条.
 * domestic prefix:Cow/
 * 查找所有包含“domestic”并且属于“Cow”词条的子页面，这一方法较为常用. 一般通过加入URL参数“ ”来构造这一请求.
 * domestic prefix:Talk:Cow/
 * 查找所有包含“domestic”，并且属于“Cow”讨论页的子页面.
 * cow prefix:Pink Floyd/
 * 查找所有包含“cow”，并且属于“Pink Floyd”的子页面. 这里的空格不影响搜索结果.

注意：“prefix：”仍然需要放在查询语句的末尾.

特殊前缀

 * 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" 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 than they ought to sometimes.

优先短语匹配
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 (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.

近似短语搜索
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.

引用与精确匹配
一些情况下，您还可以点击浏览器中的‘后退’按钮返回到链接媒体查看器中图像的页面.

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 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  to the search. We try to emulate the template inclusion syntax so  finds pages with   and   would find transclusions of the article   from the main namespace. You can omit the quotes if the template's title you are looking for does not contain a space. will filter pages that does not contain that template.

You can combine all sorts of fun search syntax to get only middle quality images of china.

boost-templates:
You can boost pages scores based on what templates they contain. This can be done directly in the search via  or you can set the default for all searches via the new   message. replaces the contents of  if the former is specified. The syntax is a bit funky but was chosen for simplicity. Some examples:


 * Find files in the China category sorting quality images first.
 * Find files in the China category sorting quality images first.


 * Find files in the China category sorting quality images first and low quality images last.
 * Find files in the China category sorting quality images first and low quality images last.


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

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

insource:
will search text just in the wikitext. This will pick up template parameter names, URLs in link tags, etc. It has two flavors:
 * and
 * These work pretty similarly to  or regular text search in that they are fast but ignore punctuation.


 * and
 * 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   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   in quotes (insource:"/foo bar/").
 * Tip: These return much much faster if there are other filters. Instead of searching for   search for.

辅助文本
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  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.

开头文本
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.

参见

 * 浏览器测试中的完整说明