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

Elasticsearch: Add charset #2008

Merged
merged 1 commit into from
Nov 12, 2019
Merged

Elasticsearch: Add charset #2008

merged 1 commit into from
Nov 12, 2019

Conversation

pecorarista
Copy link
Contributor

Purpose

Queries sent from ElasticsearchSource.typed ignore non-ascii characters.
For example, the query created by the following code

ElasticsearchSource
  .typed[Document](
    "documents",
    "_doc",
    query = """{ "match": { "content": "先生" } }"""
  )

is recorded in logs/elasticsearch_index_search_slowlog.log as

source[{"size":10,"query":{"match":{"content":{"query":"??","operator":"OR","prefix_length":0,"max_expansions":50,"fuzzy_transpositions":true,"lenient":false,"zero_terms_query":"NONE","auto_generate_synonyms_phrase_query":true,"boost":1.0}}},"sort":[{"_doc":{"order":"asc"}}]}]

where "先生" is "??".

Changes

  • Add StandardCharset.UTF_8 to StringEntity in ElasticsearchSourceStage.scala as in ElasticsearchFlowStage.scala

@lightbend-cla-validator

Hi @pecorarista,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

http://www.lightbend.com/contribute/cla

@ennru ennru changed the title Fix missing charset Elasticsearch: Add charset Nov 12, 2019
Copy link
Member

@ennru ennru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ennru ennru merged commit b0b2f1a into akka:master Nov 12, 2019
@ennru ennru added this to the 2.0.0 milestone Nov 12, 2019
@ennru
Copy link
Member

ennru commented Nov 12, 2019

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants