From a7694d266c5c0514ec961bca0f51f18a104c873d Mon Sep 17 00:00:00 2001 From: pushrbx Date: Sat, 18 Jun 2022 11:48:45 +0100 Subject: [PATCH] added elasticsearch config --- .env.dist | 10 ++ config/elasticsearch.php | 204 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 config/elasticsearch.php diff --git a/.env.dist b/.env.dist index 5f5316a..a9bb57f 100755 --- a/.env.dist +++ b/.env.dist @@ -107,9 +107,19 @@ QUEUE_DELAY_PER_JOB=5 ### # ElasticSearch Config ### +# Host -- required # ELASTICSEARCH_HOST=host:port # you can use commas as sperator for additional nodes: # ELASTICSEARCH_HOST=host:port,host:port +# username (optional) +# ELASTICSEARCH_USER=user +# password (optional) +# ELASTICSEARCH_PASSWORD=password +# api key (optional) +# ELASTICSEARCH_API_KEY=apikey +# cloud id (optional) +# ELASTICSEARCH_CLOUD_ID=cloudid + ### # Throttling diff --git a/config/elasticsearch.php b/config/elasticsearch.php new file mode 100644 index 0000000..3ef3031 --- /dev/null +++ b/config/elasticsearch.php @@ -0,0 +1,204 @@ + env('ELASTICSEARCH_HOST'), + 'user' => env('ELASTICSEARCH_USER'), + 'password' => env('ELASTICSEARCH_PASSWORD'), + 'cloud_id' => env('ELASTICSEARCH_CLOUD_ID'), + 'api_key' => env('ELASTICSEARCH_API_KEY'), + 'indices' => [ + 'mappings' => [ + 'default' => [ + 'properties' => [ + 'id' => [ + 'type' => 'keyword', + ], + 'mal_id' => [ + 'type' => 'keyword' + ] + ], + ], + 'anime_index' => [ + 'properties' => [ + 'id' => [ + 'type' => 'keyword', + ], + 'mal_id' => [ + 'type' => 'keyword' + ], + 'start_date' => [ + 'type' => 'date' + ], + 'end_date' => [ + 'type' => 'date' + ], + 'title' => [ + 'type' => 'text' + ], + 'title_english' => [ + 'type' => 'text' + ], + 'title_japanese' => [ + 'type' => 'text' + ], + 'title_synonyms' => [ + 'type' => 'text' + ], + 'type' => [ + 'type' => 'keyword' + ], + 'source' => [ + 'type' => 'keyword' + ], + 'episodes' => [ + 'type' => 'short' + ], + 'status' => [ + 'type' => 'keyword' + ], + 'airing' => [ + 'type' => 'boolean' + ], + 'rating' => [ + 'type' => 'float' + ], + 'score' => [ + 'type' => 'float' + ], + 'rank' => [ + 'type' => 'integer' + ], + 'popularity' => [ + 'type' => 'integer' + ], + 'members' => [ + 'type' => 'integer' + ], + 'favorites' => [ + 'type' => 'integer' + ], + 'synopsis' => [ + 'type' => 'text' + ], + 'season' => [ + 'type' => 'keyword' + ], + 'year' => [ + 'type' => 'keyword' + ] + ] + ], + 'manga_index' => [ + 'properties' => [ + 'id' => [ + 'type' => 'keyword', + ], + 'mal_id' => [ + 'type' => 'keyword' + ], + 'start_date' => [ + 'type' => 'date' + ], + 'end_date' => [ + 'type' => 'date' + ], + 'title' => [ + 'type' => 'text' + ], + 'title_english' => [ + 'type' => 'text' + ], + 'title_japanese' => [ + 'type' => 'text' + ], + 'title_synonyms' => [ + 'type' => 'text' + ], + 'type' => [ + 'type' => 'keyword' + ], + 'source' => [ + 'type' => 'keyword' + ], + 'chapters' => [ + 'type' => 'short' + ], + 'volumes' => [ + 'type' => 'short' + ], + 'status' => [ + 'type' => 'keyword' + ], + 'publishing' => [ + 'type' => 'boolean' + ], + 'rating' => [ + 'type' => 'float' + ], + 'score' => [ + 'type' => 'float' + ], + 'rank' => [ + 'type' => 'integer' + ], + 'popularity' => [ + 'type' => 'integer' + ], + 'members' => [ + 'type' => 'integer' + ], + 'favorites' => [ + 'type' => 'integer' + ], + 'synopsis' => [ + 'type' => 'text' + ], + 'season' => [ + 'type' => 'keyword' + ] + ] + ], + 'characters_index' => [ + 'properties' => [ + 'id' => [ + 'type' => 'keyword', + ], + 'mal_id' => [ + 'type' => 'keyword' + ], + 'name' => [ + 'type' => 'text' + ], + 'name_kanji' => [ + 'type' => 'text' + ] + ] + ], + 'people_index' => [ + 'properties' => [ + 'id' => [ + 'type' => 'keyword', + ], + 'mal_id' => [ + 'type' => 'keyword' + ], + 'name' => [ + 'type' => 'text' + ], + 'given_name' => [ + 'type' => 'text' + ], + 'family_name' => [ + 'type' => 'text' + ] + ] + ] + ], + 'settings' => [ + 'default' => [ + 'number_of_shards' => 1, + 'number_of_replicas' => 0, + ], + ], + ], +];