|
161 | 161 | <select id="node-input-search">
|
162 | 162 | <option value="_id_">_id</option>
|
163 | 163 | <option value="_idx_">search index</option>
|
| 164 | + <option value="_all_">all documents</option> |
164 | 165 | </select>
|
165 | 166 | </div>
|
166 | 167 |
|
|
318 | 319 | A node for searching documents in a Cloudant database.
|
319 | 320 | </p>
|
320 | 321 | <p>
|
321 |
| - Searching for a document can be done in two modes: directly by using the |
322 |
| - document's <b>_id</b> or by using an existing <a |
| 322 | + Searching for documents can be done in three modes: directly by using the |
| 323 | + document's <b>_id</b>, by using an existing <a |
323 | 324 | href="https://cloudant.com/for-developers/search/" target="_blank">Search
|
324 |
| - Index</a>. |
| 325 | + Index</a> or retrieving <b>all documents</b> stored in your database. |
325 | 326 | </p>
|
326 | 327 | <p>
|
327 |
| - When querying using the <b>_id</b> option, the value for <code>_id</code> |
328 |
| - should be passed in the <code>msg.payload</code> as a string. |
| 328 | + When querying using the <b>_id</b> option, the value for the document's |
| 329 | + <code>_id</code> should be passed in the <code>msg.payload</code> as a |
| 330 | + string. |
329 | 331 | </p>
|
330 | 332 | <p>
|
331 |
| - To use an existing <b>Search Index</b> stored on the desired database, the |
332 |
| - query argument should be passed on the <code>msg.payload</code> following |
333 |
| - the <code>indexName:value</code> pattern. <i>The index must be created |
334 |
| - beforehand on the database.</i> |
| 333 | + To use an existing <b>Search Index</b> stored on the desired database, |
| 334 | + the query argument should be passed on the <code>msg.payload</code> as a |
| 335 | + string following the <code>indexName:value</code> pattern. Keep in mind |
| 336 | + that <i>the index must be created beforehand in the database.</i> and |
| 337 | + referenced here by its <code>design document/index name</code>. |
| 338 | + </p> |
| 339 | + <p> |
| 340 | + When querying using a <b>Search Index</b> you can pass the search |
| 341 | + parameters as an object in <code>msg.payload</code>. For example, you |
| 342 | + can pass an object like this: <code>{ query: "abc*", limit: 100 }</code> |
| 343 | + to change the value of <code>limit</code>. You can find more information |
| 344 | + on the accepted parameters in the <a |
| 345 | + href="https://docs.cloudant.com/api.html?http#queries" target="_blank"> |
| 346 | + official Cloudant documentation</a>. |
| 347 | + </p> |
| 348 | + <p> |
| 349 | + The last method to retrieve documents is to simply get all of them by |
| 350 | + selecting the option <b>all documents</b>. |
335 | 351 | </p>
|
336 | 352 | </script>
|
0 commit comments