zackiles / elasticsearch-odm

Like Mongoose but for Elasticsearch. Define models, preform CRUD operations, and build advanced search queries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.connect returning 400 if the index doesn't exists

opened this issue · comments

The documentation says that the connect would create the index if it doesn't exists, but using it with elasticsearch-5.1.1 would return a 400 response on every call.

Elasticsearch 5.x has breaking changes and some part of the code must be updated.
a work is in progress here : https://github.com/bloublou2014/elasticsearch-odm/tree/es-5.x and should be merged to this project when done.

@zackiles : what is your status about supporting ES 5.x ?

I'll take a look this weekend, but might need help tackling this as I'm very busy in my day job. Thanks for letting me know!

Thanks Zachary, I was looking at a higher level lib to use with ES on my project, but think I'll go back to the official low-level one. As I'm learning/using it for the first time, thought at least that would introduce less levels of abstraction on errors I get could be more helpful.

Looks like ES 5 has a few breaking changes, after I created the index on EL, when attempting to index a document, I was getting a 404 because of invalid query arguments provided when attempting to create a mapping.

I noticed the same, but am currently using this project in my current job on ES5 by turning off auto mapping. You can do this by passing 'syncMapping: false' in the connection options if you wanted. ES still has pretty decent auto mapping already, so it's likely not needed.