SharePoint 2010 Enterprise Search has added some compelling features dealing with keyword query syntax giving users added flexibility in locating items via Search. In this post I’ll demonstrate using examples of free-text queries, operators, and property restrictions to narrow search results.
A free text query can contain a word or a phrase enclosed in single or double quotation marks. If the phrase is enclosed with single quotes all the words in will be treated as individual search terms while enclosing them in double quotes will search for the entire phrase.
The Boolean operators AND, NOT, and OR can be used with free text expressions as well as property restrictions in keyword queries to limit or expand the search criteria. For example using the search query Infrastructure AND SharePoint will return only those documents that contain both search terms however changing the Boolean operator to OR will return results that contain either term.
The NEAR operator is used in free text expressions and will return results where the keywords are within 8 terms of one another. In the example below the terms “PowerPivot” and “Installation” are present in either the title of contents of the document and within 8 terms of one another.
New in SharePoint 2010 is the support for a wildcard operator using an asterisk however this can only be done at the end of a search term so you may hear it referred to as prefix matching. For example if you are unsure of the spelling of a word you could type a partial term:
You can also use prefix matching for document properties:
Prefix matching cannot be used in free-text phrases:
Properties associated with items in SharePoint can be used to limit the search results using properties associated with the content being searched for. Common properties are author, filename, filetype, size, and title. Operators such as :, =, <, >, <=, >=, <> can be used but there cannot be any spaces between the property name, operator, and the value.
As you can see SharePoint 2010 includes some powerful query options from those found in previous releases allowing users more options to limit their query results.