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: ElasticSearchQueryBuilder removes json encode generated quotes #400

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

Conversation

gjwnc
Copy link
Contributor

@gjwnc gjwnc commented Dec 6, 2022

By default the ES CR Adaptor uses query_string which allows some search syntax in query string.

In the current implementation, json_encode is used on the query string which adds double quotes around the search term,
e.g. brown fox is json encoded to "brown fox". Then trim is used to remove the ".

Since one can use double quotes in the search term itself, e.g. quick "brown fox" this results in json encoded "quick \"brown fox\"". If you use trim you get invalid json which causes an exception because of invalid syntax in the ES query: quick \"brown fox\.

This PR, just removes the outer quotes created by json_encode.

@gjwnc
Copy link
Contributor Author

gjwnc commented Dec 6, 2022

I just noticed, that this issues is mentioned here #311 . Since, it could depend on the use case, both PR's might be considered independent.

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.

1 participant