This article lists a few simple search operators that may be used to improve search results within the Liferay Support Knowledge Base.
Resolution
While the current search capabilities are generally adequate for finding sought-after content, some searches may benefit from the use of search operators. Here are a few common operators:
-
"_____" (Quotes)
- Putting quotes around a phrase forces search to look for an exact match of that "phrase" (instead of returning results that have either of those words)
- e.g. "support policy" will return pages with exact phrase: "Support Policy" (if you didn't use the quotes, you'd get every article with either "support" or "policy")
-
- (Hyphen)
- The '-' before a word will cause search to exclude any articles that contain that word!
- e.g. LDAP -"support policy" will return any article with "LDAP" but will exclude articles that contain the phrase "Support policy".
-
title:
- Entering 'title:' before a word will perform a search for the following text in the title of the article rather than the body.
- e.g. title:SSO will turn up articles with SSO in the title (3 search results) as opposed to a plain 'sso' search which will include any article with the 'sso' string in the body (60 results)
-
+
- This is a way to indicate that a term must be in a search when there are multiple words.
- e.g. +lucene "known issue" will return results that contain 'lucene' and may contain 'known issue'
- +lucene +"known issue" will return results that contain 'lucene' and contain 'known issue'
In addition to some of these basic operators, there are a number of other more advanced operators that may be of value in some instances:
-
^ (Boost)
- This allows you to "boost" the relevance of a word.
- e.g. index^4 lucene will favor the word 'index' more than lucene.
-
AND
- Allows you to search for articles that contain multiple search terms (rather than either search term)
- e.g. solr AND lucene will return articles with both 'solr' and 'lucene' in the article
-
NOT
- Allows you to search for articles that do not include certain search terms.
- e.g. solr NOT lucene will return articles with ther term 'solr' and not 'lucene'
Additional Information
For more on Lucene-based search operators, see their article here.