From 771ee5e73ccc64420b47480dd2a94dd49bd5fafa Mon Sep 17 00:00:00 2001 From: Sebastian Frank Date: Wed, 2 Mar 2022 17:45:45 +0100 Subject: [PATCH] collection indexes --- schemas/api-config/collection.json | 19 +++++++++++++ schemas/api-config/index.json | 45 ++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 schemas/api-config/index.json diff --git a/schemas/api-config/collection.json b/schemas/api-config/collection.json index df11cf4..d818fa5 100644 --- a/schemas/api-config/collection.json +++ b/schemas/api-config/collection.json @@ -9,6 +9,10 @@ "type": "string", "description": "collection name, part of api path" }, + "defaultLanguage": { + "type": "string", + "description": "default language for database text index" + }, "uploadPath": { "type": "string", "description": "relative to config.yml, path for file uploads" @@ -182,6 +186,21 @@ } ] } + }, + "indexes": { + "type": "array", + "description": "indexes of collection", + "items": { + "oneOf": [ + { + "$comment": "for include tag", + "type": "string" + }, + { + "$ref": "index.json" + } + ] + } } }, "required": ["name", "permissions"] diff --git a/schemas/api-config/index.json b/schemas/api-config/index.json new file mode 100644 index 0000000..a16e3b2 --- /dev/null +++ b/schemas/api-config/index.json @@ -0,0 +1,45 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSON Schema tibi-server index configuration", + "description": "tibi-server index linter", + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "name of index" + }, + "key": { + "type": "array", + "description": "array of keys, minus in front for reverse order", + "items": { + "type": "string" + } + }, + "unique": { + "type": "boolean", + "description": "unique index" + }, + "dropDups": { + "type": "boolean", + "description": "drop duplicates" + }, + "background": { + "type": "boolean", + "description": "build index in background" + }, + "sparse": { + "type": "boolean", + "description": "sparse index" + }, + "defaultLanguage": { + "type": "string", + "description": "default language for text index" + }, + "languageOverride": { + "type": "string", + "description": "language override field name" + } + }, + "required": ["key"] +}