File tree Expand file tree Collapse file tree 15 files changed +42
-22
lines changed
src/Elasticsearch/Endpoints Expand file tree Collapse file tree 15 files changed +42
-22
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ public function getParamWhitelist()
7878 '_source_includes ' ,
7979 '_source_exclude ' ,
8080 '_source_excludes ' ,
81- 'pipeline '
81+ 'pipeline ' ,
82+ 'seq_no_primary_term '
8283 );
8384 }
8485
Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ public function getParamWhitelist()
6464 'timeout ' ,
6565 'version ' ,
6666 'version_type ' ,
67+ 'include_type_name ' ,
68+ 'if_primary_term ' ,
69+ 'if_seq_no '
6770 );
6871 }
6972
Original file line number Diff line number Diff line change @@ -99,7 +99,8 @@ public function getParamWhitelist()
9999 '_source_excludes ' ,
100100 'version ' ,
101101 'version_type ' ,
102- 'stored_fields '
102+ 'stored_fields ' ,
103+ 'include_type_name '
103104 );
104105 }
105106
Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ public function getParamWhitelist()
9696 'version_type ' ,
9797 'pipeline ' ,
9898 'if_primary_term ' ,
99- 'if_seq_no '
99+ 'if_seq_no ' ,
100+ 'include_type_name '
100101 );
101102 }
102103
Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ public function getParamWhitelist()
6565 'timeout ' ,
6666 'master_timeout ' ,
6767 'update_all_types ' ,
68- 'wait_for_active_shards '
68+ 'wait_for_active_shards ' ,
69+ 'include_type_name '
6970 );
7071 }
7172
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public function getParamWhitelist()
8080 'ignore_unavailable ' ,
8181 'allow_no_indices ' ,
8282 'expand_wildcards ' ,
83- 'local ' ,
83+ 'local '
8484 );
8585 }
8686
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ public function getParamWhitelist()
6767 'ignore_unavailable ' ,
6868 'allow_no_indices ' ,
6969 'expand_wildcards ' ,
70- 'human '
70+ 'human ' ,
71+ 'include_type_name '
7172 );
7273 }
7374
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ public function getParamWhitelist()
4848 'expand_wildcards ' ,
4949 'wildcard_expansion ' ,
5050 'local ' ,
51+ 'include_type_name '
5152 );
5253 }
5354
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ public function getParamWhitelist()
6767 'ignore_unavailable ' ,
6868 'allow_no_indices ' ,
6969 'expand_wildcards ' ,
70- 'local '
70+ 'local ' ,
71+ 'include_type_name '
7172 );
7273 }
7374
Original file line number Diff line number Diff line change @@ -41,19 +41,21 @@ public function setBody($body)
4141 */
4242 public function getURI ()
4343 {
44- if (isset ($ this ->type ) !== true ) {
44+ $ index = $ this ->index ?? null ;
45+ $ type = $ this ->type ?? null ;
46+
47+ if (null === $ index && $ type === $ index ) {
4548 throw new Exceptions \RuntimeException (
46- 'type is required for Put '
49+ 'type or index are required for Put '
4750 );
4851 }
49- $ index = $ this ->index ;
50- $ type = $ this ->type ;
51- $ uri = "/_mapping/ $ type " ;
52-
53- if (isset ($ index ) === true && isset ($ type ) === true ) {
54- $ uri = "/ $ index/ $ type/_mapping " ;
55- } elseif (isset ($ type ) === true ) {
56- $ uri = "/_mapping/ $ type " ;
52+ $ uri = '' ;
53+ if (null !== $ index ) {
54+ $ uri = "/ $ index " ;
55+ }
56+ $ uri .= '/_mapping ' ;
57+ if (null !== $ type ) {
58+ $ uri .= "/ $ type " ;
5759 }
5860
5961 return $ uri ;
@@ -71,7 +73,8 @@ public function getParamWhitelist()
7173 'ignore_unavailable ' ,
7274 'allow_no_indices ' ,
7375 'expand_wildcards ' ,
74- 'update_all_types '
76+ 'update_all_types ' ,
77+ 'include_type_name '
7578 );
7679 }
7780
You can’t perform that action at this time.
0 commit comments