bungiesearch icon indicating copy to clipboard operation
bungiesearch copied to clipboard

Bungiesearch support for ES2.0+

Open jjhuang opened this issue 8 years ago • 0 comments

Hi, are there plans for a version of Bungiesearch that supports ES2.x? I've attempted to run Bungiesearch on the latest Elasticsearch (2.2.1) and have identified a few minor fixes that need to be made to support this (though there's possibly more):

  • As pointed out in https://github.com/ChristopherRabotin/bungiesearch/issues/145, the timeout parameter now requires a unit. In search_index.py, when creating the index we send a default timeout of int 30, but now it has to be a string like 30s.
  • You can no longer set _id when executing /PUT mapping. This means when we call get_mapping() we need to exclude Elasticsearch's meta fields when using it in the context of creating indices. https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_mapping_changes.html

As far as I can tell, the above two changes were the "main" things that prevent Bungiesearch from being compatible with both the newer Elasticsearch server as well as newer versions of elasticsearch-dsl.

I originally planned to make this PR, but discovered that all the Bungiesearch tests failed completely due to the new 2.0 restriction where types that exist in the same index can no longer have fields with the same name IF the mappings are different. In the tests, there are numerous models that share fields such as description, title or updated yet use differing mappings. So, either the mappings need to be unified or the field names have to be changed. I'm not too keen about submitting a PR that hacks up the test files especially since I don't have full knowledge of the intended coverage.

Thanks!

jjhuang avatar Mar 30 '16 23:03 jjhuang