With 6.2 and Lucene/Solr, it was possible to do some searching using the Lucene syntax with boolean operators and wildcards:
Lucene's QueryParser was used to parse the input "keywords" into a Lucene query supporting the standard syntax so it could interpreted the operators and other special characters.
With Liferay 7, switched to a new approach: it uses specific queries using the Query APIs to construct the expected query for a given field such as Match, Phrase, Keyword, Range, TermRange etc. It creates a Query StringQuery (which is for to support parsing in Elasticsearch and Solr) only as a fallback when none of the built-in query-translators can be applied to the input.
End result, advanced searching is not implemented with this new approach.
Add support for Lucene-based syntax so that it can be used with Elasticsearch as well as Solr.
- Create wiki pages with the following data:
- Configure Search Portlet -> Other Settings > Enable "Use Advanced Search Syntax"
Syntax Cheat Sheet
- Search for title:(liferay OR java)
Expected: Search returns 2 results - (Wiki1, Wiki3)
- Search for title: liferay OR content: liferay
Expected Search should return 3 results - (Wiki1, Wiki4, Wiki5)
- Search for content: (liferay AND !lucene)
Expected Search should return 1 result - (Wiki5)
TBA (Please add more.)