Hi and thanks for offering this module to the community! We really appreciate.
This module seems to send search queries as Query String queries which use the Lucene syntax (see codebase).
According to the Elastic documentation this type of query is not very forgiving ; instead it is recommended to use Match queries for search boxes:
Warning
Because it returns an error for any invalid syntax, we don’t recommend using the query_string query for search boxes.
If you don’t need to support a query syntax, consider using the match query. If you need the features of a query syntax, use the simple_query_string query, which is less strict.
We were able to confirm these limitations on our own installation: user-provided search queries do not always return results, for instance because the user provided a special character (hyphen) or because it includes a typical stopword ("of", "the", etc).
How about adding support for the recommended Match queries (or rather Multi-match queries), which expects a search query written by a human and is more appropriate for full-text search? According to the Elastic documentation:
The match query is the standard query for performing a full-text search, including options for fuzzy matching.
We have noticed that this module used to support Match queries in 2019 → and 2022, but we were not able to find the reason why you switched to Query String queries. Why did you switch? Would you be open to adding back support to Match queries?
Attached is a proposed patch that adds support for Multi-match queries (when the parse mode is set to Direct). It can be tested by building a Search API View and setting the Parse mode of the fulltext field to Direct
:
Needs review
8.0
Elasticsearch Connector Search API
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.