Add version for 5.0.0

This commit adds the version constant for 5.0.0.

Relates #21244
This commit is contained in:
Jason Tedor 2016-11-01 13:51:53 -04:00
parent a612e5988e
commit 7751049c14
13 changed files with 94 additions and 26 deletions

View file

@ -265,12 +265,20 @@ def generate_index(client, version, index_name):
mappings['doc'] = {'properties' : {}}
supports_dots_in_field_names = parse_version(version) >= parse_version("2.4.0")
if supports_dots_in_field_names:
mappings["doc"]['properties'].update({
if parse_version(version) < parse_version("5.0.0-alpha1"):
mappings["doc"]['properties'].update({
'field.with.dots': {
'type': 'string',
'boost': 4
}
})
else:
mappings["doc"]['properties'].update({
'field.with.dots': {
'type': 'text'
}
})
if parse_version(version) < parse_version("5.0.0-alpha1"):
mappings['norms'] = {
@ -339,7 +347,10 @@ def generate_index(client, version, index_name):
if warmers:
body['warmers'] = warmers
client.indices.create(index=index_name, body=body)
health = client.cluster.health(wait_for_status='green', wait_for_relocating_shards=0)
if parse_version(version) < parse_version("5.0.0-alpha1"):
health = client.cluster.health(wait_for_status='green', wait_for_relocating_shards=0)
else:
health = client.cluster.health(wait_for_status='green', wait_for_no_relocating_shards=True)
assert health['timed_out'] == False, 'cluster health timed out %s' % health
num_docs = random.randint(2000, 3000)