Help:CirrusSearch/pt

CirrusSearch é o novo motor de busca para a MediaWiki. Apresenta melhorias importantes em relação ao antigo, LuceneSearch. Esta página descreve os recursos que são novos ou diferentes em comparação com as soluções do passado.

Perguntas frequentes
Se a sua pergunta não foi respondida aqui, sinta-se livre para perguntar na página de discussão e alguém responderá para você.

O que foi melhorado?
O novo motor de busca dispõe de três principais melhorias em relação ao antigo, nomeadamente:

Melhor suporte para pesquisas em diferentes idiomas.
 * Atualizações mais rápidas para o índice de pesquisa, ou seja, as alterações nos artigos são refletidas muito mais rápido nos resultados.
 * Abrangência em predefinições, o que significa que todo o conteúdo num artigo que esteja incluído numa predefinição será refletido nos resultados da pesquisa.

Atualizações
Atualizações no índice de pesquisa são feitas em tempo quase real. Deverá ser capaz de pesquisar as mesmas assim que estas forem feitas. As mudanças em predefinições devem, em poucos minutos, entrar em vigor nos artigos que as incluam. As mudanças em predefinições usam a fila de espera, por isso o desempenho pode variar. Uma edição nula ao artigo irá forçar a mudança, mas isso não deverá ser necessário se tudo está estiver a correr bem. 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.

Sugestões de pesquisa
As sugestões de pesquisa que aparecem quando digita na caixa de pesquisa são ordenadas substancialmente pelo número de ligações internas recebidas. Algo digno de nota é que se começar a sua pesquisa com um til (~), não vamos encontrar nenhum artigo que deseje e pode seguir a qualquer momento, ao carregar na tecla "Enter", para a página de resultados de pesquisa. 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.

Pesquisa completa de texto
A pesquisa completa de texto (aquela que o leva à página de resultados) em títulos, redirecionamentos, cabeçalhos e textos de artigo não deverá trazer quaisquer surpresas. A grande alteração é que agora também abrange predefinições.

Stemming
There is support for dozens of languages, but all languages are wanted. There is a list of currently supported languages at elasticsearch.org; see their documentation on contributing to submit requests or patches.

Filtros (intitle: e incategory:)


Reforçámos um pouco a sintaxe em torno destes exemplos.


 * intitle:foo
 * Find articles whose title contains foo. Stemming is enabled for foo.
 * intitle:"fine line"
 * Find articles whose title contains fine line. Stemming is disabled.
 * 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.
 * 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
 * linksto:Help:CirrusSearch
 * find articles that link to a page
 * -linksto:Help:CirrusSearch CirrusSearch
 * find articles that mention CirrusSearch but do not link to the page Help:CirrusSearch

prefix:
Na sua forma atual, a sintaxe prefix: é invocada para vários tipos de funcionalidades, logo foi recriada com o maior tipo de exatidão possível.

Repare que a regra anterior, de incluir prefix: no final da consulta, ainda se aplica.

morelike:
The  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: These settings can be made persistent by overriding  in Help:System message.
 * Find articles whose text is most similar to the text of the given articles.
 * Find articles about stinging insects.
 * Find templates about regex searching for template usage on the wiki.
 * Find articles about stinging insects.
 * Find templates about regex searching for template usage on the wiki.
 * Find templates about regex searching for template usage on the wiki.
 * : Minimum number of documents (per shard) that need a term for it to be considered.
 * : Maximum number of documents (per shard) that have a term for it to be considered.
 * : Maximum number of terms to be considered.
 * : Minimum number of times the term appears in the input to doc to be considered. For small fields this value should be 1.
 * : Minimal length of a term to be considered. Defaults to 0.
 * : The maximum word length above which words will be ignored. Defaults to unbounded (0).
 * (comma separated list of values): These are the fields to use. Allowed fields are,  ,  ,  ,   and.
 * ( | ): use only the field data. Defaults to : the system will extract the content of the   field to build the query.
 * : The percentage of terms to match on. Defaults to 0.3 (30 percent).
 * Example:

Namespace
A search domain consisting of one namespace, or "all", can be specified at the beginning of a query. Two or more namespaces may be set at the search results page, Special:Search, in the Advanced dialog. This can be set for the query, or for the user's default search domain. Enter a namespace name, or enter, or enter a colon    for mainspace.

Namespace aliases are accepted. For the File namespace,  is accepted.


 * Find articles in the Talk namespace whose title or text contains the word "foo".
 * Find articles in the File namespace on this wiki and commons whose title or text contains the word "foo".
 * Add  to the File namespace query to remove the results from commons.
 * Find articles in the File namespace on this wiki and commons whose title or text contains the word "foo".
 * Add  to the File namespace query to remove the results from commons.
 * Add  to the File namespace query to remove the results from commons.

You cannot use an interwiki prefix as a namespace to search other projects.

Será que quis dizer
As sugestões "Será que quis dizer" são projetadas para perceber se digitou incorretamente uma frase incomum, que pode também ser um título do artigo. Se assim for, será informado sobre o erro.

Prefira correspondências de frase
Prefira correspondências idênticas

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.

Procura de frase~proximidade

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. The default "closeness" is zero. One means one extra word allowed, and so on. For more than two words in the phrase, the closeness equals the total number of extra words, provided that all the words are also in order left to right.

For the closeness value of words given in right to left order, count and discard all the extra words, then add twice the the total count of remaining words minus one (in other words, add twice the number of segments). For the full proximity algorithm, see Elastic Search.

