summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlynn Bird <glynn.bird@gmail.com>2023-05-04 15:22:14 +0100
committerGitHub <noreply@github.com>2023-05-04 15:22:14 +0100
commit17a99712ecfee2d1e02ec5ed57cbc82fd8a8493c (patch)
treee6f02785e2312e6cd42f033d657a9c77177ffb16
parente659a971c5551abae1ae06950a7d4f72277f04bf (diff)
downloadcouchdb-17a99712ecfee2d1e02ec5ed57cbc82fd8a8493c.tar.gz
Nouveau doc fixes (#4572)
* FIX NOUVEAU DOCS - MISSING PARAMETER The Nouveau docs contain guidance on how to code definsively for handling docs with missing attributes. All of the code blocks in this section are missing the first parameter which indicates the data type to be indexed by Lucene. * FIX NOUVEAU DOCS - SWAP query= for q= In some places in the Nouveau API examples, there was a `query=` parameter, when it should be `q=`.
-rw-r--r--src/docs/src/ddocs/nouveau.rst18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/docs/src/ddocs/nouveau.rst b/src/docs/src/ddocs/nouveau.rst
index 7a9e6d217..0f6068615 100644
--- a/src/docs/src/ddocs/nouveau.rst
+++ b/src/docs/src/ddocs/nouveau.rst
@@ -159,7 +159,7 @@ most common runtime errors are described below;
.. warning:: example of bad code
.. code-block:: javascript
- index("min_length", doc.min_length, {"store": true});
+ index("double", "min_length", doc.min_length, {"store": true});
For documents without a `min_length` value, this index call will
pass ``undefined`` as the value. This will be rejected by nouveau's
@@ -171,7 +171,7 @@ validation function and the document will not be indexed.
.. code-block:: javascript
if (doc.foo.bar) {
- index("bar", doc.foo.bar, {"store": true});
+ index("string", "bar", doc.foo.bar, {"store": true});
}
This bad example fails in a different way if ``doc.foo`` doesn't
@@ -180,7 +180,7 @@ exist; the evaluation of ``doc.foo.bar`` throws an exception.
.. code-block:: javascript
if (doc.foo && typeof(doc.foo) == 'object' && typeof(doc.foo.bar == 'string')) {
- index("bar", doc.foo.bar, {"store": true});
+ index("string", "bar", doc.foo.bar, {"store": true});
}
This example correctly checks that ``doc.foo`` is an object and its
@@ -192,7 +192,7 @@ This example correctly checks that ``doc.foo`` is an object and its
.. code-block:: javascript
if (doc.min_length) {
- index("min_length", doc.min_length, {"store": true});
+ index("double", "min_length", doc.min_length, {"store": true});
}
We correct the previous mistake so documents without min_length are
@@ -203,7 +203,7 @@ exist) but we've acccidentally prevented the indexing of the
.. code-block:: javascript
if (typeof(doc.min_length == 'number')) {
- index("min_length", doc.min_length, {"store": true});
+ index("double", "min_length", doc.min_length, {"store": true});
}
This good example ensures we index any document where ``min_length`` is a number.
@@ -375,14 +375,14 @@ Specify your search by using the ``q`` parameter.
.. code-block:: http
- GET /$DATABASE/_partition/$PARTITION_KEY/_design/$DDOC/_nouveau/$INDEX_NAME?include_docs=true&query="*:*"&limit=1 HTTP/1.1
+ GET /$DATABASE/_partition/$PARTITION_KEY/_design/$DDOC/_nouveau/$INDEX_NAME?include_docs=true&q=*:*&limit=1 HTTP/1.1
Content-Type: application/json
*Example of using HTTP to query a global index:*
.. code-block:: http
- GET /$DATABASE/_design/$DDOC/_nouveau/$INDEX_NAME?include_docs=true&query="*:*"&limit=1 HTTP/1.1
+ GET /$DATABASE/_design/$DDOC/_nouveau/$INDEX_NAME?include_docs=true&q=*:*&limit=1 HTTP/1.1
Content-Type: application/json
*Example of using the command line to query a partitioned index:*
@@ -390,14 +390,14 @@ Specify your search by using the ``q`` parameter.
.. code-block:: sh
curl https://$HOST:5984/$DATABASE/_partition/$PARTITION_KEY/_design/$DDOC/
- _nouveau/$INDEX_NAME?include_docs=true\&query="*:*"\&limit=1 \
+ _nouveau/$INDEX_NAME?include_docs=true\&q=*:*\&limit=1 \
*Example of using the command line to query a global index:*
.. code-block:: sh
curl https://$HOST:5984/$DATABASE/_design/$DDOC/_nouveau/$INDEX_NAME?
- include_docs=true\&query="*:*"\&limit=1 \
+ include_docs=true\&q=*:*\&limit=1 \
.. _ddoc/nouveau/query_parameters: