summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2023-04-10 18:58:39 +0100
committerRobert Newson <rnewson@apache.org>2023-04-22 11:20:02 +0100
commitb51fddb5ce42925abfa762b70823bd7737bb7364 (patch)
tree58fbb1d76af7e3f908ef97ab68a4710e4b67deda
parent0d7e1af1bd8decfdef0ee2fa5a1ce653f030dff6 (diff)
downloadcouchdb-b51fddb5ce42925abfa762b70823bd7737bb7364.tar.gz
restore 'store' as index option
-rw-r--r--nouveau/README.md6
-rw-r--r--nouveau/src/main/java/org/apache/couchdb/nouveau/api/DoubleField.java12
-rw-r--r--nouveau/src/main/java/org/apache/couchdb/nouveau/api/StringField.java12
-rw-r--r--nouveau/src/main/java/org/apache/couchdb/nouveau/api/TextField.java12
-rw-r--r--nouveau/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Index.java6
-rw-r--r--share/server/nouveau.js4
-rw-r--r--src/docs/src/ddocs/nouveau.rst24
7 files changed, 38 insertions, 38 deletions
diff --git a/nouveau/README.md b/nouveau/README.md
index 0c89e4521..e0c963660 100644
--- a/nouveau/README.md
+++ b/nouveau/README.md
@@ -102,9 +102,9 @@ curl 'foo:bar@localhost:15984/foo/_design/foo/_nouveau/bar?q=*:*&limit=1&ranges=
| Arguments | Effect
| :-------------------------------------------------------------- | :-----
-| index("text", "foo", "bar", {"stored": true}); | analyzes value for full-text searching, optionally stores the value
-| index("string", "foo", "bar", {"stored": true, "facet": true}); | indexes value as single token, optionally stores value and/or adds facet
-| index("double", "foo", 12.0, {"stored": true, "facet": true}); | indexes value, optionally stores value and/or adds facet
+| index("text", "foo", "bar", {"store": true}); | analyzes value for full-text searching, optionally stores the value
+| index("string", "foo", "bar", {"store": true, "facet": true}); | indexes value as single token, optionally stores value and/or adds facet
+| index("double", "foo", 12.0, {"store": true, "facet": true}); | indexes value, optionally stores value and/or adds facet
| index("stored", "foo", "bar"); | stores a number, returned with hits
| index("stored", "foo", 12.0); | stores a string, returned with hits
diff --git a/nouveau/src/main/java/org/apache/couchdb/nouveau/api/DoubleField.java b/nouveau/src/main/java/org/apache/couchdb/nouveau/api/DoubleField.java
index ec4ca0a0f..a846506c8 100644
--- a/nouveau/src/main/java/org/apache/couchdb/nouveau/api/DoubleField.java
+++ b/nouveau/src/main/java/org/apache/couchdb/nouveau/api/DoubleField.java
@@ -24,15 +24,15 @@ public class DoubleField extends Field {
@NotNull
private final Double value;
- private final boolean stored;
+ private final boolean store;
private final boolean facet;
public DoubleField(@JsonProperty("name") final String name, @JsonProperty("value") final Double value,
- @JsonProperty("stored") final boolean stored, @JsonProperty("facet") final boolean facet) {
+ @JsonProperty("store") final boolean store, @JsonProperty("facet") final boolean facet) {
super(name);
this.value = value;
- this.stored = stored;
+ this.store = store;
this.facet = facet;
}
@@ -42,8 +42,8 @@ public class DoubleField extends Field {
}
@JsonProperty
- public boolean isStored() {
- return stored;
+ public boolean isStore() {
+ return store;
}
@JsonProperty
@@ -53,7 +53,7 @@ public class DoubleField extends Field {
@Override
public String toString() {
- return "DoubleField [name=" + name + ", value=" + value + ", stored=" + stored + ", facet=" + facet + "]";
+ return "DoubleField [name=" + name + ", value=" + value + ", store=" + store + ", facet=" + facet + "]";
}
} \ No newline at end of file
diff --git a/nouveau/src/main/java/org/apache/couchdb/nouveau/api/StringField.java b/nouveau/src/main/java/org/apache/couchdb/nouveau/api/StringField.java
index 5849591bb..fb3975e07 100644
--- a/nouveau/src/main/java/org/apache/couchdb/nouveau/api/StringField.java
+++ b/nouveau/src/main/java/org/apache/couchdb/nouveau/api/StringField.java
@@ -26,15 +26,15 @@ public final class StringField extends Field {
@NotNull
private final String value;
- private final boolean stored;
+ private final boolean store;
private final boolean facet;
public StringField(@JsonProperty("name") final String name, @JsonProperty("value") final String value,
- @JsonProperty("stored") final boolean stored, @JsonProperty("facet") final boolean facet) {
+ @JsonProperty("store") final boolean store, @JsonProperty("facet") final boolean facet) {
super(name);
this.value = Objects.requireNonNull(value);
- this.stored = stored;
+ this.store = store;
this.facet = facet;
}
@@ -44,8 +44,8 @@ public final class StringField extends Field {
}
@JsonProperty
- public boolean isStored() {
- return stored;
+ public boolean isStore() {
+ return store;
}
@JsonProperty
@@ -55,7 +55,7 @@ public final class StringField extends Field {
@Override
public String toString() {
- return "StringField [name=" + name + ", value=" + value + ", stored=" + stored + ", facet=" + facet + "]";
+ return "StringField [name=" + name + ", value=" + value + ", store=" + store + ", facet=" + facet + "]";
}
} \ No newline at end of file
diff --git a/nouveau/src/main/java/org/apache/couchdb/nouveau/api/TextField.java b/nouveau/src/main/java/org/apache/couchdb/nouveau/api/TextField.java
index 914bf168d..3b3ec2163 100644
--- a/nouveau/src/main/java/org/apache/couchdb/nouveau/api/TextField.java
+++ b/nouveau/src/main/java/org/apache/couchdb/nouveau/api/TextField.java
@@ -26,13 +26,13 @@ public final class TextField extends Field {
@NotNull
private final String value;
- private final boolean stored;
+ private final boolean store;
public TextField(@JsonProperty("name") final String name, @JsonProperty("value") final String value,
- @JsonProperty("stored") final boolean stored) {
+ @JsonProperty("store") final boolean store) {
super(name);
this.value = Objects.requireNonNull(value);
- this.stored = stored;
+ this.store = store;
}
@JsonProperty
@@ -41,13 +41,13 @@ public final class TextField extends Field {
}
@JsonProperty
- public boolean isStored() {
- return stored;
+ public boolean isStore() {
+ return store;
}
@Override
public String toString() {
- return "TextField [name=" + name + ", value=" + value + ", stored=" + stored + "]";
+ return "TextField [name=" + name + ", value=" + value + ", store=" + store + "]";
}
} \ No newline at end of file
diff --git a/nouveau/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Index.java b/nouveau/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Index.java
index 7a5667d89..64b55aa5c 100644
--- a/nouveau/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Index.java
+++ b/nouveau/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Index.java
@@ -361,17 +361,17 @@ public class Lucene9Index extends Index {
}
if (field instanceof TextField) {
var f = (TextField) field;
- result.add(new org.apache.lucene.document.TextField(f.getName(), f.getValue(), f.isStored() ? Store.YES : Store.NO));
+ result.add(new org.apache.lucene.document.TextField(f.getName(), f.getValue(), f.isStore() ? Store.YES : Store.NO));
} else if (field instanceof StringField) {
var f = (StringField) field;
- result.add(new org.apache.lucene.document.StringField(f.getName(), f.getValue(), f.isStored() ? Store.YES : Store.NO));
+ result.add(new org.apache.lucene.document.StringField(f.getName(), f.getValue(), f.isStore() ? Store.YES : Store.NO));
if (f.isFacet()) {
result.add(new org.apache.lucene.document.SortedDocValuesField(f.getName(), new BytesRef(f.getValue())));
}
} else if (field instanceof DoubleField) {
var f = (DoubleField) field;
result.add(new org.apache.lucene.document.DoublePoint(f.getName(), f.getValue()));
- if (f.isStored()) {
+ if (f.isStore()) {
result.add(new org.apache.lucene.document.StoredField(f.getName(), f.getValue()));
}
if (f.isFacet()) {
diff --git a/share/server/nouveau.js b/share/server/nouveau.js
index bf092da12..8c75d4a25 100644
--- a/share/server/nouveau.js
+++ b/share/server/nouveau.js
@@ -57,7 +57,7 @@ var Nouveau = (function () {
'@type': type,
'name': name,
'value': value,
- 'stored': options.stored,
+ 'store': options.store,
'facet': options.facet
});
break;
@@ -69,7 +69,7 @@ var Nouveau = (function () {
'@type': type,
'name': name,
'value': value,
- 'stored': options.stored
+ 'store': options.store
});
break;
case 'stored':
diff --git a/src/docs/src/ddocs/nouveau.rst b/src/docs/src/ddocs/nouveau.rst
index bd1c3fbba..7ea20e78d 100644
--- a/src/docs/src/ddocs/nouveau.rst
+++ b/src/docs/src/ddocs/nouveau.rst
@@ -40,7 +40,7 @@ a document update. The ``index`` function takes the following parameters:
specified in the query syntax.
#. Data that you want to index, for example, ``doc.address.country``.
#. (Optional) The third parameter includes the following fields: ``facet``,
- and ``stored``. These fields are described in more detail later.
+ and ``store``. These fields are described in more detail later.
By default, a nouveau index response returns 25 rows. The number of hits that are returned
can be changed by using the ``limit`` parameter. Each response includes a ``bookmark``
@@ -122,12 +122,12 @@ The ``index`` function takes four parameters, where the third parameter is optio
* **facet** - Creates a faceted index. See :ref:`Faceting <ddoc/search/faceting>`.
Values are ``true`` or ``false``. Default is ``false``.
- * **stored** - If ``true``, the value is returned in the search result; otherwise,
+ * **store** - If ``true``, the value is returned in the search result; otherwise,
the value is not returned. Values are ``true`` or ``false``. Default is ``false``.
.. note::
- If you do not set the ``stored`` parameter,
+ If you do not set the ``store`` parameter,
the index data results for the document are not returned in response to a query.
*Example search index function:*
@@ -136,16 +136,16 @@ The ``index`` function takes four parameters, where the third parameter is optio
function(doc) {
if (typeof(doc.min_length) == 'number') {
- index("double", "min_length", doc.min_length, {"stored": true});
+ index("double", "min_length", doc.min_length, {"store": true});
}
if (typeof(doc.diet) == 'string') {
- index("string", "diet", doc.diet, {"stored": true});
+ index("string", "diet", doc.diet, {"store": true});
}
if (typeof(doc.latin_name) == 'string') {
- index("string", "latin_name", doc.latin_name, {"stored": true});
+ index("string", "latin_name", doc.latin_name, {"store": true});
}
if (typeof(doc.class) == 'string') {
- index("string", "class", doc.class, {"stored": true});
+ index("string", "class", doc.class, {"store": true});
}
}
@@ -162,7 +162,7 @@ most common runtime errors are described below;
.. warning:: example of bad code
.. code-block:: javascript
- index("min_length", doc.min_length, {"stored": true});
+ index("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
@@ -174,7 +174,7 @@ validation function and the document will not be indexed.
.. code-block:: javascript
if (doc.foo.bar) {
- index("bar", doc.foo.bar, {"stored": true});
+ index("bar", doc.foo.bar, {"store": true});
}
This bad example fails in a different way if ``doc.foo`` doesn't
@@ -183,7 +183,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, {"stored": true});
+ index("bar", doc.foo.bar, {"store": true});
}
This example correctly checks that ``doc.foo`` is an object and its
@@ -195,7 +195,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, {"stored": true});
+ index("min_length", doc.min_length, {"store": true});
}
We correct the previous mistake so documents without min_length are
@@ -206,7 +206,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, {"stored": true});
+ index("min_length", doc.min_length, {"store": true});
}
This good example ensures we index any document where ``min_length`` is a number.