Skip to content

Commit c53c798

Browse files
authored
feat: add support for querystring in options object (#779)
In very few cases, some API uses the same key for both url and query params, such as the bulk method. The client is not designed to handle such cases since accepts both url and query keys in the same object, and the url parameter will always take precedence. This pr fixes this edge case by adding a `querystring` key in the options object. Fixes: #778 ```js client.bulk({ index: 'index', type: '_doc', body: [...] }, { querystring: { type: '_doc' } }, console.log) ```
1 parent 851e839 commit c53c798

File tree

261 files changed

+380
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+380
-6
lines changed

README.md

Lines changed: 3 additions & 1 deletion

api/api/bulk.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ function buildBulk (opts) {
149149
maxRetries: options.maxRetries || null,
150150
asStream: options.asStream || false,
151151
headers: options.headers || null,
152+
querystring: options.querystring || null,
152153
compression: options.compression || false,
153154
warnings
154155
}

api/api/cat.aliases.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ function buildCatAliases (opts) {
131131
maxRetries: options.maxRetries || null,
132132
asStream: options.asStream || false,
133133
headers: options.headers || null,
134+
querystring: options.querystring || null,
134135
compression: options.compression || false,
135136
warnings
136137
}

api/api/cat.allocation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ function buildCatAllocation (opts) {
133133
maxRetries: options.maxRetries || null,
134134
asStream: options.asStream || false,
135135
headers: options.headers || null,
136+
querystring: options.querystring || null,
136137
compression: options.compression || false,
137138
warnings
138139
}

api/api/cat.count.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ function buildCatCount (opts) {
131131
maxRetries: options.maxRetries || null,
132132
asStream: options.asStream || false,
133133
headers: options.headers || null,
134+
querystring: options.querystring || null,
134135
compression: options.compression || false,
135136
warnings
136137
}

api/api/cat.fielddata.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ function buildCatFielddata (opts) {
135135
maxRetries: options.maxRetries || null,
136136
asStream: options.asStream || false,
137137
headers: options.headers || null,
138+
querystring: options.querystring || null,
138139
compression: options.compression || false,
139140
warnings
140141
}

api/api/cat.health.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ function buildCatHealth (opts) {
128128
maxRetries: options.maxRetries || null,
129129
asStream: options.asStream || false,
130130
headers: options.headers || null,
131+
querystring: options.querystring || null,
131132
compression: options.compression || false,
132133
warnings
133134
}

api/api/cat.help.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ function buildCatHelp (opts) {
115115
maxRetries: options.maxRetries || null,
116116
asStream: options.asStream || false,
117117
headers: options.headers || null,
118+
querystring: options.querystring || null,
118119
compression: options.compression || false,
119120
warnings
120121
}

api/api/cat.indices.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ function buildCatIndices (opts) {
137137
maxRetries: options.maxRetries || null,
138138
asStream: options.asStream || false,
139139
headers: options.headers || null,
140+
querystring: options.querystring || null,
140141
compression: options.compression || false,
141142
warnings
142143
}

api/api/cat.master.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ function buildCatMaster (opts) {
126126
maxRetries: options.maxRetries || null,
127127
asStream: options.asStream || false,
128128
headers: options.headers || null,
129+
querystring: options.querystring || null,
129130
compression: options.compression || false,
130131
warnings
131132
}

0 commit comments

Comments
 (0)