Lots of new and improved search capabilities are present in Liferay DXP 7.2, from new widgets to new APIs and infrastructure.
New and Improved Widgets
Add search widgets by clicking the Add
() icon on the page. Then expand
the Widgets → Search section.
Custom Filter
New Widget
Add a widget to the page for each of the filters you’d like applied to the search results. Let search page users see and manipulate the filters or make them invisible and/or immutable (this is just a cool word for “they can’t be changed”).
For example, add a custom filter to ensure that all returned results have the keyword street in the content field.
Sort
New Widget
The Sort widget reorders the results based on the value of certain keyword
fields in the index. For example, show results in alphabetic order of the Title
field. The default order is determined by the search engine’s Relevance
calculation.
Add more fields to the sort widget if the default options aren’t enough. Click
the widget Options () menu →
Configuration. Enter a human readable label and the
fieldName
to sort by. Just
make sure it’s a keyword
field.
Search Insights
Improved
Past versions of Search Insights showed you the full query string sent to the search engine, but now it also displays the response from the search engine with an explanation of the score for each search hit.
New Search Admin Functionality
The Search Admin functionality is found in Control Panel → Configuration → Search.
Search Engine Info
The displayed Search Engine information is enhanced, showing the client and node information as well as the vendor and operation mode.
Field Mappings
The Field Mappings tab shows the field mappings for all indexes in the search engine.
Indexing Progress
Indexing now displays a progress bar so you can see in the UI when the re-indexing action has completed.
New System Settings
Access the Search System Settings at Control Panel → Configuration → System Settings → Search.
There’s a new entry in the search category: Title Field Query Builder. Use it to configure how search responds to matches on the Title field of a document.
Exact Match boost: Give an additional boost when searched keywords exactly
match the title
field of a document.
Maximum Expansions: Limit the number of documents to return when matching
searched keywords to the title
field as a phrase prefix. See Elasticsearch’s
Match Phrase Query
documentation
for more information.
New Infrastructure
There are some important search infrastructure changes to know about.
Elasticsearch Support
Liferay DXP 7.2 supports Elasticsearch 6.5.x through 6.8.x, and 6.5.0 is included as the embedded version to use for testing out-of-the-box search behavior. See the deployment guide for more information.
Application-Specific Indexes
You’ll notice more search indexes in Liferay DXP 7.2. That’s because you can now
configure application-specific indexes. At the time of this writing, the
additional indexes are all related to the DXP Workflow Metrics feature. More
will likely appear in future versions, and third party developers can use the
portal-search
APIs to create their own indexes. It’s under development, so
visit the Search Framework
documentation
frequently to discover new search infrastructure changes that expose more
functionality for developers.
API Enhancements
Enhancements to the search framework APIs include
- Low level indexing and queries
- Operations directly on indexed documents (no need for the Indexer framework)
- New Aggregation types
Multi-Language Search
Liferay DXP’s support for multi-language search took a step forward, with improvements to Documents and Media and Web Content. More improvements are necessary in this area and will be prioritized in future releases. See the Multi-Language Search article for more information.