Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Use multi_match instead of query_string #311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gerhard-boden
Copy link
Collaborator

By using multi_match instead of query_string within our search
query, we prevent the accidental injection of Lucene search query
strings. Currently an exception is thrown when adding " to your search query.

Using multi_match instead should lead to the same quality of results
and is less prone to user errors, because in 99% of cases the search is
used for classic search terms and no end user is expected to know the
compact Lucene query string syntax.

see: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-multi-match-query.html
see: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-query-string-query.html
see: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-query-string-query.html#query-string-syntax

By using ``multi_match`` instead of ``query_string`` within our search
query, we prevent the accidental injection of Lucene search query
strings. Currently an exception is thrown when adding ``"`` to your search query.

Using ``multi_match`` instead should lead to the same quality of results
and is less prone to user errors, because in 99% of cases the search is
used for classic search terms and no end user is expected to know the
compact Lucene query string syntax.

see: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-multi-match-query.html
see: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-query-string-query.html
see: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-query-string-query.html#query-string-syntax
@gerhard-boden gerhard-boden force-pushed the bugfix-use-multi-match-instead-of-query-string branch from 8beb99e to 3f90605 Compare June 25, 2019 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants