Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Marked release 0.15

  • Loading branch information...
commit 27d00eac9030cc9c4dfce9231ad1094f1470a3ca 1 parent 99ecab7
Alberto Paro authored
2  docs/index.rst
View
@@ -15,7 +15,7 @@ Contents:
.. toctree::
:maxdepth: 1
- elasticsearch/index
+ guide/index
Indices and tables
2  pyes/__init__.py
View
@@ -4,7 +4,7 @@
import logging
logger = logging.getLogger(__name__)
-VERSION = (0, 14, 0)
+VERSION = (0, 15, 0)
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Alberto Paro"
5 pyes/convert_errors.py
View
@@ -47,9 +47,12 @@ def raise_if_error(status, result):
if status < 400:
return
- if not isinstance(result, dict) or 'error' not in result:
+ if not isinstance(result, dict) or result.get('error') is None:
raise pyes.exceptions.ElasticSearchException("Unknown exception type", status, result)
+ if status == 400:
+ raise pyes.exceptions.NotFoundException("")
+
error = result['error']
bits = error.split('[', 1)
if len(bits) == 2:
6 pyes/es.py
View
@@ -123,9 +123,9 @@ def __init__(self, server, timeout=5.0, bulk_size=400,
self.autorefresh = autorefresh
self.refreshed = True
self.dump_curl = None
- if dump_curl:
- # TOFIX: OS independent!
- self.dump_curl = open(os.path.join("/tmp", dump_curl + ".sh"), "wb")
+ #if dump_curl:
+ # # TOFIX: OS independent!
+ # self.dump_curl = open(os.path.join("/tmp", dump_curl + ".sh"), "wb")
#used in bulk
self.bulk_size = bulk_size #size of the bulk
6 pyes/tests/pyestest.py
View
@@ -5,10 +5,8 @@
"""
import unittest
-from pyes import ES, file_to_attachment
-from pyes.exceptions import NotFoundException
+from pyes import ES
from pprint import pprint
-import os
def get_conn():
return ES('127.0.0.1:9200')
@@ -17,7 +15,7 @@ class ESTestCase(unittest.TestCase):
def setUp(self):
self.conn = get_conn()
self.conn.delete_index_if_exists("test-index")
-
+
def tearDown(self):
self.conn.delete_index_if_exists("test-index")
2  pyes/utils.py
View
@@ -125,7 +125,7 @@ def clean_highlight(self):
if not self.valid:
return
- for hit in self._results['hits']:
+ for hit in self._results['hits']['hits']:
if 'highlight' in hit:
hl = hit['highlight']
for key, item in hl.items():
Please sign in to comment.
Something went wrong with that request. Please try again.