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

Error in getting analyzer code running #17

Open
AtinAngrish opened this issue Feb 5, 2019 · 1 comment
Open

Error in getting analyzer code running #17

AtinAngrish opened this issue Feb 5, 2019 · 1 comment

Comments

@AtinAngrish
Copy link

Tried using the code for analyzer as given in chapter 3 codes and got the following error. I am unable to understand whats wrong. ES version is 6.5. Any ideas on how to solve this will be appreciated. Thanks!

error:
root_cause:

  • type: "illegal_argument_exception"
    reason: "Failed to parse request body"
    type: "illegal_argument_exception"
    reason: "Failed to parse request body"
    caused_by:
    type: "json_parse_exception"
    reason: "Unrecognized token 'Fire': was expecting ('true', 'false' or 'null')\n
    \ at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@1d20d049;
    \ line: 1, column: 6]"
    status: 400
@freesinger
Copy link

freesinger commented Sep 9, 2019

Since the ES version in this repository is v2.0, which is too out-of-date to be compatible with the present version.
You could run codes below which seem to be OK with my v7.3 ES.

def analyze(text, field):
    response = requests.get(
        ESADR + '/tmdb/_analyze?format=yaml', 
        json={'text': text, 'field': field}
    )
    print(response.text)
    
# test
analyze("Fire with Fire", "title")

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