Issue
- Search results are not correct with the type facet
-
Steps to reproduce:
1) Create 4-5 web contents with the following titles just for testing purposes:Content for testing
2) Create two content pages
Content-on
Content-in
Content-or
Content-toPage for information
3) Now, create a new site with one content page.
Page for testing
4) On this content page, add 'Type Facets', 'Search Bar', 'Search Results'
5) Select 'Search Bar' and set scope 'Everything' from 'this Site'
6) Select 'Type Facets' and choose only page and web content articles.
7) Publish this page.
Expected Behavior: When searching for any keyword from 'on', 'in', 'for', 'in', or 'to', the corresponding web content should return.
Observed Behavior: When users search for any keyword, they only get pages, not web content.
Environment
- Liferay DXP 7.4 update 31
Resolution
- The observed behavior is the expected behavior with the search functionality.
-
Web Content is not searchable using stopwords in order to provide better matches by ignoring irrelevant search terms, this is defined by the search engine stopword analyzer.
- For example, English stop words that are ignored by the search engine https://www.elastic.co/guide/en/elasticsearch/reference/7.17/analysis-stop-tokenfilter.html
Additional Information
- Assets will have slightly different search behavior. This is because of two general reasons, first that some assets are localized (and therefore utilize analyzers) and some are not. (Web Content is localized but Documents are not). The second reason is each asset is considered within its context when tuning how searchable the asset is. Because of these reasons, there are differences between the search results between assets.
- Related: No results are returned when searching for a specific term because it is a Elasticsearch stopword