initial stage

This commit is contained in:
Giambattista Bloisi 2024-07-27 14:46:40 +02:00
parent 10c27e578d
commit 88076612b7
1 changed files with 162 additions and 165 deletions

View File

@ -1172,179 +1172,176 @@ def init_opensearch(os_client: OpenSearch):
})
try:
os_client.indices.get_index_template("services")
os_client.indices.delete_index_template("services")
except NotFoundError:
os_client.indices.put_index_template(
name="services",
body={
"index_patterns": ["services_*"],
"template": {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0,
pass
"refresh_interval": -1,
"translog.flush_threshold_size": "2048MB",
"codec": "zstd_no_dict",
"replication.type": "SEGMENT"
}
os_client.indices.put_index_template(
name="services",
body={
"index_patterns": ["services_*"],
"template": {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0,
},
"mappings": {
"dynamic": "strict",
"properties": {
"accessRestriction": {
"type": "keyword"
},
"accessTypes": {
"type": "keyword"
},
"access_modes": {
"type": "keyword"
},
"category": {
"type": "object",
"properties": {
"category": {
"type": "keyword"
},
"subcategory": {
"type": "keyword"
}
"refresh_interval": -1,
"translog.flush_threshold_size": "2048MB",
"codec": "zstd_no_dict",
"replication.type": "SEGMENT"
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"accessRestriction": {
"type": "keyword"
},
"accessTypes": {
"type": "keyword"
},
"access_modes": {
"type": "keyword"
},
"category": {
"type": "object",
"properties": {
"category": {
"type": "keyword"
},
"subcategory": {
"type": "keyword"
}
},
"description": {
"type": "text"
},
"domain": {
"type": "object",
"properties": {
"domain": {
"type": "keyword"
},
"subdomain": {
"type": "keyword"
}
}
},
"grantProjectNames": {
"type": "text"
},
"helpdeskPage": {
"type": "text"
},
"horizontal": {
"type": "boolean"
},
"id": {
"type": "keyword"
},
"interoperabilityGuidelines": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"language": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"orderType": {
"type": "keyword"
},
"organization": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"pricing": {
"type": "text"
},
"privacyPolicy": {
"type": "text"
},
"providers": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"relatedPlatforms": {
"type": "keyword"
},
"relatedResources": {
"type": "keyword"
},
"tags": {
"type": "keyword"
},
"keyword": {
"path": "tags",
"type": "alias"
},
"targetUsers": {
"type": "keyword"
},
"termsOfUse": {
"type": "text"
},
"thematic": {
"type": "boolean"
},
"trl": {
"type": "keyword"
},
"type": {
"type": "keyword"
},
"useCases": {
"type": "object",
"properties": {
"useCase": {
"type": "object",
"properties": {
"useCaseName": {
"type": "keyword"
},
"useCaseURL": {
"type": "text"
}
}
}
}
},
"userManual": {
"type": "text"
},
"webpage": {
"type": "text"
},
"year": {
"type": "long"
}
},
"description": {
"type": "text"
},
"domain": {
"type": "object",
"properties": {
"domain": {
"type": "keyword"
},
"subdomain": {
"type": "keyword"
}
}
},
"grantProjectNames": {
"type": "text"
},
"helpdeskPage": {
"type": "text"
},
"horizontal": {
"type": "boolean"
},
"id": {
"type": "keyword"
},
"interoperabilityGuidelines": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"language": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"orderType": {
"type": "keyword"
},
"organization": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"pricing": {
"type": "text"
},
"privacyPolicy": {
"type": "text"
},
"providers": {
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"type": "text"
},
"relatedPlatforms": {
"type": "keyword"
},
"relatedResources": {
"type": "keyword"
},
"tags": {
"type": "keyword"
},
"keyword": {
"path": "tags",
"type": "alias"
},
"targetUsers": {
"type": "keyword"
},
"termsOfUse": {
"type": "text"
},
"thematic": {
"type": "boolean"
},
"trl": {
"type": "keyword"
},
"type": {
"type": "keyword"
},
"useCases": {
"type": "object",
"properties": {
"useCaseName": {
"type": "keyword"
},
"useCaseURL": {
"type": "text"
}
}
},
"userManual": {
"type": "text"
},
"webpage": {
"type": "text"
},
"year": {
"type": "long"
}
}
}
})
}
})
try:
os_client.indices.delete_index_template("training")