An explicit AND is required between two phrases because of the "inner" quotation marks.

Aspas e correspondências exatas
As aspas ("") ajudam a encontrar os termos correspondentes exatos. Pode adicionar um til (~) à citação para regressar à correspondência mais explícita que conhece e adora.

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:
Pode filtrar as páginas que usem predefinições ao incluir o prefixo  na sua pesquisa. Estamos a tentar melhorar a abrangência às predefinições, para que assim  possa encontrar páginas com   e   consiga encontrar transclusões do artigo , a partir do domínio principal. Poderá omitir as aspas caso o título da predefinição de que está à procura não contenha espaços. filtrará as páginas que contenham essa predefinição.

Pode combinar todos os tipos de sintaxe divertidos para encontrar apenas imagens de um certo tipo de qualidade sobre a 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:
This can pick up template arguments, URLs, links, html, etc. It has two forms, one is an indexed search, and the other is regex based.

Tip: Instead of running a bare insource:/regexp/, these return much much faster when you limit the regexp search-domain to the results of one or more index-based searches. An "exact string" regexp search is a basic search; it will simply "quote" the entire regexp, or "backslash-escape" all non-alphanumeric characters in the string. All regexp searches also require that the user develop a simple filter to generate the search domain for the regex engine to search:



Any search without a namespace or prefix searches your default search domain, settable at Special:Search. It is commonly reset by power users to All namespaces, but if this occurs for a bare regexp search, then on a large wiki it will probably incur an HTML timeout before completing the search.

A regex search actually scours each page character-by character. By contrast, an indexed search actually queries a few records from a database separate from the wiki, and provides nearly instant results. When using a regex, include other search terms to limit the regex search domain as much as possible. There are many search terms that use an index and so instantly provide a highly refined search domain for the /regexp/. In order of general effectiveness:


 * insource:"" with quotation marks, duplicating the regexp except without the slashes or escape characters, is ideal.
 * intitle, incategory, and linksto are excellent filters.
 * "word1 word2 word3", with or without the quotation marks, are OK.
 * hastemplate: if it produces less than a few hundred thousand pages, is OK.
 * namespace: is practically useless, but may enable a slow regexp search to complete.

The prefix operator is especially useful with a { {FULLPAGENAME}} or a subdirectory argument. To develop a new regexp, or refine a complex regexp, use  in any edit box. Search terms that do not increase the efficiency of a regexp search are the page-scoring operators: morelike, boost-template, and prefer-recent.

Metacharacters
This section covers how to escape metacharacters. For the actual meaning of the metacharacters see the explanation of the syntax. For the formal definition see the Lucene grammar for regular expressions.

The use of a regexp to search for an exact string that includes non-alphanumeric characters is a basic search. It finds regular expression metacharacters literally by placing the entire regexp inside double quotation marks, which blindly "quotes" or "escapes" any possible metacharacters from their advanced search meaning. An advanced search usually escapes metacharacters one at a time with a backslash.

For example  matches a '2', a literal plus sign, another '2', an equals sign, a '4' and a literal dot, with one possible space character between each math term. The equals sign has no special, metacharacter meaning in CirrusSearch, and so need not be escaped, but its OK to escape or quote any character because it basically has no effect. An exact-string search usually "quotes" the regexp because this will neutralize all metacharacter meanings.

The square-bracket notation for creating your own character-class also escapes 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 can 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 character that is either a dash or a right square bracket or a dot:  or.

Advanced example
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):



It is fast because it uses two filters so that every page the regexp crawls has the highest possible potential. Assuming your search domain is set to ALL, it searches the entire wiki, because it offers no namespace or prefix.

bounded
You can limit search to pages identified as being near specified geographic coordinates. The coordinates can either be specified as a, 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:


 * neartitle:"San Francisco"
 * neartitle:"100km,San Francisco"
 * nearcoord:37.77666667,-122.39
 * nearcoord:42km,37.77666667,-122.39

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


 * boost-neartitle:"San Francisco"
 * boost-neartitle:"100km,San Francisco"
 * boost-nearcoord:37.77666667,-122.39
 * boost-nearcoord:42km,37.77666667,-122.39

Texto auxiliar
Cirrus considera que algum texto na página pode ser "auxiliar" sobre o tema da mesma. Exemplos incluem conteúdo de tabelas, legendas de imagens e ligações do tipo "Este artigo é sobre XYZ. Para ZYX, veja ZYX". Pode ainda marcar o texto do artigo como auxiliar ao adicionar a classe  ao elemento HTML contido no texto. Show indifference

O texto auxiliar vale menos do que o resto do texto do artigo estará presente apenas se não houver excertos principais de artigos que correspondam à pesquisa.

Introdução
Cirrus assume que o texto não-auxiliar que está entre o topo da página e o primeiro parágrafo é a introdução. Correspondências no parágrafo introdutório valem mais para a posição do artigo nos resultados da pesquisa.

Commons search
By default when the search contains the file namespace, Cirrus will search commons as well. You can disable this behavior by adding  to the search. If you are using a namespace prefix to select the namespace the syntax looks like. If you aren't using a namespace prefix to select the namespace then the syntax looks like.

Ver também

 * Completion Suggester - the incremental search feature of CirrusSearch
 * Completion Suggester - the incremental search feature of CirrusSearch
 * Completion Suggester - the incremental search feature of CirrusSearch