o19s / relevant-search-book

Code and Examples for Relevant Search
303 stars 109 forks source link

Error in getting analyzer code running #17

Open AtinAngrish opened 5 years ago

AtinAngrish commented 5 years ago

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:

freesinger commented 5 years ago

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")