File tree Expand file tree Collapse file tree 2 files changed +43
-15
lines changed
test/spec/common/index/test-cases Expand file tree Collapse file tree 2 files changed +43
-15
lines changed Original file line number Diff line number Diff line change @@ -608,11 +608,20 @@ Index.prototype.clearIndex = function(callback) {
608
608
* error: null or Error('message')
609
609
* content: the settings object or the error message if a failure occured
610
610
*/
611
- Index . prototype . getSettings = function ( callback ) {
612
- var indexObj = this ;
611
+ Index . prototype . getSettings = function ( opts , callback ) {
612
+ if ( arguments . length === 1 || typeof opts === 'function' ) {
613
+ callback = opts ;
614
+ opts = { } ;
615
+ }
616
+
617
+ var indexName = encodeURIComponent ( this . indexName ) ;
613
618
return this . as . _jsonRequest ( {
614
619
method : 'GET' ,
615
- url : '/1/indexes/' + encodeURIComponent ( indexObj . indexName ) + '/settings?getVersion=2' ,
620
+ url :
621
+ '/1/indexes/' +
622
+ indexName +
623
+ '/settings?getVersion=2' +
624
+ ( opts . advanced ? '&advanced=' + opts . advanced : '' ) ,
616
625
hostType : 'read' ,
617
626
callback : callback
618
627
} ) ;
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- module . exports = {
4
- object : 'index' ,
5
- methodName : 'getSettings' ,
6
- testName : 'index.getSettings(cb)' ,
7
- action : 'read' ,
8
- expectedRequest : {
9
- method : 'GET' ,
10
- URL : {
11
- pathname : '/1/indexes/%s/settings' ,
12
- query : {
13
- getVersion : '2'
3
+ module . exports = [
4
+ {
5
+ object : 'index' ,
6
+ methodName : 'getSettings' ,
7
+ testName : 'index.getSettings(cb)' ,
8
+ action : 'read' ,
9
+ expectedRequest : {
10
+ method : 'GET' ,
11
+ URL : {
12
+ pathname : '/1/indexes/%s/settings' ,
13
+ query : {
14
+ getVersion : '2'
15
+ }
16
+ }
17
+ }
18
+ } ,
19
+ {
20
+ object : 'index' ,
21
+ methodName : 'getSettings' ,
22
+ testName : 'index.getSettings({ advanced: 1 }, cb)' ,
23
+ callArguments : [ { advanced : 1 } ] ,
24
+ action : 'read' ,
25
+ expectedRequest : {
26
+ method : 'GET' ,
27
+ URL : {
28
+ pathname : '/1/indexes/%s/settings' ,
29
+ query : {
30
+ getVersion : '2' ,
31
+ advanced : '1'
32
+ }
14
33
}
15
34
}
16
35
}
17
- } ;
36
+ ] ;
You can’t perform that action at this time.
0 commit comments