Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Polish docs for 0.4 release. Bump version to 0.4. Call myself maintai…

…ner.
  • Loading branch information...
commit bd422437581d0a5289b4abad3ea9ebf47acc7c0d 1 parent e3372e1
@erikrose erikrose authored
View
13 docs/source/changelog.rst
@@ -1,7 +1,7 @@
Changelog
=========
-v0.4 (unreleased)
+v0.4 (2013-03-19)
-----------------
* Support Python 3.
@@ -10,19 +10,18 @@ v0.4 (unreleased)
* ``get_settings``
* ``update_aliases`` and ``aliases``
* ``update`` (existed but didn't work before)
-* Fix the ``update`` method, which never worked.
-* Support the ``size`` param of the ``search`` method. (You can change
- ``es_size`` to ``size`` in your code.)
+* Support the ``size`` param of the ``search`` method. (You can now change
+ ``es_size`` to ``size`` in your code if you like.)
* Support the ``fields`` param on ``index`` and ``update`` methods, new since
ES 0.20.
-* Maintain precision of floats when passed to ES.
+* Maintain better precision of floats when passed to ES.
* Change endpoint of bulk indexing so it works on ES < 0.18.
* Support documents whose ID is 0.
* URL-escape path components, so doc IDs containing funny chars work.
* Add a dedicated ``IndexAlreadyExistsError`` exception for when you try to
- create an index that already exists. This allows you to trap this situation
+ create an index that already exists. This helps you trap this situation
unambiguously.
-* Add docs on upgrading from pyes.
+* Add docs about upgrading from pyes.
* Remove the undocumented and unused ``to_python`` method.
View
58 docs/source/migrate.rst
@@ -1,20 +1,19 @@
Migrating From ``pyes``
=======================
-Moving your project from ``pyes`` to ``pyelasticsearch`` is an easy process,
-particularly for most simple use cases. This page lists a couple code changes
-that may be necessary to complete your upgrade.
+Moving your project from ``pyes`` to ``pyelasticsearch`` is easy, especially
+for simple use cases. Here are some code changes that will aid your porting.
-* ``pyelasticsearch`` requires ``requests`` to be version 1.x. Breaking
- changes were introduced into ``requests``, so if your project was
- previously using 0.x, you may need to update your code (most likely change
- ``response.json`` to ``response.json()``)
+* ``pyelasticsearch`` requires ``requests`` 1.x. Breaking changes were
+ introduced in ``requests`` 1.0, so if your project was using a previous
+ version, you may need to update your code. Most likely, you just need to
+ change ``response.json`` to ``response.json()``.
-* Instantiating the client should be as simple as changing the invocation::
+* Instantiating the client should be as simple as changing the invocation... ::
pyes.ES(host, **kwargs)
- to::
+ ...to... ::
pyelasticsearch.ElasticSearch(host, **kwargs)
@@ -26,43 +25,44 @@ that may be necessary to complete your upgrade.
except pyelasticsearch.IndexAlreadyExistsError as ex:
print 'Index already exists, moving on...'
-* Instead of using ``pyes``'s ``_send_request``, you'll want to use
- :py:meth:`pyelasticsearch.ElasticSearch.send_request`. This also requires the
- path to be passed as an iterable instead of a string. For example::
+* Instead of using ``pyes``'s ``_send_request``, use
+ :py:meth:`~pyelasticsearch.ElasticSearch.send_request`. This also requires the
+ path to be passed as an iterable instead of a string. For example... ::
es._send_request('POST', 'my_index/my_doc_type', body)
- would become::
+ ...becomes... ::
connection.send_request('POST', ['my_index', 'my_doc_type'], body)
-* If using the ``indices`` keyword argument in ``pyes``, the
- ``pyelasticsearch`` analog is the ``index`` keyword argument.
+* The ``indices`` keyword argument in ``pyes`` turns to ``index`` in
+ ``pyelasticsearch``, whether the method takes multiple indices or not.
-* If using the ``doc_types`` keyword argument in ``pyes``, the
- ``pyelasticsearch`` analog is the ``doc_type`` keyword argument.
+* The ``doc_types`` keyword argument in ``pyes`` turns to ``doc_type`` in
+ ``pyelasticsearch``.
-* :py:meth:`pyelasticsearch.ElasticSearch.get` will raise a
- :class:`pyelasticsearch.exceptions.ElasticHttpNotFoundError` exception if
- no results are found.
+* :py:meth:`~pyelasticsearch.ElasticSearch.get` will raise
+ :class:`~pyelasticsearch.exceptions.ElasticHttpNotFoundError` if
+ the requested documents are not found.
* ``pyes`` expects arguments to ``index`` to be in a
- different order than :py:meth:`pyelasticsearch.ElasticSearch.index`. The
+ different order than our :py:meth:`~pyelasticsearch.ElasticSearch.index`. The
document to be indexed needs to be moved from the first positional argument
to the third.
-* :py:meth:`pyelasticsearch.ElasticSearch.send_request` will raise an error if
- no JSON content can be parsed from the response. In the event that you expect
- the response to not contain any JSON content, you will need to catch the
- exception and inspect the status code. For example::
+* :py:meth:`~pyelasticsearch.ElasticSearch.send_request` will raise an error if
+ the response can't be converted to JSON. If you expect that a response will
+ not be JSON, catch the exception and inspect the status code. For example...
+ ::
+ connection = ElasticSearch(host)
try:
- # Check for the existence of the "pycon" index
+ # Check for the existence of the "pycon" index:
connection.send_request('HEAD', ['pycon'])
- except Exception as ex:
- if ex.response.status_code == 200:
+ except InvalidJsonResponseError as exc:
+ if exc.response.status_code == 200:
print 'The index exists!'
* If using ``search_raw`` from ``pyes``, you can use
- :py:meth:`pyelasticsearch.ElasticSearch.search` and, if necessary, rename
+ :py:meth:`~pyelasticsearch.ElasticSearch.search` and, if necessary, rename
the keyword arguments.
View
2  pyelasticsearch/__init__.py
@@ -11,7 +11,7 @@
__all__ = ['ElasticSearch', 'ElasticHttpError', 'InvalidJsonResponseError',
'Timeout', 'ConnectionError', 'ElasticHttpNotFoundError',
'IndexAlreadyExistsError']
-__version__ = '0.3'
+__version__ = '0.4'
__version_info__ = tuple(__version__.split('.'))
get_version = lambda: __version_info__
View
4 setup.py
@@ -26,8 +26,8 @@ def find_version(file_path):
.splitlines()[1:]),
author='Robert Eanes',
author_email='python@robsinbox.com',
- maintainer='Jannis Leidel',
- maintainer_email='jannis@leidel.info',
+ maintainer='Erik Rose',
+ maintainer_email='erik@mozilla.com',
license='BSD',
packages=find_packages(),
include_package_data=True,
Please sign in to comment.
Something went wrong with that request. Please try again.