From 7a74f809081dac941c93ef40118dbdb9e4364140 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Tue, 1 Aug 2023 18:21:43 -0700 Subject: [PATCH] palomar: proposed post and profile schema iteration --- cmd/palomar/post_schema.json | 69 +++++++++++++++++++++++++++++++++ cmd/palomar/profile_schema.json | 62 +++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 cmd/palomar/post_schema.json create mode 100644 cmd/palomar/profile_schema.json diff --git a/cmd/palomar/post_schema.json b/cmd/palomar/post_schema.json new file mode 100644 index 000000000..c2391ae41 --- /dev/null +++ b/cmd/palomar/post_schema.json @@ -0,0 +1,69 @@ +{ +"settings": { + "index": { + "analysis": { + "analyzer": { + "default": { + "type": "custom", + "tokenizer": "standard", + "filter": [ "lowercase", "asciifolding" ] + }, + "textIcu": { + "type": "custom", + "tokenizer": "icu_tokenizer", + "char_filter": [ "icu_normalizer" ], + "filter": [ "icu_folding" ] + }, + "textIcuSearch": { + "type": "custom", + "tokenizer": "icu_tokenizer", + "char_filter": [ "icu_normalizer" ], + "filter": [ "icu_folding" ] + } + }, + "normalizer": { + "default": { + "type": "custom", + "char_filter": [], + "filter": ["lowercase"] + }, + "caseSensitive": { + "type": "custom", + "char_filter": [], + "filter": [] + } + } + } + } +}, +"mappings": { + "_doc": { + "properties": { + "doc_index_ts": { "type": "date" }, + "created_at": { "type": "date" }, + "did": { "type": "keyword", "normalizer": "default", "doc_values": false }, + "handle": { "type": "keyword", "normalizer": "default", "copy_to": "everything" }, + "display_name": { "type": "keyword", "normalizer": "default", "copy_to": "everything" }, + "tid": { "type": "keyword", "normalizer": "default" }, + + "text": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch", "copy_to": "everything" }, + + "mention_did": { "type": "keyword", "normalizer": "default", "doc_values": false }, + "mention_handle": { "type": "keyword", "normalizer": "default" }, + "embed_url": { "type": "keyword", "normalizer": "default" }, + "embed_text": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch", "copy_to": "everything" }, + "quote_uri": { "type": "keyword", "normalizer": "default" }, + "reply_parent_uri": { "type": "keyword", "normalizer": "default" }, + "reply_root_uri": { "type": "keyword", "normalizer": "default" }, + "record_label": { "type": "keyword", "normalizer": "default", "copy_to": "label" }, + "repo_label": { "type": "keyword", "normalizer": "default", "copy_to": "label" }, + "lang_code": { "type": "keyword", "normalizer": "default" }, + "img_count": { "type": "integer" }, + "img_alt_text": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch", "copy_to": "everything" }, + + "label": { "type": "keyword", "normalizer": "default" }, + "everything": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch" } + } + } +} +} diff --git a/cmd/palomar/profile_schema.json b/cmd/palomar/profile_schema.json new file mode 100644 index 000000000..26432397e --- /dev/null +++ b/cmd/palomar/profile_schema.json @@ -0,0 +1,62 @@ +{ +"settings": { + "index": { + "analysis": { + "analyzer": { + "default": { + "type": "custom", + "tokenizer": "standard", + "filter": [ "lowercase", "asciifolding" ] + }, + "textIcu": { + "type": "custom", + "tokenizer": "icu_tokenizer", + "char_filter": [ "icu_normalizer" ], + "filter": [ "icu_folding" ] + }, + "textIcuSearch": { + "type": "custom", + "tokenizer": "icu_tokenizer", + "char_filter": [ "icu_normalizer" ], + "filter": [ "icu_folding" ] + } + }, + "normalizer": { + "default": { + "type": "custom", + "char_filter": [], + "filter": ["lowercase"] + }, + "caseSensitive": { + "type": "custom", + "char_filter": [], + "filter": [] + } + } + } + } +}, +"mappings": { + "_doc": { + "properties": { + "doc_index_ts": { "type": "date" }, + "created_at": { "type": "date" }, + "did": { "type": "keyword", "normalizer": "default", "doc_values": false }, + "handle": { "type": "keyword", "normalizer": "default", "copy_to": "everything" }, + "display_name": { "type": "keyword", "normalizer": "default", "copy_to": "everything" }, + + "description": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch", "copy_to": "everything" }, + + "record_label": { "type": "keyword", "normalizer": "default", "copy_to": "label" }, + "repo_label": { "type": "keyword", "normalizer": "default", "copy_to": "label" }, + "lang_code": { "type": "keyword", "normalizer": "default" }, + "img_alt_text": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch", "copy_to": "everything" }, + "has_avatar": { "type": "boolean" }, + "has_banner": { "type": "boolean" }, + + "label": { "type": "keyword", "normalizer": "default" }, + "everything": { "type": "text", "index": true, "analyzer": "textIcu", "search_analyzer":"textIcuSearch" } + } + } +} +}