You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/07/18 09:28:23 UTC

[GitHub] garrensmith commented on a change in pull request #102: Promise support for Nano - Issue 98

garrensmith commented on a change in pull request #102: Promise support for Nano - Issue 98
URL: https://github.com/apache/couchdb-nano/pull/102#discussion_r203302709
 
 

 ##########
 File path: lib/nano.d.ts
 ##########
 @@ -946,6 +991,94 @@ declare namespace nano {
     update_seq?: number;
   }
 
+
+  interface DocumentSearchResponse<V> {
+
+    //  Array of search results
+    rows: Array<{
+      id: string;
+      order: number[];
+      fields: object;
+      key: string;
+      doc?: V;
+    }>;
+
+    // Number of documents in the search resykts
+    total_rows: number;
+
+    // token which if supplied to a subsequent search will return the next page of results.
+    bookmark: string;
+
+    // facet counts
+    counts?: object;
+
+    // facet range results
+    ranges?: object;
+
+    highlights?: object;
+
+  }
+
+  // https://console.bluemix.net/docs/services/Cloudant/api/search.html#queries
+  interface DocumentSearchParams {
+    // A bookmark that was received from a previous search. Used for pagination.
+    bookmark?: string;
+
+    // An array of field names for which facet counts are requested. 
+    counts?: string[];
+
+    // Filters the result set using key value pairs supplied to the drilldown parameter.
+    drilldown?: string[];
+
+    // The name of a string field to group results by.
+    group_field?: string;
+
+    // The maximum group count when used in conjunction with group_field.
+    group_limit?: number;
+
+    // Defines the order of the groups in a search when used with group_field. 
+    group_sort?: string | string[];
+
+    // Which fields are to be highlighted.
+    highlight_fields?: string[];
+
+    // String used before a highlighted word. Defaults to <em>.
+    highlight_pre_tag?: string;
+
+    // String used after a highlighted word. Defaults to </em>.
+    highlight_post_tag?: string;
+
+    // The number of gradments that are returned in highlights. Defaults to 1.
+    highlight_number?: number;
+    
+    // The number of characters in each fragment for highlight. Defaults to 100.
+    highlight_size?: number;
+
+    // Include the full document bodies in the response. Defaults to false
+    include_docs?: boolean;
+
+    // An array of fields to include in the search results.
+    include_fields?: string[];
+
+    // The maximum number of returned documents. Positive integer up to 200.
+    limit?: number;
+
+    // Alias of 'query'. One of q or query must be present.
+    q?: string;
+
+    // The Lucene query to perform. One of q or query must be present.
+    query?: string;
+
+    // Defines ranges for faceted numeric search fields.
+    ranges?: object;
+
+    // Specifies the sort order of the results. 
+    sort?: string | string[];
+
+    // Do not wait for the index to finish building to return results.
+    stale?: boolean
+  }
 
 Review comment:
   Wow nice work. The definitions are nice and clear now.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services