From c75a08a749718fc5ef25f8c2f826939be657c0bf Mon Sep 17 00:00:00 2001 From: Daniel Silverthorn Date: Thu, 4 May 2017 13:08:13 -0400 Subject: Initial search service commit Changing common logging dep Change-Id: I454697a9df0ee63f43d7b7d2a3818fe2d9b7bcf2 Signed-off-by: Daniel Silverthorn --- .../resources/json/schema/analyzer.schema.json | 29 +++++ .../json/schema/document-field.schema.json | 37 +++++++ .../resources/json/schema/document.schema.json | 15 +++ src/main/resources/json/schema/filter.schema.json | 17 +++ src/main/resources/logging/SearchDbMsgs.properties | 123 +++++++++++++++++++++ 5 files changed, 221 insertions(+) create mode 100644 src/main/resources/json/schema/analyzer.schema.json create mode 100644 src/main/resources/json/schema/document-field.schema.json create mode 100644 src/main/resources/json/schema/document.schema.json create mode 100644 src/main/resources/json/schema/filter.schema.json create mode 100644 src/main/resources/logging/SearchDbMsgs.properties (limited to 'src/main/resources') diff --git a/src/main/resources/json/schema/analyzer.schema.json b/src/main/resources/json/schema/analyzer.schema.json new file mode 100644 index 0000000..7592ee9 --- /dev/null +++ b/src/main/resources/json/schema/analyzer.schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Analyzer", + "description": "The analyzer aggregates a tokenizer and multiple filters to describe how an input stream should be indexed.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "behaviours": { + "type": "array", + "items": { + "type": "string" + } + }, + "tokenizer": { + "type": "string" + }, + "filters": { + "type": "array", + "items": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/json/schema/document-field.schema.json b/src/main/resources/json/schema/document-field.schema.json new file mode 100644 index 0000000..2b79256 --- /dev/null +++ b/src/main/resources/json/schema/document-field.schema.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Document Field Schema", + "description": "Describes the structure of a document field for storage in a document store.", + "type": "object", + "javaType": "org.openecomp.sa.rest.DocumentFieldSchema", + "properties": { + "name": { + "type": "string" + }, + "data-type": { + "type": "string" + }, + "format": { + "type": "string" + }, + "searchable": { + "type": "boolean" + }, + "search-analyzer": { + "type": "string" + }, + "index-analyzer": { + "type": "string" + }, + "sub-fields": { + "type": "array", + "items": { + "$ref": "document-field.schema.json" + } + } + }, + "required": [ + "name", + "data-type" + ] +} \ No newline at end of file diff --git a/src/main/resources/json/schema/document.schema.json b/src/main/resources/json/schema/document.schema.json new file mode 100644 index 0000000..e2dd204 --- /dev/null +++ b/src/main/resources/json/schema/document.schema.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Document Schema", + "description": "Describes the structure of a document for storage in a document store.", + "type": "object", + "javaType": "org.openecomp.sa.rest.DocumentSchema", + "properties": { + "fields": { + "type": "array", + "items": { + "$ref": "document-field.schema.json" + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/json/schema/filter.schema.json b/src/main/resources/json/schema/filter.schema.json new file mode 100644 index 0000000..6d1a030 --- /dev/null +++ b/src/main/resources/json/schema/filter.schema.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Filter", + "description": "Filters accept a stream of tokens from a tokenizer and apply additional rules, possibly producing additional tokens. ", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "configuration": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/src/main/resources/logging/SearchDbMsgs.properties b/src/main/resources/logging/SearchDbMsgs.properties new file mode 100644 index 0000000..3e8de80 --- /dev/null +++ b/src/main/resources/logging/SearchDbMsgs.properties @@ -0,0 +1,123 @@ +#Resource key=Error Code|Message text|Resolution text|Description text +####### +#Newlines can be utilized to add some clarity ensuring continuing line +#has at least one leading space +#ResourceKey=\ +# ERR0000E\ +# Sample error msg txt\ +# Sample resolution msg\ +# Sample description txt +# +###### +#Error code classification category +#000 Info/Debug +#100 Permission errors +#200 Availability errors/Timeouts +#300 Data errors +#400 Schema Interface type/validation errors +#500 Business process errors +#900 Unknown errors +# +######################################################################## +# INFO logs +SERVICE_STARTED=\ + SDB0001I|\ + SearchDB Service started|\ + NA|\ + The SearchDB Service has been started +ELASTIC_SEARCH_CONNECTION_SUCCESS=\ + SDB0002I|\ + Successfully established connection to ElasticSearch {0}|\ + NA|\ + Successfully established connection to ElasticSearch +ELASTIC_SEARCH_CONNECTION_ATTEMPT=\ + SDB0003I|\ + Attempting to connect to ElasticSearch {0}|\ + NA|\ + An attempt is being made to establish connectivity to ElasticSearch +CREATED_INDEX=\ + SDB0019I|\ + Index with name {0} created successfully +DELETED_INDEX=\ + SDB0021I|\ + Deleted index with name {0} +PROCESSED_BULK_OPERATIONS=\ + SDB0022I|\ + Successfully processed a bulk operations request. +PROCESS_EVENT=\ + SDB0041I|\ + Processed event {0}. Result: {1} +PROCESS_INLINE_QUERY=\ + SDB0042I|\ + Processing inline query: {0} +PROCESS_PAYLOAD_QUERY=\ + SDB0043I|\ + Processing query - operation: {0} against URL: {1} +# INFO Level Metrics Logs +CREATE_INDEX_TIME=\ + SDB0020I|\ + Create index request for index {0} document type {1} +DELETE_INDEX_TIME=\ + SDB0022I|\ + Delete index request for index {0} +CREATE_DOCUMENT_TIME=\ + SDB0023|\ + Create document in index {0} +UPDATE_DOCUMENT_TIME=\ + SDB0024|\ + Update document in index {0} with id {1} +DELETE_DOCUMENT_TIME=\ + SDB0025|\ + Delete document in index {0} with id {1} +GET_DOCUMENT_TIME=\ + SDB0026|\ + Get document from index {0} with id {1} +QUERY_DOCUMENT_TIME=\ + SDB0027|\ + Query request for index {0} with query string {1} +BULK_OPERATIONS_TIME=\ + SDB0028|\ + Bulk operations request +CHECK_INDEX_TIME=\ + SDB0029|\ + Check for index {0} +# WARNING logs +INDEX_CREATE_FAILURE=\ + SDB0301W|\ + Failed to create index with index name = {0}. Cause: {1}|\ + Check cause. It is possible the index already exists.|\ + Failed to create the specified index +INDEX_DELETE_FAILURE=\ + SDB0302W|\ + Failed to delete index with index name = {0}. Cause: {1}|\ + Check cause. It is possible the index does not exist.|\ + Failed to delete the specified index +FILTERS_CONFIG_FAILURE=\ + SDB0303W|\ + Failed to read filter configuration from file {0}. Cause: {1} +ANALYSYS_CONFIG_FAILURE=\ + SDB0304W|\ + Failed to read analysis configuration from file {0}. Cause: {1} +GET_ANALYZERS_FAILURE=\ + SDB0305W|\ + Failed to get analyzer definitions. Cause: {0} +BULK_OPERATION_FAILURE=\ + SDB0306W|\ + Failed to execute bulk operations. Cause: {0} +# ERROR logs +ELASTIC_SEARCH_CONNECTION_FAILURE=\ + SDB0501E|\ + Failed to establish connection to ElasticSearch {0}. Cause: {1}|\ + Check connectivity with ElasticSearch. Ensure ElasticSearch is up and reachable.|\ + A connectivity check to ElasticSearch has failed. +EXCEPTION_DURING_METHOD_CALL=\ + SDB0502E|\ + Failed to execute method {0} due to: {1}|\ + Check error cause|\ + Method failed to execute +PROCESS_REST_REQUEST=\ + SDB0503E|\ + Received request {0} {1} from {2}. Sending response: {3} +STARTUP_EXCEPTION=\ + SDB0504E|\ + Exception encountered during startup of search service: {0} -- cgit 1.2.3-korg