Cover all the various ways we support searching from third party code, and when to use each. This is a necessary component to exposing the new 7.2 APIs: Queries, Filters, Aggregations, Sorts, etc.
New in 7.2:
- Intro: APIs moved to com.liferay.portal.search.api module
- some are now duplicated: also preserved in the Portal Core (com.liferay.portal.kernel) for backward compatibility reasons)
- "Legacy APIs":
- APIs provided by "com.liferay.portal.kernel" artifact are considered legacy in terms of no development, additions are made, only kept for backward compatibility and will be removed in a future release.
- Done in current Queries and Filters intro: New Query Types
- To be collected
- New Aggregation Types, partially completed
- https://github.com/liferay/liferay-portal/tree/7.2.x/modules/apps/portal-search/portal-search-api/src/main/java/com/liferay/portal/search/aggregation. These Liferay counterparts of Elasticsearch aggregations: https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-aggregations.html
- Script Query, Function Score Query, Percolate Query, Regex Query, Ids Query, Exists Query, Constant Score Query, Common Terms Query. Boosting Query, Geo Bounding Box Query, Geo Distance Range Query, Geo Polygon Query
- New Highlight Subsystem
- https://github.com/liferay/liferay-portal/tree/7.2.x/modules/apps/portal-search/portal-search-api/src/main/java/com/liferay/portal/search/highlight. Interfaces: [Highlight, FieldConfig] x [Builder, BuilderFactory]
- New Significance Subsystem
- New Sort Subsystem
- Contribute Search permission fields and filters via extension points (
- In addition to standard permission support in Search, a developer may need to implement supplemental visibility: return extra results to current user, in addition to VIEW permissions, according to some special criteria.
- To achieve this effect, new extension points were added for developers to implement:
- Contribute extra fields when indexing permissions : SearchPermissionFieldContributor - Indexes new permission checking fields in a search document. These fields can be matched when returning search results via a corresponding SearchPermissionFilterContributor. Register implementations of this interface as OSGi components using the service SearchPermissionFieldContributor.
- Contribute extra filters when building permission clauses, to match the extra fields indexed: SearchPermissionFilterContributor - Contributes new filters for checking permissions on search results. Matches are based on the fields indexed by the corresponding SearchPermissionFieldContributor. Register implementations of this interface as OSGi components using the service SearchPermissionFilterContributor.
- Usage example: (
LPS-83563) Ensure that Document Library Search considers sharing permissions. Search results are filtered based on the permissions of the user viewing the results. We need to extend the permission check behaviour in search so the user can also see documents that have been shared with him even if he doesn't have VIEW permission on the document using the regular role/permission mechanism.
- Cover ModelIndexerWriterContributor.getIndexerWriterMode and modelIndexed
- Highlight that it's not a good idea to trigger a reindex of another entity from a ModelIndexerWriterContributor.modelIndexed method otherwise we can get dangerous into a depth first search algorithm
- Extending the Search Page with Portlet Shared Search Contributors com.liferay.portal.search.web.portlet.shared.search.PortletSharedSearchContributor (as of 7.1)
- Used by all moduralized Search widgets
- Facet Search Contributors, plug and play
- Federated Search Documentation - Developer
LPS-94383: changed public void setSize(int size) to public void setSize(Integer size) and public void setStart(int start) to public void setStart(Integer start) in com.liferay.portal.search.engine.adapter.search.SearchSearchRequest