The exclamation mark stands for exactly one character. Finds titles containing the keywords fair and far, but not father, faster etc.įinds people with the name Hamann, Hagmann and Haumann but not Hartmann or Habermann The hash sign stands for a maximum of one character. Finds people with the name Hamann, Hagmann, Hartmann, Habermann etc. The question mark acts as a wildcard for any number of characters.įinds titles containing the keywords far, fairy, father, faster etc.Īt the end of a search term it works as truncation. The search example finds: history of the railways The Great Western Railway : History of a great railway company the specified terms are searched for in any order with none or one or many terms between them. The search example finds: The great railways - history and backgroundĬombining the % operator with one of the unidirectional operators described above ( ? * # !), turns them into bidirectional operators, i.e. There must be no other term between the search terms. This operator searches for keywords in any order. There can be exactly one word between the terms, e.g. Searches only for titles containing the terms in this order. There can be a maximum of one word between the terms. The search example finds: History of the railways History of the Indian Railways There can be none or any number of other terms in between them. If you separate two search terms with * or ?, the search looks for titles in which the terms occur in this order. This search will find, for example: Freedom as duty of the citizen but not Freedom and unity as duty Searches for this exact word order and no other terms must appear within the phrase. Searches only for titles containing the phrase between the quotation marks. garden, house courtyard house with a garden A house with a magnificant gardenĮnter near/3 to specifiy that there can be a maximum of 2 words between the search terms. This searches for titles in which there are a maximum of 3 words between the search terms, e.g. Titles searched must always contain the term house but never the term garden. This then searches for entries that contain at least one of the terms within each pair of brackets. Here it is important, however, to put brackets around terms linked with orwhich represent the same topic. If you want to search for several topics combined that can be expressed through various terms, you can use the and and or operators together. (car or vehicle) and (transport or traffic) Searches for titles containing either the term house house or garden or both terms. As you might expect, you might not get full tokenization from a single analyzer.Searches only for titles containing both terms specified. The "whitespace" analyzer considers any character sequence separated by white spaces as tokens (so the '❤' emoji would be considered a token).Ī language analyzer, such as the Microsoft English analyzer ("en.microsoft"), would take the '$' or '€' string as a token.įor confirmation, you can test an analyzer to see what tokens are generated for a given string. If you need special character representation, you can assign an analyzer that preserves them: Many analyzers, including the default standard analyzer, will exclude special characters during indexing, which means they won't be represented in your index. Special characters can range from currency symbols like '$' or '€', to emojis. The following example is a search over independent terms, with a requirement that all matching documents include "pool". Although query type is set below, it's the default and can be omitted unless you're reverting from an alternative type. This example shows a simple query, distinguished by "queryType": "simple" and valid syntax. If you need fuzzy search, consider the alternative full Lucene query syntax instead. OData parameters have different syntax and rules for constructing queries, escaping strings, and so on.Īlthough the simple parser is based on the Apache Lucene Simple Query Parser class, its implementation in Cognitive Search excludes fuzzy search. Query syntax for either parser applies to query expressions passed in the "search" parameter of a Search Documents (REST API) request, not to be confused with the OData syntax used for the "$filter" and "$orderby" expressions in the same request. Because it's flexible, it's the default for queries in Azure Cognitive Search. The simple parser is more flexible and will attempt to interpret a request even if it's not perfectly composed. Azure Cognitive Search implements two Lucene-based query languages: Simple Query Parser and the Lucene Query Parser.
0 Comments
Leave a Reply. |