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: try:
os_client.indices.get_index_template("services") os_client.indices.delete_index_template("services")
except NotFoundError: except NotFoundError:
os_client.indices.put_index_template( pass
name="services",
body={
"index_patterns": ["services_*"],
"template": {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0,
"refresh_interval": -1, os_client.indices.put_index_template(
"translog.flush_threshold_size": "2048MB", name="services",
"codec": "zstd_no_dict", body={
"replication.type": "SEGMENT" "index_patterns": ["services_*"],
} "template": {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0,
}, "refresh_interval": -1,
"mappings": { "translog.flush_threshold_size": "2048MB",
"dynamic": "strict", "codec": "zstd_no_dict",
"properties": { "replication.type": "SEGMENT"
"accessRestriction": { }
"type": "keyword"
}, },
"accessTypes": { "mappings": {
"type": "keyword" "dynamic": "strict",
}, "properties": {
"access_modes": { "accessRestriction": {
"type": "keyword" "type": "keyword"
}, },
"category": { "accessTypes": {
"type": "object", "type": "keyword"
"properties": { },
"category": { "access_modes": {
"type": "keyword" "type": "keyword"
}, },
"subcategory": { "category": {
"type": "keyword" "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: try:
os_client.indices.delete_index_template("training") os_client.indices.delete_index_template("training")