Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Adds support for elasticsearch 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krienbühl committed Mar 14, 2017
1 parent 87cd792 commit 28a9f64
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ env:
- TOXENV=py35 DEPLOY=no ES_BINARY=/tmp/elasticsearch/bin/elasticsearch ES_URL=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.2.2.tar.gz
- TOXENV=py34 DEPLOY=yes ES_BINARY=/tmp/elasticsearch/bin/elasticsearch ES_URL=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.4.3.tar.gz
- TOXENV=py35 DEPLOY=no ES_BINARY=/tmp/elasticsearch/bin/elasticsearch ES_URL=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.4.3.tar.gz
- TOXENV=py34 DEPLOY=yes ES_BINARY=/tmp/elasticsearch/bin/elasticsearch ES_URL=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-5.2.2.tar.gz
- TOXENV=py35 DEPLOY=no ES_BINARY=/tmp/elasticsearch/bin/elasticsearch ES_URL=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-5.2.2.tar.gz
- TOXENV=pep8 ES_URL=no DEPLOY=no

install: ./.travis-install.sh
Expand Down
6 changes: 2 additions & 4 deletions onegov/search/dsl.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from elasticsearch_dsl import Search as BaseSearch
from elasticsearch_dsl.result import (
Response as BaseResponse,
Result as BaseResult
)
from elasticsearch_dsl.result import Result as BaseResult
from elasticsearch_dsl.response import Response as BaseResponse


class Search(BaseSearch):
Expand Down
2 changes: 1 addition & 1 deletion onegov/search/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def query_aliases(self):

result = set()

infos = self.es_client.indices.get_aliases(
infos = self.es_client.indices.get_alias(
'{}-*'.format(self.normalized_hostname))

for info in infos.values():
Expand Down
2 changes: 1 addition & 1 deletion onegov/search/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def es_search(self, languages='*', types='*', include_private=False,

# by default, do not include any fields (this will still include
# the id and the type, which is enough for the orm querying)
search = search.fields([])
search = search.source(exclude=['*'])

return search

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def get_long_description():
platforms='any',
install_requires=[
'certifi',
'elasticsearch>=2.2.0,<3.0.0',
'elasticsearch-dsl>=2.0.0,<3.0.0',
'elasticsearch>=5.0.0,<6.0.0',
'elasticsearch-dsl>=5.0.0,<6.0.0',
'onegov.core>=0.22.0',
'webtest'
],
Expand Down

0 comments on commit 28a9f64

Please sign in to comment.