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

TypeError: the JSON object must be str, not 'bytes' #1

Open
melewitz opened this issue Jan 15, 2018 · 1 comment
Open

TypeError: the JSON object must be str, not 'bytes' #1

melewitz opened this issue Jan 15, 2018 · 1 comment

Comments

@melewitz
Copy link

Hello Enesto,

Thanks for the humorous intro to elasticsearch!

Running through your examples using python 3.5, I get the type error noted in the headline. Apparently the content type returned from request.get() is now bytes instead of str. In addition, some of the names in your 18+ retrieval set contain unicode characters.

To resolve the problem I changed each reference from res.content to res.content.decode() and everything loads as expected.

Two additional issues exist though:

  1. The "Darth Vader" search returns no hits.
  2. The "fuzzy_like_this_field" search returns an error:
    RequestError: TransportError(400, 'parsing_exception', 'no [query] registered for [fuzzy_like_this_field]')

I don't know if you intend to maintain this or not, but wanted to thank you for the brief tutorial and let you know about the issues.

Marc

@annajeanine
Copy link

Same problem!

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

No branches or pull requests

2 participants