diff --git a/src/api/database/find.rst b/src/api/database/find.rst index e5f5eeff..7bf7ae5b 100644 --- a/src/api/database/find.rst +++ b/src/api/database/find.rst @@ -965,9 +965,6 @@ built using MapReduce Views. :query string type: Can be ``"json"`` or ``"text"``. Defaults to json. Geospatial indexes will be supported in the future. *Optional* Text indexes are supported via a third party library *Optional* - :query json partial_filter_selector: A :ref:`selector ` - to apply to documents at indexing time, creating a - :ref:`partial index `. *Optional* :query boolean partitioned: Determines whether a JSON index is partitioned or global. The default value of ``partitioned`` is the ``partitioned`` property of the database. To create a global index on a @@ -987,14 +984,18 @@ built using MapReduce Views. :code 200: Index created successfully or already exists :code 400: Invalid request :code 401: Admin permission required + :code 404: Database not found :code 500: Execution error -**Index object format for JSON type indexes** + The `Index object` is a JSON object with the following fields: -The index object is a JSON array of field names following the :ref:`sort -syntax `. Nested fields are also allowed, e.g. `"person.name"`. + :json array fields: array of field names following the :ref:`sort + syntax `. Nested fields are also allowed, e.g. `"person.name"`. + :json json partial_filter_selector: A :ref:`selector ` + to apply to documents at indexing time, creating a + :ref:`partial index `. *Optional* -Example of creating a new index for the field called ``foo``: + Example of creating a new index for a field called ``foo``: **Request**: @@ -1034,19 +1035,36 @@ The returned JSON confirms the index has been created: Example index creation using all available query parameters -.. code-block:: javascript + **Request**: - { - "selector": { - "year": { - "$gt": 2010 + .. code-block:: http + + POST /db/_index HTTP/1.1 + Content-Type: application/json + Content-Length: 396 + Host: localhost:5984 + + { + "index": { + "partial_filter_selector": { + "year": { + "$gt": 2010 + }, + "limit": 10, + "skip": 0 + }, + "fields": [ + "_id", + "_rev", + "year", + "title" + ] + }, + "ddoc": "example-ddoc", + "name": "example-index", + "type": "json", + "partitioned": false } - }, - "fields": ["_id", "_rev", "year", "title"], - "sort": [{"year": "asc"}], - "limit": 10, - "skip": 0 - } By default, a JSON index will include all documents that have the indexed fields present, including those which have null values. diff --git a/src/api/server/common.rst b/src/api/server/common.rst index f8aef45b..a63748cb 100644 --- a/src/api/server/common.rst +++ b/src/api/server/common.rst @@ -1728,7 +1728,7 @@ containing only the requested individual statistic. :>header Content-Type: :mimetype:`application/json` :code 200: Request completed successfully - :code 404: The server is unavaialble for requests at this time. + :code 404: The server is unavailable for requests at this time. **Response**: diff --git a/src/conf.py b/src/conf.py index bcd1ddc5..3f7996ac 100644 --- a/src/conf.py +++ b/src/conf.py @@ -34,7 +34,7 @@ # should be over-written using rebar-inherited settings version = "3.1" -release = "3.1.0" +release = "3.1.1" project = u"Apache CouchDB\u00ae"