Skip to content

Commit bf45ca9

Browse files
committed
Add new section on SODA text searches
1 parent 5a83cd1 commit bf45ca9

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

doc/api.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,9 @@ limitations under the License.
439439
- 29.2 [Creating SODA Collections](#creatingsodacollections)
440440
- 29.3 [Creating and Accessing SODA documents](#accessingsodadocuments)
441441
- 29.4 [SODA Query-by-Example Searches for JSON Documents](#sodaqbesearches)
442-
- 29.5 [SODA Client-Assigned Keys and Collection Metadata](#sodaclientkeys)
443-
- 29.6 [JSON Data Guides in SODA](#sodajsondataguide)
442+
- 29.5 [SODA Text Searches](#sodatextsearches)
443+
- 29.6 [SODA Client-Assigned Keys and Collection Metadata](#sodaclientkeys)
444+
- 29.7 [JSON Data Guides in SODA](#sodajsondataguide)
444445
30. [Tracing SQL and PL/SQL Statements](#tracingsql)
445446
31. [Node.js Programming Styles and node-oracledb](#programstyles)
446447
- 31.1 [Callbacks and node-oracledb](#callbackoverview)
@@ -12945,7 +12946,31 @@ Some QBE examples are:
1294512946
1294612947
See [Overview of QBE Spatial Operators][111].
1294712948
12948-
### <a name="sodaclientkeys"></a> 29.5 SODA Client-Assigned Keys and Collection Metadata
12949+
### <a name="sodatextsearches"></a> 29.5 SODA Text Searches
12950+
12951+
To perform text searches through documents, a [JSON search index][149]
12952+
must be defined. For example::
12953+
12954+
```javascript
12955+
await collection.createIndex({ name : "mySearchIdx");
12956+
```
12957+
12958+
See [SODA Index Specifications (Reference)][119] for information on
12959+
SODA indexing.
12960+
12961+
Documents in the indexed collection can be searched by running a
12962+
filter (QBE) using the [`$contains`][148] operator:
12963+
12964+
```javascript
12965+
let documents = await collection.find().filter({item : { $contains : "books"}}).getDocuments();
12966+
```
12967+
12968+
This example will find all documents that have an `item` field
12969+
containing the string "books" (case-insensitive). For example, a
12970+
document that contained `{item : "Books by Brothers Grimm"}` would be
12971+
returned.
12972+
12973+
### <a name="sodaclientkeys"></a> 29.6 SODA Client-Assigned Keys and Collection Metadata
1294912974
1295012975
Default collections support JSON documents and use system generated
1295112976
document keys. Various storage options are also configured which
@@ -13072,7 +13097,7 @@ try {
1307213097
}
1307313098
```
1307413099
13075-
### <a name="sodajsondataguide"></a> 29.6 JSON Data Guides in SODA
13100+
### <a name="sodajsondataguide"></a> 29.7 JSON Data Guides in SODA
1307613101
1307713102
SODA exposes Oracle Database's [JSON data guide][116] feature. This
1307813103
lets you discover information about the structure and content of JSON
@@ -13680,3 +13705,5 @@ All exceptions are now passed through the error callback.
1368013705
[145]: https://github.com/oracle/node-oracledb/tree/master/examples/aqmulti.js
1368113706
[146]: https://github.com/oracle/node-oracledb/tree/master/examples/selectvarray.js
1368213707
[147]: https://github.com/oracle/node-oracledb/tree/master/examples/plsqlrecord.js
13708+
[148]: https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-C4C426FC-FD23-4B2E-8367-FA5F83F3F23A
13709+
[149]: https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-4848E6A0-58A7-44FD-8D6D-A033D0CCF9CB

0 commit comments

Comments
 (0)