The CONTAINS and FREETEXT predicates are part of the WHERE clause, and support searching for words and phrases in text columns. The CONTAINS predicate supports matching words, matching inflectional forms of words, searches using wildcards, and proximity searches. This makes the CONTAINS predicate well suited for performing word or phrase matches. The FREETEXT predicate is better suited for finding documents containing combinations of the search terms spread throughout the document contents and properties. The BestBetKeyword property contains the list of search terms for which a document should appear as a Best Bet.
The default query combines CONTAINS and FREETEXT matches on the BestBetKeyword property with FREETEXT matches on content and a fixed selection of relevant properties that are assigned attribute weights. The query distinguishes between properties identified as good indicators of content, such as Title, Description, or Keywords, and other properties that appear in the full-text index.
The following table shows the properties used as strong indicators for content in the default query, and the weight they receive.
Properties and attribute weights used in the default query for the dashboard site are subject to change.
Properties and Sample Weights
Property | Weight |
---|---|
urn:schemas-microsoft-com:office:office#Author | 0.5 |
urn:schemas-microsoft-com:office:office#Keywords | 0.8 |
urn:schemas-microsoft-com:office:office#Subject | 0.8 |
urn:schemas-microsoft-com:office:office#Title | 0.8 |
urn:schemas.microsoft.com:fulltextqueryinfo:description | 0.8 |
The default query coerces some overlap between the result sets for the three predicates so that it promotes highly relevant matched documents into the Best Bets range displayed on the dashboard site. To avoid intermixing Best Bets with document results, the default query performs the coercion on a predicate basis. The Results Web Part on the dashboard site displays the first five Best Bets with a rank of over 500.
The following table shows the three default query predicates and the rank they receive.
Query predicates and rank coercion functions used in the default query for the dashboard site are subject to change.
Predicates and Rank
Predicate | Rank |
---|---|
CONTAINS on BestBetKeywords | 1000/999 |
FREETEXT on BestBetKeywords | 500-999 |
FREETEXT on document content and selected list of properties | 0-600 |
The default query normalizes the query results and orders them by rank.
The following example, written in Search SQL, demonstrates the Best Bets determined in the document-matching portion of the default query. The query is for "SharePoint Portal Server."
SELECT "DAV:href", "DAV:displayname", "DAV:getlastmodified", "DAV:iscollection", "urn:schemas-microsoft-com:office:office#Title", "urn:schemas-microsoft-com:office:office#Author", "urn:schemas.microsoft.com:fulltextqueryinfo:description", "urn:schemas-microsoft-com:publishing:ShortcutTarget", "urn:schemas-microsoft-com:publishing:isdoclibrarycontent", "urn:schemas-microsoft-com:publishing:DiscussionTarget", "urn:schemas.microsoft.com:fulltextqueryinfo:rank" FROM SCOPE('DEEP TRAVERSAL OF "/workspace"') WHERE WITH ( Contents:0.5, "urn:schemas-microsoft-com:office:office#Author":0.5, "urn:schemas-microsoft-com:office:office#Keywords":0.8, "urn:schemas-microsoft-com:office:office#Subject":0.8, "urn:schemas-microsoft-com:office:office#Title":0.8, "urn:schemas.microsoft.com:fulltextqueryinfo:description":0.8) AS #WeightedProps ((CONTAINS("urn:schemas-microsoft-com:publishing:BestBetKeywords", '"SharePoint Portal Server"') RANK BY COERCION(absolute, 999)) OR ((FREETEXT("urn:schemas-microsoft-com:publishing:BestBetKeywords", 'SharePoint Portal Server') RANK BY COERCION(multiply, 0.5)) RANK BY COERCION(add, 500)) OR ((FREETEXT(#WeightedProps, 'SharePoint Portal Server') OR CONTAINS("DAV:displayname", '"SharePoint Portal Server"')) RANK BY COERCION(multiply, 0.6)) ) AND NOT ("DAV:contentclass" = 'urn:content-classes:categoryfolder') AND NOT ("DAV:contentclass" = 'urn:content-classes:rootcategoryfolder') ORDER BY "urn:schemas.microsoft.com:fulltextqueryinfo:rank" DESC
If a document's BestBetKeyword property has the value "SharePoint Portal Server," the default query returns that document in the top band as an exact match. If a document's BestBetKeyword property contains the value "SharePoint," the default query returns that document in the middle band. If a document has a custom property Product with the value "SharePoint Portal Server," or the document contains the words "sharepoint", "portal" or "server", the default query returns the document in the last band. The probabilistic ranking algorithm employed by SharePoint Portal Server ranks documents containing occurrences of all three terms much higher than a document containing only one of the terms.
This portion of the default query excludes category folders from these results, as it includes them in the category portion of the default query.