From b6f6209b44e9d9d0ac7303d37da11c7d044f56f8 Mon Sep 17 00:00:00 2001 From: tischrei Date: Tue, 13 Jun 2023 09:19:29 +0000 Subject: [PATCH] Update 'Import minimal document and service overview into OpenSearch for filter functionality in HC 3.0' --- ...arch-for-filter-functionality-in-HC-3.0.md | 62 +++++++++++++++++++ Update-Search-Index.md | 7 --- 2 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 Import-minimal-document-and-service-overview-into-OpenSearch-for-filter-functionality-in-HC-3.0.md delete mode 100644 Update-Search-Index.md diff --git a/Import-minimal-document-and-service-overview-into-OpenSearch-for-filter-functionality-in-HC-3.0.md b/Import-minimal-document-and-service-overview-into-OpenSearch-for-filter-functionality-in-HC-3.0.md new file mode 100644 index 0000000..0fba773 --- /dev/null +++ b/Import-minimal-document-and-service-overview-into-OpenSearch-for-filter-functionality-in-HC-3.0.md @@ -0,0 +1,62 @@ +The following tool is used to create an index in OpenSearch with the content of the following data: + +``` + +{ + "services": [{ + "service_title": "Anti DDoS", + "service_type": "antiddos", + "docs": [{ + "title": "API Reference", + "type": "api-ref" + }, { + "title": "User Guide", + "type": "umn" + } + ] + }, { + "service_title": "Application Operations Management", + "service_type": "aom", + "docs": [{ + "title": "API Reference", + "type": "api-ref" + }, { + "title": "User Guide", + "type": "umn" + } + ] + } + .... + ], + "doc_types": [ + "api-ref", + "umn", + "dev", + "image-creation-guide", + "tool-guide", + "mycredential", + "public-images", + "sdk-ref", + "operation-guide", + "operation-guide-lts", + "parallel-file-system", + "permissions-configuration-guide", + "swiftapi", + "s3api", + ... + ] +} +``` + +The data is then used to dynamically build the filter options for the search part of the Helpcenter website. + + +The tool which is used has the name `index_metadata` and can be found in the the tools folder. + +The tool needs several env-args to run properly which can be seen with the following sample code. + +Set the correct authentication variables. + +``` +python tools/index_metadata.py --hosts opensearch.eco.tsi-dev.otc-service.com:443 --target-environment public --index search_index_de --username --password --delete-index +``` \ No newline at end of file diff --git a/Update-Search-Index.md b/Update-Search-Index.md deleted file mode 100644 index 4cc7291..0000000 --- a/Update-Search-Index.md +++ /dev/null @@ -1,7 +0,0 @@ -To update the search index use the tool `index_metadata`. - -Set the correct authentication variables. - -``` -python tools/index_metadata.py --hosts opensearch.eco.tsi-dev.otc-service.com:443 --target-environment public --index search_index_de --username --password --delete-index -``` \ No newline at end of file