Skip to content

Commit d771be7

Browse files
committed
Fix for ES 6.7
1 parent 5dccf63 commit d771be7

File tree

15 files changed

+42
-22
lines changed

15 files changed

+42
-22
lines changed

src/Elasticsearch/Endpoints/Bulk.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/Elasticsearch/Endpoints/Delete.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

src/Elasticsearch/Endpoints/Get.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/Elasticsearch/Endpoints/Index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/Elasticsearch/Endpoints/Indices/Create.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/Elasticsearch/Endpoints/Indices/Field/Get.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

src/Elasticsearch/Endpoints/Indices/Get.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/Elasticsearch/Endpoints/Indices/Mapping/Get.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function getParamWhitelist()
4848
'expand_wildcards',
4949
'wildcard_expansion',
5050
'local',
51+
'include_type_name'
5152
);
5253
}
5354

src/Elasticsearch/Endpoints/Indices/Mapping/GetField.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/Elasticsearch/Endpoints/Indices/Mapping/Put.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff 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

src/Elasticsearch/Endpoints/Indices/Rollover.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function getParamWhitelist()
9898
'timeout',
9999
'master_timeout',
100100
'wait_for_active_shards',
101+
'include_type_name'
101102
);
102103
}
103104

src/Elasticsearch/Endpoints/Indices/Template/Get.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public function getParamWhitelist()
6565
return array(
6666
'flat_settings',
6767
'local',
68-
'master_timeout'
68+
'master_timeout',
69+
'include_type_name'
6970
);
7071
}
7172

src/Elasticsearch/Endpoints/Indices/Template/Put.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public function getParamWhitelist()
8989
'timeout',
9090
'master_timeout',
9191
'flat_settings',
92-
'create'
92+
'create',
93+
'include_type_name'
9394
);
9495
}
9596

src/Elasticsearch/Endpoints/Search.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ public function getParamWhitelist()
104104
'batched_reduce_size',
105105
'typed_keys',
106106
'pre_filter_shard_size',
107-
'rest_total_hits_as_int'
107+
'rest_total_hits_as_int',
108+
'seq_no_primary_term'
108109
);
109110
}
110111

src/Elasticsearch/Endpoints/Update.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ public function getParamWhitelist()
8787
'ttl',
8888
'version',
8989
'version_type',
90-
'_source'
90+
'_source',
91+
'include_type_name',
92+
'if_primary_term',
93+
'if_seq_no'
9194
);
9295
}
9396

0 commit comments

Comments
 (0)