As explained in the Search introduction, all indexed assets can be returned as search results. Since any developer can create their own assets, your Liferay Portal instance might have additional asset types beyond the ones that Liferay Portal ships with by default.
The search bar is where users enter the search context. Users enter search terms, hit their Enter button (or click the magnifying glass icon), and they’re taken to a maximized view of the search portlet displaying any results and facets that apply.
Entering Search Terms
Liferay Portal, backed by Elasticsearch, supports full text search. It does not, however, support advanced search syntax, such as Elasticsearch’s query string syntax. That means you can’t search specific fields, use wildcards like *, or boolean operators like AND/OR/NOT. Liferay is weighing the costs and benefits of enabling the use of string queries out of the box in a future version of Liferay Portal.
Prefix searching is cool. If you’re searching in a site for classical musicians, you might search for the term instrument. This search of course returns documents with the full word in them, but it also returns variants with instruments as the prefix. For example, results with instruments, instrumental, and instrumentation would also be returned.
Another way to ensure users see results is using the spell check settings.
Spell Checking User Queries
Spell check settings allow administrators to configure the Search application so that if a user types a search term that doesn’t return many results (for example, a slightly misspelled werd), the user can be prompted to improve their search.
To configure the spell check settings, click the options () button and select Configuration. The tab displayed is Display Settings, and next to it is the Spell Check Settings tab. Here you can configure the Search application to help users when their initial query doesn’t yield many results.
There are three main settings here:
- Display “Did you mean…” if the number of search results does not meet the threshold.
- Present users alternate, spell checked search queries if their search did not return a minimum number of results (50 by default).
- Display Related Queries
- Display up to a maximum number of alternative queries (5 by default) if the user’s query doesn’t return a minimum number of results (0 by default).
- Add New Related Queries Based on Successful Queries
- Index a user’s search query if it produces a minimum number of results (50 by default). If the Display Related Queries setting is enabled, it can be used as a related query for similar search queries that don’t produce enough results.
In addition to enabling or disabling the spell check settings, thresholds for all of the settings are changeable, to produce the desired behavior.