Affects Version/s: 7.1.10 DXP GA1, 7.1.X, 7.2.0 GA1, 7.2.10 DXP FP4, 7.2.X, Master
Component/s: Search Infrastructure
Branch Version/s:7.2.x, 7.1.x
Backported to Branch:Committed
Sprint:Search|S03 Sprint 13| 3.16-4.6, Search|S03 Sprint 14| 4.6-4.27
Git Pull Request:
Description: Unable to set an alternate search engine in 7.1 and 7.2 for DLFileEntry, which was possible in 7.0.
By default, documents are indexed and searched with the search engine corresponding to the ID "SYSTEM_ENGINE"
However, using a portal property you can specify which search engine will be used to index/search documents for any given model:
Note 1: For any given search only 1 search engine will be queried. The search engine that is used depends on the indexer that is performing the search. For a single indexer search, the SYSTEM_ENGINE will be used unless an alternate search engine has been set in index.search.engine.id. In the case of a multi-indexer search, com.liferay.portal.search.internal.searcher.FacetedSearcherImpl will use SYSTEM_ENGINE, unless an alternate search engine is set, ie index.search.engine.id[com.liferay.portal.search.internal.searcher.FacetedSearcherImpl]=SEARCH_ENGINE_1. Point being, whether its a single indexer search, or a multi-indexer search, only 1 search engine will be used. This means that if documents are indexed into different search engines, it will not be possible to return all of them in a single search.
Note 2: For indexers extending BaseIndexer, the indexer class name is used as the filter in the portal property. For DefaultIndexer's, the class name used in the *SearchRegistrar to register and create the ModelSearchDefinition/ModelSearchSettings is used as the filter in the portal property. There are also cases where 2 separate indexers are used for indexing/searching, ie com.liferay.bookmarks.model.BookmarksEntry and com.liferay.bookmarks.search.BookmarksSearcher to index and search Bookmarks
Steps to reproduce:
- In portal-ext.properties, set
- Start portal, create a Document called alpha
- In the Documents and Media search bar, search for alpha
Expected Result: Search would not find the document because an alternate search engine has been set for DLFileEntry/DLSearcher.
Actual Result: The document is found in the search results.
Optional: To test that using an alternate search engine works after the fix:
Configure the Solr Connector to use a different search.engine.id:
1) Go to SolrSearchEngineConfigurator and change
2) Go to SolrSearchEngine and change
3) Start a Solr server and deploy the Solr module
4) Repeat original steps 1-3. The document should be found when performing a search.
5) Create a web content article called alpha
6) Go to the home page and use the Search Bar to search for alpha
Expected Result: Search would only find the web content article and not the document because the "SYSTEM_ENGINE" ID is being used for the search.