Closed damisul closed 1 year ago
There is several differences in fulltext search implementation:
Query_string queries allows to use special syntax to define complex query options like operators, etc. But it is not recommended for use with user-provided query strings, as if provided string will have syntax errors, it will end up with error.
ElasticSearch docs proposes to use 'simple_query_string' queries for user-provided data. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html. If user will provided wrong query, it will silently ignore non-parseable parts of query instead of causing errors.
So to summarize, I propose to use simple_query_string queries for fulltext search and make it to work on 'fulltext', 'author_string' and 'title' fields of work. Also we need to use 'AND' operator by default.
NOTE: with this change API search will not work exactly in same way as website search (e.g. it will not work among persons), but it will work in a 'more similar way'.
Causes this issue: https://github.com/orgs/projectbenyehuda/projects/1