From 2e041cbb7940c35633b943a4522408248a0f636e Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 28 Oct 2024 16:06:03 +0100 Subject: [PATCH 1/7] move mappings to json files --- es/account/mapping.json | 52 +++ es/author/mapping.json | 157 +++++++++ es/contributor/mapping.json | 25 ++ es/cover/mapping.json | 40 +++ es/cve/mapping.json | 41 +++ es/distribution/mapping.json | 116 +++++++ es/favorite/mapping.json | 34 ++ es/file/mapping.json | 293 +++++++++++++++++ es/identity/mapping.json | 15 + es/mirror/mapping.json | 166 ++++++++++ es/package/mapping.json | 35 ++ es/permission/mapping.json | 20 ++ es/release/mapping.json | 271 ++++++++++++++++ es/session/mapping.json | 3 + es/settings.json | 58 ++++ lib/MetaCPAN/ESConfig.pm | 31 +- lib/MetaCPAN/Script/Mapping/CPAN/Author.pm | 166 ---------- .../Script/Mapping/CPAN/Distribution.pm | 125 -------- lib/MetaCPAN/Script/Mapping/CPAN/Favorite.pm | 43 --- lib/MetaCPAN/Script/Mapping/CPAN/File.pm | 302 ------------------ lib/MetaCPAN/Script/Mapping/CPAN/Mirror.pm | 175 ---------- lib/MetaCPAN/Script/Mapping/CPAN/Package.pm | 44 --- .../Script/Mapping/CPAN/Permission.pm | 29 -- lib/MetaCPAN/Script/Mapping/CPAN/Release.pm | 280 ---------------- lib/MetaCPAN/Script/Mapping/CVE.pm | 50 --- lib/MetaCPAN/Script/Mapping/Contributor.pm | 34 -- lib/MetaCPAN/Script/Mapping/Cover.pm | 49 --- .../Script/Mapping/DeployStatement.pm | 67 ---- lib/MetaCPAN/Script/Mapping/User/Account.pm | 61 ---- lib/MetaCPAN/Script/Mapping/User/Identity.pm | 24 -- lib/MetaCPAN/Script/Mapping/User/Session.pm | 12 - t/lib/MetaCPAN/TestServer.pm | 1 - t/script/load.t | 58 ++-- 33 files changed, 1363 insertions(+), 1514 deletions(-) create mode 100644 es/account/mapping.json create mode 100644 es/author/mapping.json create mode 100644 es/contributor/mapping.json create mode 100644 es/cover/mapping.json create mode 100644 es/cve/mapping.json create mode 100644 es/distribution/mapping.json create mode 100644 es/favorite/mapping.json create mode 100644 es/file/mapping.json create mode 100644 es/identity/mapping.json create mode 100644 es/mirror/mapping.json create mode 100644 es/package/mapping.json create mode 100644 es/permission/mapping.json create mode 100644 es/release/mapping.json create mode 100644 es/session/mapping.json create mode 100644 es/settings.json delete mode 100644 lib/MetaCPAN/Script/Mapping/CPAN/Author.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/CPAN/Distribution.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/CPAN/Favorite.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/CPAN/File.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/CPAN/Mirror.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/CPAN/Package.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/CPAN/Permission.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/CPAN/Release.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/CVE.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/Contributor.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/Cover.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/DeployStatement.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/User/Account.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/User/Identity.pm delete mode 100644 lib/MetaCPAN/Script/Mapping/User/Session.pm diff --git a/es/account/mapping.json b/es/account/mapping.json new file mode 100644 index 000000000..ee6363bc5 --- /dev/null +++ b/es/account/mapping.json @@ -0,0 +1,52 @@ +{ + "dynamic" : "false", + "properties" : { + "access_token" : { + "dynamic" : "true", + "properties" : { + "client" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "token" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } + }, + "code" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "id" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "identity" : { + "dynamic" : "false", + "properties" : { + "key" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } + }, + "looks_human" : { + "type" : "boolean" + }, + "passed_captcha" : { + "format" : "strict_date_optional_time||epoch_millis", + "type" : "date" + } + } +} diff --git a/es/author/mapping.json b/es/author/mapping.json new file mode 100644 index 000000000..cc1e827ff --- /dev/null +++ b/es/author/mapping.json @@ -0,0 +1,157 @@ +{ + "dynamic" : false, + "properties" : { + "asciiname" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "blog" : { + "dynamic" : true, + "properties" : { + "feed" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "url" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } + }, + "city" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "country" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "donation" : { + "dynamic" : true, + "properties" : { + "id" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } + }, + "email" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "gravatar_url" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "is_pause_custodial_account" : { + "type" : "boolean" + }, + "location" : { + "type" : "geo_point" + }, + "name" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "pauseid" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "perlmongers" : { + "dynamic" : true, + "properties" : { + "name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "url" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } + }, + "profile" : { + "dynamic" : false, + "include_in_root" : true, + "properties" : { + "id" : { + "fields" : { + "analyzed" : { + "analyzer" : "simple", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + }, + "type" : "nested" + }, + "region" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "updated" : { + "format" : "strict_date_optional_time||epoch_millis", + "type" : "date" + }, + "user" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "website" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } +} diff --git a/es/contributor/mapping.json b/es/contributor/mapping.json new file mode 100644 index 000000000..2638be3da --- /dev/null +++ b/es/contributor/mapping.json @@ -0,0 +1,25 @@ +{ + "dynamic" : false, + "properties" : { + "distribution" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "pauseid" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "release_author" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "release_name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } +} diff --git a/es/cover/mapping.json b/es/cover/mapping.json new file mode 100644 index 000000000..7d3dbc48e --- /dev/null +++ b/es/cover/mapping.json @@ -0,0 +1,40 @@ +{ + "dynamic" : false, + "properties" : { + "criteria" : { + "dynamic" : true, + "properties" : { + "branch" : { + "type" : "float" + }, + "condition" : { + "type" : "float" + }, + "statement" : { + "type" : "float" + }, + "subroutine" : { + "type" : "float" + }, + "total" : { + "type" : "float" + } + } + }, + "distribution" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "release" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "version" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } +} diff --git a/es/cve/mapping.json b/es/cve/mapping.json new file mode 100644 index 000000000..e594d88c6 --- /dev/null +++ b/es/cve/mapping.json @@ -0,0 +1,41 @@ +{ + "dynamic" : false, + "properties" : { + "affected_versions" : { + "type" : "string" + }, + "cpansa_id" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "cves" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "distribution" : { + "index" : "not_analyzed", + "type" : "string" + }, + "references" : { + "type" : "string" + }, + "releases" : { + "index" : "not_analyzed", + "type" : "string" + }, + "reported" : { + "format" : "strict_date_optional_time||epoch_millis", + "type" : "date" + }, + "severity" : { + "type" : "string" + }, + "versions" : { + "index" : "not_analyzed", + "type" : "string" + } + } +} diff --git a/es/distribution/mapping.json b/es/distribution/mapping.json new file mode 100644 index 000000000..79f861695 --- /dev/null +++ b/es/distribution/mapping.json @@ -0,0 +1,116 @@ +{ + "dynamic" : false, + "properties" : { + "bugs" : { + "dynamic" : true, + "properties" : { + "github" : { + "dynamic" : true, + "properties" : { + "active" : { + "type" : "integer" + }, + "closed" : { + "type" : "integer" + }, + "open" : { + "type" : "integer" + }, + "source" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } + }, + "rt" : { + "dynamic" : true, + "properties" : { + "active" : { + "type" : "integer" + }, + "closed" : { + "type" : "integer" + }, + "new" : { + "type" : "integer" + }, + "open" : { + "type" : "integer" + }, + "patched" : { + "type" : "integer" + }, + "rejected" : { + "type" : "integer" + }, + "resolved" : { + "type" : "integer" + }, + "source" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "stalled" : { + "type" : "integer" + } + } + } + } + }, + "external_package" : { + "dynamic" : true, + "properties" : { + "cygwin" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "debian" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } + }, + "name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "repo" : { + "dynamic" : true, + "properties" : { + "github" : { + "dynamic" : true, + "properties" : { + "stars" : { + "type" : "integer" + }, + "watchers" : { + "type" : "integer" + } + } + } + } + }, + "river" : { + "dynamic" : true, + "properties" : { + "bucket" : { + "type" : "integer" + }, + "bus_factor" : { + "type" : "integer" + }, + "immediate" : { + "type" : "integer" + }, + "total" : { + "type" : "integer" + } + } + } + } +} diff --git a/es/favorite/mapping.json b/es/favorite/mapping.json new file mode 100644 index 000000000..e431e21bf --- /dev/null +++ b/es/favorite/mapping.json @@ -0,0 +1,34 @@ +{ + "dynamic" : false, + "properties" : { + "author" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "date" : { + "format" : "strict_date_optional_time||epoch_millis", + "type" : "date" + }, + "distribution" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "id" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "release" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "user" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } +} diff --git a/es/file/mapping.json b/es/file/mapping.json new file mode 100644 index 000000000..8fd08bddd --- /dev/null +++ b/es/file/mapping.json @@ -0,0 +1,293 @@ +{ + "dynamic" : "false", + "properties" : { + "abstract" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "author" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "authorized" : { + "type" : "boolean" + }, + "binary" : { + "type" : "boolean" + }, + "date" : { + "format" : "strict_date_optional_time||epoch_millis", + "type" : "date" + }, + "deprecated" : { + "type" : "boolean" + }, + "description" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "dir" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "directory" : { + "type" : "boolean" + }, + "dist_fav_count" : { + "type" : "integer" + }, + "distribution" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + }, + "camelcase" : { + "analyzer" : "camelcase", + "store" : true, + "type" : "string" + }, + "lowercase" : { + "analyzer" : "lowercase", + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "documentation" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + }, + "camelcase" : { + "analyzer" : "camelcase", + "store" : true, + "type" : "string" + }, + "edge" : { + "analyzer" : "edge", + "store" : true, + "type" : "string" + }, + "edge_camelcase" : { + "analyzer" : "edge_camelcase", + "store" : true, + "type" : "string" + }, + "lowercase" : { + "analyzer" : "lowercase", + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "documentation_length" : { + "type" : "integer" + }, + "download_url" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "id" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "indexed" : { + "type" : "boolean" + }, + "level" : { + "type" : "integer" + }, + "maturity" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "mime" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "module" : { + "dynamic" : "false", + "include_in_root" : true, + "properties" : { + "associated_pod" : { + "type" : "string" + }, + "authorized" : { + "type" : "boolean" + }, + "indexed" : { + "type" : "boolean" + }, + "name" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + }, + "camelcase" : { + "analyzer" : "camelcase", + "store" : true, + "type" : "string" + }, + "lowercase" : { + "analyzer" : "lowercase", + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "version" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "version_numified" : { + "type" : "float" + } + }, + "type" : "nested" + }, + "name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "path" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "pod" : { + "analyzer" : "standard", + "doc_values" : false, + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "doc_values" : false, + "index" : "analyzed", + "type" : "string" + } + }, + "index" : "analyzed", + "type" : "string" + }, + "pod_lines" : { + "doc_values" : true, + "ignore_above" : 2048, + "index" : "no", + "type" : "string" + }, + "release" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + }, + "camelcase" : { + "analyzer" : "camelcase", + "store" : true, + "type" : "string" + }, + "lowercase" : { + "analyzer" : "lowercase", + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "sloc" : { + "type" : "integer" + }, + "slop" : { + "type" : "integer" + }, + "stat" : { + "dynamic" : "true", + "properties" : { + "gid" : { + "type" : "long" + }, + "mode" : { + "type" : "integer" + }, + "mtime" : { + "type" : "integer" + }, + "size" : { + "type" : "integer" + }, + "uid" : { + "type" : "long" + } + } + }, + "status" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "suggest" : { + "analyzer" : "simple", + "max_input_length" : 50, + "preserve_position_increments" : true, + "preserve_separators" : true, + "type" : "completion" + }, + "version" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "version_numified" : { + "type" : "float" + } + } +} diff --git a/es/identity/mapping.json b/es/identity/mapping.json new file mode 100644 index 000000000..5d2b7d5e9 --- /dev/null +++ b/es/identity/mapping.json @@ -0,0 +1,15 @@ +{ + "dynamic" : false, + "properties" : { + "key" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } +} diff --git a/es/mirror/mapping.json b/es/mirror/mapping.json new file mode 100644 index 000000000..884f18ac6 --- /dev/null +++ b/es/mirror/mapping.json @@ -0,0 +1,166 @@ +{ + "dynamic" : false, + "properties" : { + "A_or_CNAME" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "aka_name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "ccode" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "city" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "contact" : { + "dynamic" : false, + "properties" : { + "contact_site" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "contact_user" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } + }, + "continent" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "country" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "dnsrr" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "freq" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "ftp" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "http" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "inceptdate" : { + "format" : "strict_date_optional_time||epoch_millis", + "type" : "date" + }, + "location" : { + "type" : "geo_point" + }, + "name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "note" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "org" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "region" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "reitredate" : { + "format" : "strict_date_optional_time||epoch_millis", + "type" : "date" + }, + "rsync" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "src" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "tz" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } +} diff --git a/es/package/mapping.json b/es/package/mapping.json new file mode 100644 index 000000000..79b6e2b2d --- /dev/null +++ b/es/package/mapping.json @@ -0,0 +1,35 @@ +{ + "dynamic" : false, + "properties" : { + "author" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "dist_version" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "distribution" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "file" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "module_name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "version" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } +} diff --git a/es/permission/mapping.json b/es/permission/mapping.json new file mode 100644 index 000000000..c03b227c0 --- /dev/null +++ b/es/permission/mapping.json @@ -0,0 +1,20 @@ +{ + "dynamic" : false, + "properties" : { + "co_maintainers" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "module_name" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "owner" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + } +} diff --git a/es/release/mapping.json b/es/release/mapping.json new file mode 100644 index 000000000..5555d1721 --- /dev/null +++ b/es/release/mapping.json @@ -0,0 +1,271 @@ +{ + "dynamic" : false, + "properties" : { + "abstract" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "archive" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "author" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "authorized" : { + "type" : "boolean" + }, + "changes_file" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "checksum_md5" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "checksum_sha256" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "date" : { + "format" : "strict_date_optional_time||epoch_millis", + "type" : "date" + }, + "dependency" : { + "dynamic" : false, + "include_in_root" : true, + "properties" : { + "module" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "phase" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "relationship" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "version" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + }, + "type" : "nested" + }, + "deprecated" : { + "type" : "boolean" + }, + "distribution" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + }, + "camelcase" : { + "analyzer" : "camelcase", + "store" : true, + "type" : "string" + }, + "lowercase" : { + "analyzer" : "lowercase", + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "download_url" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "first" : { + "type" : "boolean" + }, + "id" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "license" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "main_module" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "maturity" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "name" : { + "fields" : { + "analyzed" : { + "analyzer" : "standard", + "fielddata" : { + "format" : "disabled" + }, + "store" : true, + "type" : "string" + }, + "camelcase" : { + "analyzer" : "camelcase", + "store" : true, + "type" : "string" + }, + "lowercase" : { + "analyzer" : "lowercase", + "store" : true, + "type" : "string" + } + }, + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "provides" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "resources" : { + "dynamic" : true, + "include_in_root" : true, + "properties" : { + "bugtracker" : { + "dynamic" : true, + "include_in_root" : true, + "properties" : { + "mailto" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "web" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + }, + "type" : "nested" + }, + "homepage" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "license" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "repository" : { + "dynamic" : true, + "include_in_root" : true, + "properties" : { + "type" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "url" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "web" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + } + }, + "type" : "nested" + } + }, + "type" : "nested" + }, + "stat" : { + "dynamic" : true, + "properties" : { + "gid" : { + "type" : "long" + }, + "mode" : { + "type" : "integer" + }, + "mtime" : { + "type" : "integer" + }, + "size" : { + "type" : "integer" + }, + "uid" : { + "type" : "long" + } + } + }, + "status" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "tests" : { + "dynamic" : true, + "properties" : { + "fail" : { + "type" : "integer" + }, + "na" : { + "type" : "integer" + }, + "pass" : { + "type" : "integer" + }, + "unknown" : { + "type" : "integer" + } + } + }, + "version" : { + "ignore_above" : 2048, + "index" : "not_analyzed", + "type" : "string" + }, + "version_numified" : { + "type" : "float" + } + } +} diff --git a/es/session/mapping.json b/es/session/mapping.json new file mode 100644 index 000000000..cd84e1123 --- /dev/null +++ b/es/session/mapping.json @@ -0,0 +1,3 @@ +{ + "dynamic" : "false" +} diff --git a/es/settings.json b/es/settings.json new file mode 100644 index 000000000..3ac1848e7 --- /dev/null +++ b/es/settings.json @@ -0,0 +1,58 @@ +{ + "analysis" : { + "analyzer" : { + "camelcase" : { + "filter" : [ + "lowercase", + "unique" + ], + "tokenizer" : "camelcase", + "type" : "custom" + }, + "edge" : { + "filter" : [ + "lowercase", + "edge" + ], + "tokenizer" : "standard", + "type" : "custom" + }, + "edge_camelcase" : { + "filter" : [ + "lowercase", + "edge" + ], + "tokenizer" : "camelcase", + "type" : "custom" + }, + "fulltext" : { + "type" : "english" + }, + "lowercase" : { + "filter" : "lowercase", + "tokenizer" : "keyword" + } + }, + "filter" : { + "edge" : { + "max_gram" : 20, + "min_gram" : 1, + "type" : "edge_ngram" + } + }, + "tokenizer" : { + "camelcase" : { + "pattern" : "([^\\p{L}\\d]+)|(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)|(?<=[\\p{L}&&[^\\p{Lu}]])(?=\\p{Lu})|(?<=\\p{Lu})(?=\\p{Lu}[\\p{L}&&[^\\p{Lu}]])", + "type" : "pattern" + } + } + }, + "index" : { + "mapper" : { + "dynamic" : false + }, + "number_of_replicas" : 1, + "number_of_shards" : 1, + "refresh_interval" : "1s" + } +} diff --git a/lib/MetaCPAN/ESConfig.pm b/lib/MetaCPAN/ESConfig.pm index 801f09682..a12808480 100644 --- a/lib/MetaCPAN/ESConfig.pm +++ b/lib/MetaCPAN/ESConfig.pm @@ -22,94 +22,93 @@ const my %config => merge( }, indexes => { _default => { - settings => - 'MetaCPAN::Script::Mapping::DeployStatement::mapping()', + settings => 'es/settings.json', }, }, documents => { author => { index => 'cpan_v1_01', type => 'author', - mapping => 'MetaCPAN::Script::Mapping::CPAN::Author', + mapping => 'es/author/mapping.json', model => 'MetaCPAN::Document::Author', }, cve => { index => 'cve', type => 'cve', - mapping => 'MetaCPAN::Script::Mapping::CVE', + mapping => 'es/cve/mapping.json', model => 'MetaCPAN::Document::CVE', }, contributor => { index => 'contributor', type => 'contributor', - mapping => 'MetaCPAN::Script::Mapping::Contributor', + mapping => 'es/contributor/mapping.json', model => 'MetaCPAN::Document::Contributor', }, cover => { index => 'cover', type => 'cover', - mapping => 'MetaCPAN::Script::Mapping::Cover', + mapping => 'es/cover/mapping.json', model => 'MetaCPAN::Document::Cover', }, distribution => { index => 'cpan_v1_01', type => 'distribution', - mapping => 'MetaCPAN::Script::Mapping::CPAN::Distribution', + mapping => 'es/distribution/mapping.json', model => 'MetaCPAN::Document::Distribution', }, favorite => { index => 'cpan_v1_01', type => 'favorite', - mapping => 'MetaCPAN::Script::Mapping::CPAN::Favorite', + mapping => 'es/favorite/mapping.json', model => 'MetaCPAN::Document::Favorite', }, file => { index => 'cpan_v1_01', type => 'file', - mapping => 'MetaCPAN::Script::Mapping::CPAN::File', + mapping => 'es/file/mapping.json', model => 'MetaCPAN::Document::File', }, mirror => { index => 'cpan_v1_01', type => 'mirror', - mapping => 'MetaCPAN::Script::Mapping::CPAN::Mirror', + mapping => 'es/mirror/mapping.json', model => 'MetaCPAN::Document::Mirror', }, package => { index => 'cpan_v1_01', type => 'package', - mapping => 'MetaCPAN::Script::Mapping::CPAN::Package', + mapping => 'es/package/mapping.json', model => 'MetaCPAN::Document::Package', }, permission => { index => 'cpan_v1_01', type => 'permission', - mapping => 'MetaCPAN::Script::Mapping::CPAN::Permission', + mapping => 'es/permission/mapping.json', model => 'MetaCPAN::Document::Permission', }, release => { index => 'cpan_v1_01', type => 'release', - mapping => 'MetaCPAN::Script::Mapping::CPAN::Release', + mapping => 'es/release/mapping.json', model => 'MetaCPAN::Document::Release', }, account => { index => 'user', type => 'account', - mapping => 'MetaCPAN::Script::Mapping::User::Account', + mapping => 'es/account/mapping.json', model => 'MetaCPAN::Model::User::Account', }, identity => { index => 'user', type => 'identity', - mapping => 'MetaCPAN::Script::Mapping::User::Identity', + mapping => 'es/identity/mapping.json', model => 'MetaCPAN::Model::User::Identity', }, session => { index => 'user', type => 'session', - mapping => 'MetaCPAN::Script::Mapping::User::Session', + mapping => 'es/session/mapping.json', model => 'MetaCPAN::Model::User::Session', }, }, diff --git a/lib/MetaCPAN/Script/Mapping/CPAN/Author.pm b/lib/MetaCPAN/Script/Mapping/CPAN/Author.pm deleted file mode 100644 index 7e7aa4a9e..000000000 --- a/lib/MetaCPAN/Script/Mapping/CPAN/Author.pm +++ /dev/null @@ -1,166 +0,0 @@ -package MetaCPAN::Script::Mapping::CPAN::Author; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "asciiname" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "blog" : { - "dynamic" : true, - "properties" : { - "feed" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }, - "city" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "country" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "is_pause_custodial_account" : { - "type" : "boolean" - }, - "donation" : { - "dynamic" : true, - "properties" : { - "id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }, - "email" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "gravatar_url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "location" : { - "type" : "geo_point" - }, - "name" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "pauseid" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "perlmongers" : { - "dynamic" : true, - "properties" : { - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }, - "profile" : { - "dynamic" : false, - "include_in_root" : true, - "properties" : { - "id" : { - "fields" : { - "analyzed" : { - "analyzer" : "simple", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - }, - "type" : "nested" - }, - "region" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "updated" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" - }, - "user" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "website" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/CPAN/Distribution.pm b/lib/MetaCPAN/Script/Mapping/CPAN/Distribution.pm deleted file mode 100644 index e89a03c0e..000000000 --- a/lib/MetaCPAN/Script/Mapping/CPAN/Distribution.pm +++ /dev/null @@ -1,125 +0,0 @@ -package MetaCPAN::Script::Mapping::CPAN::Distribution; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "bugs" : { - "dynamic" : true, - "properties" : { - "github" : { - "dynamic" : true, - "properties" : { - "active" : { - "type" : "integer" - }, - "closed" : { - "type" : "integer" - }, - "open" : { - "type" : "integer" - }, - "source" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }, - "rt" : { - "dynamic" : true, - "properties" : { - "active" : { - "type" : "integer" - }, - "closed" : { - "type" : "integer" - }, - "new" : { - "type" : "integer" - }, - "open" : { - "type" : "integer" - }, - "patched" : { - "type" : "integer" - }, - "rejected" : { - "type" : "integer" - }, - "resolved" : { - "type" : "integer" - }, - "source" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "stalled" : { - "type" : "integer" - } - } - } - } - }, - "repo" : { - "dynamic" : true, - "properties" : { - "github" : { - "dynamic" : true, - "properties" : { - "stars" : { - "type" : "integer" - }, - "watchers" : { - "type" : "integer" - } - } - } - } - }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "external_package" : { - "dynamic" : true, - "properties" : { - "cygwin" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "debian" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }, - "river" : { - "dynamic" : true, - "properties" : { - "bucket" : { - "type" : "integer" - }, - "bus_factor" : { - "type" : "integer" - }, - "immediate" : { - "type" : "integer" - }, - "total" : { - "type" : "integer" - } - } - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/CPAN/Favorite.pm b/lib/MetaCPAN/Script/Mapping/CPAN/Favorite.pm deleted file mode 100644 index 12ff1b714..000000000 --- a/lib/MetaCPAN/Script/Mapping/CPAN/Favorite.pm +++ /dev/null @@ -1,43 +0,0 @@ -package MetaCPAN::Script::Mapping::CPAN::Favorite; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "author" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "date" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" - }, - "distribution" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "release" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "user" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/CPAN/File.pm b/lib/MetaCPAN/Script/Mapping/CPAN/File.pm deleted file mode 100644 index 7c38501bc..000000000 --- a/lib/MetaCPAN/Script/Mapping/CPAN/File.pm +++ /dev/null @@ -1,302 +0,0 @@ -package MetaCPAN::Script::Mapping::CPAN::File; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : "false", - "properties" : { - "abstract" : { - "type" : "string", - "index" : "not_analyzed", - "fields" : { - "analyzed" : { - "type" : "string", - "store" : true, - "fielddata" : { - "format" : "disabled" - }, - "analyzer" : "standard" - } - }, - "ignore_above" : 2048 - }, - "author" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "authorized" : { - "type" : "boolean" - }, - "binary" : { - "type" : "boolean" - }, - "date" : { - "type" : "date", - "format" : "strict_date_optional_time||epoch_millis" - }, - "deprecated" : { - "type" : "boolean" - }, - "description" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "dir" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "directory" : { - "type" : "boolean" - }, - "dist_fav_count" : { - "type" : "integer" - }, - "distribution" : { - "type" : "string", - "index" : "not_analyzed", - "fields" : { - "analyzed" : { - "type" : "string", - "store" : true, - "fielddata" : { - "format" : "disabled" - }, - "analyzer" : "standard" - }, - "camelcase" : { - "type" : "string", - "store" : true, - "analyzer" : "camelcase" - }, - "lowercase" : { - "type" : "string", - "store" : true, - "analyzer" : "lowercase" - } - }, - "ignore_above" : 2048 - }, - "documentation" : { - "type" : "string", - "index" : "not_analyzed", - "fields" : { - "analyzed" : { - "type" : "string", - "store" : true, - "fielddata" : { - "format" : "disabled" - }, - "analyzer" : "standard" - }, - "camelcase" : { - "type" : "string", - "store" : true, - "analyzer" : "camelcase" - }, - "edge" : { - "type" : "string", - "store" : true, - "analyzer" : "edge" - }, - "edge_camelcase" : { - "type" : "string", - "store" : true, - "analyzer" : "edge_camelcase" - }, - "lowercase" : { - "type" : "string", - "store" : true, - "analyzer" : "lowercase" - } - }, - "ignore_above" : 2048 - }, - "documentation_length" : { - "type" : "integer" - }, - "download_url" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "id" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "indexed" : { - "type" : "boolean" - }, - "level" : { - "type" : "integer" - }, - "maturity" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "mime" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "module" : { - "type" : "nested", - "include_in_root" : true, - "dynamic" : "false", - "properties" : { - "associated_pod" : { - "type" : "string" - }, - "authorized" : { - "type" : "boolean" - }, - "indexed" : { - "type" : "boolean" - }, - "name" : { - "type" : "string", - "index" : "not_analyzed", - "fields" : { - "analyzed" : { - "type" : "string", - "store" : true, - "fielddata" : { - "format" : "disabled" - }, - "analyzer" : "standard" - }, - "camelcase" : { - "type" : "string", - "store" : true, - "analyzer" : "camelcase" - }, - "lowercase" : { - "type" : "string", - "store" : true, - "analyzer" : "lowercase" - } - }, - "ignore_above" : 2048 - }, - "version" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "version_numified" : { - "type" : "float" - } - } - }, - "name" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "path" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "pod" : { - "type" : "string", - "index" : "analyzed", - "analyzer" : "standard", - "doc_values" : false, - "fields" : { - "analyzed" : { - "type" : "string", - "index" : "analyzed", - "analyzer" : "standard", - "doc_values" : false - } - } - }, - "pod_lines" : { - "type" : "string", - "index" : "no", - "doc_values" : true, - "ignore_above" : 2048 - }, - "release" : { - "type" : "string", - "index" : "not_analyzed", - "fields" : { - "analyzed" : { - "type" : "string", - "store" : true, - "fielddata" : { - "format" : "disabled" - }, - "analyzer" : "standard" - }, - "camelcase" : { - "type" : "string", - "store" : true, - "analyzer" : "camelcase" - }, - "lowercase" : { - "type" : "string", - "store" : true, - "analyzer" : "lowercase" - } - }, - "ignore_above" : 2048 - }, - "sloc" : { - "type" : "integer" - }, - "slop" : { - "type" : "integer" - }, - "stat" : { - "dynamic" : "true", - "properties" : { - "gid" : { - "type" : "long" - }, - "mode" : { - "type" : "integer" - }, - "mtime" : { - "type" : "integer" - }, - "size" : { - "type" : "integer" - }, - "uid" : { - "type" : "long" - } - } - }, - "status" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "suggest" : { - "type" : "completion", - "analyzer" : "simple", - "preserve_separators" : true, - "preserve_position_increments" : true, - "max_input_length" : 50 - }, - "version" : { - "type" : "string", - "index" : "not_analyzed", - "ignore_above" : 2048 - }, - "version_numified" : { - "type" : "float" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/CPAN/Mirror.pm b/lib/MetaCPAN/Script/Mapping/CPAN/Mirror.pm deleted file mode 100644 index afff8d2df..000000000 --- a/lib/MetaCPAN/Script/Mapping/CPAN/Mirror.pm +++ /dev/null @@ -1,175 +0,0 @@ -package MetaCPAN::Script::Mapping::CPAN::Mirror; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "A_or_CNAME" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "aka_name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "ccode" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "city" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "contact" : { - "dynamic" : false, - "properties" : { - "contact_site" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "contact_user" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }, - "continent" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "country" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "dnsrr" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "freq" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "ftp" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "http" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "inceptdate" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" - }, - "location" : { - "type" : "geo_point" - }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "note" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "org" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "region" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "reitredate" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" - }, - "rsync" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "src" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "tz" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/CPAN/Package.pm b/lib/MetaCPAN/Script/Mapping/CPAN/Package.pm deleted file mode 100644 index 2175771fd..000000000 --- a/lib/MetaCPAN/Script/Mapping/CPAN/Package.pm +++ /dev/null @@ -1,44 +0,0 @@ -package MetaCPAN::Script::Mapping::CPAN::Package; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "module_name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "distribution" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "dist_version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "author" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "file" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/CPAN/Permission.pm b/lib/MetaCPAN/Script/Mapping/CPAN/Permission.pm deleted file mode 100644 index 56cb4af3f..000000000 --- a/lib/MetaCPAN/Script/Mapping/CPAN/Permission.pm +++ /dev/null @@ -1,29 +0,0 @@ -package MetaCPAN::Script::Mapping::CPAN::Permission; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "module_name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "owner" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "co_maintainers" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/CPAN/Release.pm b/lib/MetaCPAN/Script/Mapping/CPAN/Release.pm deleted file mode 100644 index 95b0440f9..000000000 --- a/lib/MetaCPAN/Script/Mapping/CPAN/Release.pm +++ /dev/null @@ -1,280 +0,0 @@ -package MetaCPAN::Script::Mapping::CPAN::Release; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "abstract" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "archive" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "author" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "authorized" : { - "type" : "boolean" - }, - "changes_file" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "checksum_md5" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "checksum_sha256" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "date" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" - }, - "dependency" : { - "dynamic" : false, - "include_in_root" : true, - "properties" : { - "module" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "phase" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "relationship" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - }, - "type" : "nested" - }, - "deprecated" : { - "type" : "boolean" - }, - "distribution" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - }, - "camelcase" : { - "analyzer" : "camelcase", - "store" : true, - "type" : "string" - }, - "lowercase" : { - "analyzer" : "lowercase", - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "download_url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "first" : { - "type" : "boolean" - }, - "id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "license" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "main_module" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "maturity" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "name" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" - }, - "store" : true, - "type" : "string" - }, - "camelcase" : { - "analyzer" : "camelcase", - "store" : true, - "type" : "string" - }, - "lowercase" : { - "analyzer" : "lowercase", - "store" : true, - "type" : "string" - } - }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "provides" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "resources" : { - "dynamic" : true, - "include_in_root" : true, - "properties" : { - "bugtracker" : { - "dynamic" : true, - "include_in_root" : true, - "properties" : { - "mailto" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "web" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - }, - "type" : "nested" - }, - "homepage" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "license" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "repository" : { - "dynamic" : true, - "include_in_root" : true, - "properties" : { - "type" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "web" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - }, - "type" : "nested" - } - }, - "type" : "nested" - }, - "stat" : { - "dynamic" : true, - "properties" : { - "gid" : { - "type" : "long" - }, - "mode" : { - "type" : "integer" - }, - "mtime" : { - "type" : "integer" - }, - "size" : { - "type" : "integer" - }, - "uid" : { - "type" : "long" - } - } - }, - "status" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "tests" : { - "dynamic" : true, - "properties" : { - "fail" : { - "type" : "integer" - }, - "na" : { - "type" : "integer" - }, - "pass" : { - "type" : "integer" - }, - "unknown" : { - "type" : "integer" - } - } - }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "version_numified" : { - "type" : "float" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/CVE.pm b/lib/MetaCPAN/Script/Mapping/CVE.pm deleted file mode 100644 index 8450d33a5..000000000 --- a/lib/MetaCPAN/Script/Mapping/CVE.pm +++ /dev/null @@ -1,50 +0,0 @@ -package MetaCPAN::Script::Mapping::CVE; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "affected_versions" : { - "type" : "string" - }, - "cpansa_id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "cves" : { - "type" : "string" - }, - "description" : { - "type" : "string" - }, - "distribution" : { - "type" : "string", - "index" : "not_analyzed" - }, - "references" : { - "type" : "string" - }, - "releases" : { - "type" : "string", - "index" : "not_analyzed" - }, - "reported" : { - "type" : "date", - "format" : "strict_date_optional_time||epoch_millis" - }, - "severity" : { - "type" : "string" - }, - "versions" : { - "type" : "string", - "index" : "not_analyzed" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/Contributor.pm b/lib/MetaCPAN/Script/Mapping/Contributor.pm deleted file mode 100644 index a5df69c88..000000000 --- a/lib/MetaCPAN/Script/Mapping/Contributor.pm +++ /dev/null @@ -1,34 +0,0 @@ -package MetaCPAN::Script::Mapping::Contributor; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "release_author" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "release_name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "distribution" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "pauseid" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/Cover.pm b/lib/MetaCPAN/Script/Mapping/Cover.pm deleted file mode 100644 index 885a439f1..000000000 --- a/lib/MetaCPAN/Script/Mapping/Cover.pm +++ /dev/null @@ -1,49 +0,0 @@ -package MetaCPAN::Script::Mapping::Cover; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "distribution" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "release" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "criteria": { - "dynamic" : true, - "properties" : { - "branch" : { - "type" : "float" - }, - "condition" : { - "type" : "float" - }, - "statement" : { - "type" : "float" - }, - "subroutine" : { - "type" : "float" - }, - "total" : { - "type" : "float" - } - } - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/DeployStatement.pm b/lib/MetaCPAN/Script/Mapping/DeployStatement.pm deleted file mode 100644 index 334510ff9..000000000 --- a/lib/MetaCPAN/Script/Mapping/DeployStatement.pm +++ /dev/null @@ -1,67 +0,0 @@ -package MetaCPAN::Script::Mapping::DeployStatement; - -use strict; -use warnings; - -sub mapping { - '{ - "analysis" : { - "filter" : { - "edge" : { - "max_gram" : 20, - "type" : "edge_ngram", - "min_gram" : 1 - } - }, - "analyzer" : { - "lowercase" : { - "tokenizer" : "keyword", - "filter" : "lowercase" - }, - "fulltext" : { - "type" : "english" - }, - "edge_camelcase" : { - "filter" : [ - "lowercase", - "edge" - ], - "tokenizer" : "camelcase", - "type" : "custom" - }, - "edge" : { - "filter" : [ - "lowercase", - "edge" - ], - "tokenizer" : "standard", - "type" : "custom" - }, - "camelcase" : { - "filter" : [ - "lowercase", - "unique" - ], - "type" : "custom", - "tokenizer" : "camelcase" - } - }, - "tokenizer" : { - "camelcase" : { - "type" : "pattern", - "pattern" : "([^\\\\p{L}\\\\d]+)|(?<=\\\\D)(?=\\\\d)|(?<=\\\\d)(?=\\\\D)|(?<=[\\\\p{L}&&[^\\\\p{Lu}]])(?=\\\\p{Lu})|(?<=\\\\p{Lu})(?=\\\\p{Lu}[\\\\p{L}&&[^\\\\p{Lu}]])" - } - } - }, - "index" : { - "number_of_shards" : 1, - "mapper" : { - "dynamic" : false - }, - "refresh_interval" : "1s", - "number_of_replicas":1 - } - }' -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/User/Account.pm b/lib/MetaCPAN/Script/Mapping/User/Account.pm deleted file mode 100644 index a510213cd..000000000 --- a/lib/MetaCPAN/Script/Mapping/User/Account.pm +++ /dev/null @@ -1,61 +0,0 @@ -package MetaCPAN::Script::Mapping::User::Account; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : "false", - "properties" : { - "access_token" : { - "dynamic" : "true", - "properties" : { - "client" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "token" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }, - "code" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "identity" : { - "dynamic" : "false", - "properties" : { - "key" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }, - "looks_human" : { - "type" : "boolean" - }, - "passed_captcha" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/User/Identity.pm b/lib/MetaCPAN/Script/Mapping/User/Identity.pm deleted file mode 100644 index a8ebfff71..000000000 --- a/lib/MetaCPAN/Script/Mapping/User/Identity.pm +++ /dev/null @@ -1,24 +0,0 @@ -package MetaCPAN::Script::Mapping::User::Identity; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : false, - "properties" : { - "key" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - } - } - }'; -} - -1; diff --git a/lib/MetaCPAN/Script/Mapping/User/Session.pm b/lib/MetaCPAN/Script/Mapping/User/Session.pm deleted file mode 100644 index 3dc8e078f..000000000 --- a/lib/MetaCPAN/Script/Mapping/User/Session.pm +++ /dev/null @@ -1,12 +0,0 @@ -package MetaCPAN::Script::Mapping::User::Session; - -use strict; -use warnings; - -sub mapping { - '{ - "dynamic" : "false" - }'; -} - -1; diff --git a/t/lib/MetaCPAN/TestServer.pm b/t/lib/MetaCPAN/TestServer.pm index 669fa638d..088786b8f 100644 --- a/t/lib/MetaCPAN/TestServer.pm +++ b/t/lib/MetaCPAN/TestServer.pm @@ -11,7 +11,6 @@ use MetaCPAN::Script::Favorite (); use MetaCPAN::Script::First (); use MetaCPAN::Script::Latest (); use MetaCPAN::Script::Mapping (); -use MetaCPAN::Script::Mapping::Cover (); use MetaCPAN::Script::Mirrors (); use MetaCPAN::Script::Package (); use MetaCPAN::Script::Permission (); diff --git a/t/script/load.t b/t/script/load.t index 65754fca4..546510bd4 100644 --- a/t/script/load.t +++ b/t/script/load.t @@ -5,42 +5,28 @@ use lib 't/lib'; use Test::More; ## no perlimports -use MetaCPAN::Script::Author (); -use MetaCPAN::Script::Backpan (); -use MetaCPAN::Script::Backup (); -use MetaCPAN::Script::Check (); -use MetaCPAN::Script::Checksum (); -use MetaCPAN::Script::Contributor (); -use MetaCPAN::Script::Cover (); -use MetaCPAN::Script::CPANTesters (); -use MetaCPAN::Script::CPANTestersAPI (); -use MetaCPAN::Script::External (); -use MetaCPAN::Script::Favorite (); -use MetaCPAN::Script::First (); -use MetaCPAN::Script::Latest (); -use MetaCPAN::Script::Mapping (); -use MetaCPAN::Script::Mapping::Contributor (); -use MetaCPAN::Script::Mapping::Cover (); -use MetaCPAN::Script::Mapping::CPAN::Author (); -use MetaCPAN::Script::Mapping::CPAN::Distribution (); -use MetaCPAN::Script::Mapping::CPAN::Favorite (); -use MetaCPAN::Script::Mapping::CPAN::File (); -use MetaCPAN::Script::Mapping::CPAN::Mirror (); -use MetaCPAN::Script::Mapping::CPAN::Package (); -use MetaCPAN::Script::Mapping::CPAN::Permission (); -use MetaCPAN::Script::Mapping::CPAN::Release (); -use MetaCPAN::Script::Mapping::DeployStatement (); -use MetaCPAN::Script::Mapping::User::Account (); -use MetaCPAN::Script::Mapping::User::Identity (); -use MetaCPAN::Script::Mapping::User::Session (); -use MetaCPAN::Script::Mirrors (); -use MetaCPAN::Script::Package (); -use MetaCPAN::Script::Permission (); -use MetaCPAN::Script::Purge (); -use MetaCPAN::Script::Queue (); -use MetaCPAN::Script::Release (); -use MetaCPAN::Script::Restart (); -use MetaCPAN::Script::River (); +use MetaCPAN::Script::Author (); +use MetaCPAN::Script::Backpan (); +use MetaCPAN::Script::Backup (); +use MetaCPAN::Script::Check (); +use MetaCPAN::Script::Checksum (); +use MetaCPAN::Script::Contributor (); +use MetaCPAN::Script::Cover (); +use MetaCPAN::Script::CPANTesters (); +use MetaCPAN::Script::CPANTestersAPI (); +use MetaCPAN::Script::External (); +use MetaCPAN::Script::Favorite (); +use MetaCPAN::Script::First (); +use MetaCPAN::Script::Latest (); +use MetaCPAN::Script::Mapping (); +use MetaCPAN::Script::Mirrors (); +use MetaCPAN::Script::Package (); +use MetaCPAN::Script::Permission (); +use MetaCPAN::Script::Purge (); +use MetaCPAN::Script::Queue (); +use MetaCPAN::Script::Release (); +use MetaCPAN::Script::Restart (); +use MetaCPAN::Script::River (); require MetaCPAN::Script::Role::Contributor; require MetaCPAN::Script::Role::External::Cygwin; require MetaCPAN::Script::Role::External::Debian; From 146843fb0f436ac47963ebd113c88b8c50cc9968 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 29 Oct 2024 18:17:52 +0100 Subject: [PATCH 2/7] clean up mappings Reformat to match output of jq -S --indent 4. Clean up quoting of booleans and numbers. Improve structure of settings. --- es/account/mapping.json | 74 +++--- es/author/mapping.json | 250 ++++++++++---------- es/contributor/mapping.json | 36 +-- es/cover/mapping.json | 54 ++--- es/cve/mapping.json | 56 ++--- es/distribution/mapping.json | 159 ++++++------- es/favorite/mapping.json | 50 ++-- es/file/mapping.json | 436 +++++++++++++++++------------------ es/identity/mapping.json | 20 +- es/mirror/mapping.json | 286 +++++++++++------------ es/package/mapping.json | 52 ++--- es/permission/mapping.json | 28 +-- es/release/mapping.json | 404 ++++++++++++++++---------------- es/session/mapping.json | 2 +- es/settings.json | 70 +++--- 15 files changed, 990 insertions(+), 987 deletions(-) diff --git a/es/account/mapping.json b/es/account/mapping.json index ee6363bc5..5ddf17753 100644 --- a/es/account/mapping.json +++ b/es/account/mapping.json @@ -1,52 +1,52 @@ { - "dynamic" : "false", - "properties" : { - "access_token" : { - "dynamic" : "true", - "properties" : { - "client" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "dynamic": false, + "properties": { + "access_token": { + "dynamic": true, + "properties": { + "client": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "token" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "token": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } }, - "code" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "code": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "id": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "identity" : { - "dynamic" : "false", - "properties" : { - "key" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "identity": { + "dynamic": false, + "properties": { + "key": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } }, - "looks_human" : { - "type" : "boolean" + "looks_human": { + "type": "boolean" }, - "passed_captcha" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" + "passed_captcha": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" } } } diff --git a/es/author/mapping.json b/es/author/mapping.json index cc1e827ff..ad9278a7f 100644 --- a/es/author/mapping.json +++ b/es/author/mapping.json @@ -1,157 +1,157 @@ { - "dynamic" : false, - "properties" : { - "asciiname" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "dynamic": false, + "properties": { + "asciiname": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "blog" : { - "dynamic" : true, - "properties" : { - "feed" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "blog": { + "dynamic": true, + "properties": { + "feed": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "url": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } }, - "city" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "country" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "donation" : { - "dynamic" : true, - "properties" : { - "id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "city": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "country": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "donation": { + "dynamic": true, + "properties": { + "id": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } }, - "email" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "email": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "gravatar_url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "gravatar_url": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "is_pause_custodial_account" : { - "type" : "boolean" + "is_pause_custodial_account": { + "type": "boolean" }, - "location" : { - "type" : "geo_point" + "location": { + "type": "geo_point" }, - "name" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "name": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "pauseid" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "perlmongers" : { - "dynamic" : true, - "properties" : { - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "pauseid": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "perlmongers": { + "dynamic": true, + "properties": { + "name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "url": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } }, - "profile" : { - "dynamic" : false, - "include_in_root" : true, - "properties" : { - "id" : { - "fields" : { - "analyzed" : { - "analyzer" : "simple", - "fielddata" : { - "format" : "disabled" + "profile": { + "dynamic": false, + "include_in_root": true, + "properties": { + "id": { + "fields": { + "analyzed": { + "analyzer": "simple", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } }, - "type" : "nested" - }, - "region" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "updated" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" - }, - "user" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "website" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "type": "nested" + }, + "region": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "updated": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "user": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "website": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } } diff --git a/es/contributor/mapping.json b/es/contributor/mapping.json index 2638be3da..605c8f923 100644 --- a/es/contributor/mapping.json +++ b/es/contributor/mapping.json @@ -1,25 +1,25 @@ { - "dynamic" : false, - "properties" : { - "distribution" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "dynamic": false, + "properties": { + "distribution": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "pauseid" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "pauseid": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "release_author" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "release_author": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "release_name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "release_name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } } diff --git a/es/cover/mapping.json b/es/cover/mapping.json index 7d3dbc48e..e0a6a6114 100644 --- a/es/cover/mapping.json +++ b/es/cover/mapping.json @@ -1,40 +1,40 @@ { - "dynamic" : false, - "properties" : { - "criteria" : { - "dynamic" : true, - "properties" : { - "branch" : { - "type" : "float" + "dynamic": false, + "properties": { + "criteria": { + "dynamic": true, + "properties": { + "branch": { + "type": "float" }, - "condition" : { - "type" : "float" + "condition": { + "type": "float" }, - "statement" : { - "type" : "float" + "statement": { + "type": "float" }, - "subroutine" : { - "type" : "float" + "subroutine": { + "type": "float" }, - "total" : { - "type" : "float" + "total": { + "type": "float" } } }, - "distribution" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "distribution": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "release" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "release": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "version": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } } diff --git a/es/cve/mapping.json b/es/cve/mapping.json index e594d88c6..4f3492037 100644 --- a/es/cve/mapping.json +++ b/es/cve/mapping.json @@ -1,41 +1,41 @@ { - "dynamic" : false, - "properties" : { - "affected_versions" : { - "type" : "string" + "dynamic": false, + "properties": { + "affected_versions": { + "type": "string" }, - "cpansa_id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "cpansa_id": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "cves" : { - "type" : "string" + "cves": { + "type": "string" }, - "description" : { - "type" : "string" + "description": { + "type": "string" }, - "distribution" : { - "index" : "not_analyzed", - "type" : "string" + "distribution": { + "index": "not_analyzed", + "type": "string" }, - "references" : { - "type" : "string" + "references": { + "type": "string" }, - "releases" : { - "index" : "not_analyzed", - "type" : "string" + "releases": { + "index": "not_analyzed", + "type": "string" }, - "reported" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" + "reported": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" }, - "severity" : { - "type" : "string" + "severity": { + "type": "string" }, - "versions" : { - "index" : "not_analyzed", - "type" : "string" + "versions": { + "index": "not_analyzed", + "type": "string" } } } diff --git a/es/distribution/mapping.json b/es/distribution/mapping.json index 79f861695..333927a24 100644 --- a/es/distribution/mapping.json +++ b/es/distribution/mapping.json @@ -1,114 +1,119 @@ { - "dynamic" : false, - "properties" : { - "bugs" : { - "dynamic" : true, - "properties" : { - "github" : { - "dynamic" : true, - "properties" : { - "active" : { - "type" : "integer" + "dynamic": false, + "properties": { + "bugs": { + "dynamic": true, + "properties": { + "github": { + "dynamic": true, + "properties": { + "active": { + "type": "integer" }, - "closed" : { - "type" : "integer" + "closed": { + "type": "integer" }, - "open" : { - "type" : "integer" + "open": { + "type": "integer" }, - "source" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "source": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } }, - "rt" : { - "dynamic" : true, - "properties" : { - "active" : { - "type" : "integer" + "rt": { + "dynamic": true, + "properties": { + "active": { + "type": "integer" }, - "closed" : { - "type" : "integer" + "closed": { + "type": "integer" }, - "new" : { - "type" : "integer" + "new": { + "type": "integer" }, - "open" : { - "type" : "integer" + "open": { + "type": "integer" }, - "patched" : { - "type" : "integer" + "patched": { + "type": "integer" }, - "rejected" : { - "type" : "integer" + "rejected": { + "type": "integer" }, - "resolved" : { - "type" : "integer" + "resolved": { + "type": "integer" }, - "source" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "source": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "stalled" : { - "type" : "integer" + "stalled": { + "type": "integer" } } } } }, - "external_package" : { - "dynamic" : true, - "properties" : { - "cygwin" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "external_package": { + "dynamic": true, + "properties": { + "cygwin": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "debian" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "debian": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "fedora": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "repo" : { - "dynamic" : true, - "properties" : { - "github" : { - "dynamic" : true, - "properties" : { - "stars" : { - "type" : "integer" + "repo": { + "dynamic": true, + "properties": { + "github": { + "dynamic": true, + "properties": { + "stars": { + "type": "integer" }, - "watchers" : { - "type" : "integer" + "watchers": { + "type": "integer" } } } } }, - "river" : { - "dynamic" : true, - "properties" : { - "bucket" : { - "type" : "integer" + "river": { + "dynamic": true, + "properties": { + "bucket": { + "type": "integer" }, - "bus_factor" : { - "type" : "integer" + "bus_factor": { + "type": "integer" }, - "immediate" : { - "type" : "integer" + "immediate": { + "type": "integer" }, - "total" : { - "type" : "integer" + "total": { + "type": "integer" } } } diff --git a/es/favorite/mapping.json b/es/favorite/mapping.json index e431e21bf..aeff5b2cb 100644 --- a/es/favorite/mapping.json +++ b/es/favorite/mapping.json @@ -1,34 +1,34 @@ { - "dynamic" : false, - "properties" : { - "author" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "dynamic": false, + "properties": { + "author": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "date" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" + "date": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" }, - "distribution" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "distribution": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "id": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "release" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "release": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "user" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "user": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } } diff --git a/es/file/mapping.json b/es/file/mapping.json index 8fd08bddd..5374d9f41 100644 --- a/es/file/mapping.json +++ b/es/file/mapping.json @@ -1,293 +1,293 @@ { - "dynamic" : "false", - "properties" : { - "abstract" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "dynamic": false, + "properties": { + "abstract": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "author" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "author": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "authorized" : { - "type" : "boolean" + "authorized": { + "type": "boolean" }, - "binary" : { - "type" : "boolean" + "binary": { + "type": "boolean" }, - "date" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" + "date": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" }, - "deprecated" : { - "type" : "boolean" + "deprecated": { + "type": "boolean" }, - "description" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "description": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "dir" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "dir": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "directory" : { - "type" : "boolean" + "directory": { + "type": "boolean" }, - "dist_fav_count" : { - "type" : "integer" + "dist_fav_count": { + "type": "integer" }, - "distribution" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "distribution": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" }, - "camelcase" : { - "analyzer" : "camelcase", - "store" : true, - "type" : "string" + "camelcase": { + "analyzer": "camelcase", + "store": true, + "type": "string" }, - "lowercase" : { - "analyzer" : "lowercase", - "store" : true, - "type" : "string" + "lowercase": { + "analyzer": "lowercase", + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "documentation" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "documentation": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" }, - "camelcase" : { - "analyzer" : "camelcase", - "store" : true, - "type" : "string" + "camelcase": { + "analyzer": "camelcase", + "store": true, + "type": "string" }, - "edge" : { - "analyzer" : "edge", - "store" : true, - "type" : "string" + "edge": { + "analyzer": "edge", + "store": true, + "type": "string" }, - "edge_camelcase" : { - "analyzer" : "edge_camelcase", - "store" : true, - "type" : "string" + "edge_camelcase": { + "analyzer": "edge_camelcase", + "store": true, + "type": "string" }, - "lowercase" : { - "analyzer" : "lowercase", - "store" : true, - "type" : "string" + "lowercase": { + "analyzer": "lowercase", + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "documentation_length" : { - "type" : "integer" + "documentation_length": { + "type": "integer" }, - "download_url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "download_url": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "id": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "indexed" : { - "type" : "boolean" + "indexed": { + "type": "boolean" }, - "level" : { - "type" : "integer" + "level": { + "type": "integer" }, - "maturity" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "maturity": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "mime" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "mime": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "module" : { - "dynamic" : "false", - "include_in_root" : true, - "properties" : { - "associated_pod" : { - "type" : "string" + "module": { + "dynamic": false, + "include_in_root": true, + "properties": { + "associated_pod": { + "type": "string" }, - "authorized" : { - "type" : "boolean" + "authorized": { + "type": "boolean" }, - "indexed" : { - "type" : "boolean" + "indexed": { + "type": "boolean" }, - "name" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "name": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" }, - "camelcase" : { - "analyzer" : "camelcase", - "store" : true, - "type" : "string" + "camelcase": { + "analyzer": "camelcase", + "store": true, + "type": "string" }, - "lowercase" : { - "analyzer" : "lowercase", - "store" : true, - "type" : "string" + "lowercase": { + "analyzer": "lowercase", + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "version": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "version_numified" : { - "type" : "float" + "version_numified": { + "type": "float" } }, - "type" : "nested" + "type": "nested" }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "path" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "path": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "pod" : { - "analyzer" : "standard", - "doc_values" : false, - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "doc_values" : false, - "index" : "analyzed", - "type" : "string" + "pod": { + "analyzer": "standard", + "doc_values": false, + "fields": { + "analyzed": { + "analyzer": "standard", + "doc_values": false, + "index": "analyzed", + "type": "string" } }, - "index" : "analyzed", - "type" : "string" + "index": "analyzed", + "type": "string" }, - "pod_lines" : { - "doc_values" : true, - "ignore_above" : 2048, - "index" : "no", - "type" : "string" + "pod_lines": { + "doc_values": true, + "ignore_above": 2048, + "index": "no", + "type": "string" }, - "release" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "release": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" }, - "camelcase" : { - "analyzer" : "camelcase", - "store" : true, - "type" : "string" + "camelcase": { + "analyzer": "camelcase", + "store": true, + "type": "string" }, - "lowercase" : { - "analyzer" : "lowercase", - "store" : true, - "type" : "string" + "lowercase": { + "analyzer": "lowercase", + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "sloc" : { - "type" : "integer" + "sloc": { + "type": "integer" }, - "slop" : { - "type" : "integer" + "slop": { + "type": "integer" }, - "stat" : { - "dynamic" : "true", - "properties" : { - "gid" : { - "type" : "long" + "stat": { + "dynamic": true, + "properties": { + "gid": { + "type": "long" }, - "mode" : { - "type" : "integer" + "mode": { + "type": "integer" }, - "mtime" : { - "type" : "integer" + "mtime": { + "type": "integer" }, - "size" : { - "type" : "integer" + "size": { + "type": "integer" }, - "uid" : { - "type" : "long" + "uid": { + "type": "long" } } }, - "status" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "status": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "suggest" : { - "analyzer" : "simple", - "max_input_length" : 50, - "preserve_position_increments" : true, - "preserve_separators" : true, - "type" : "completion" + "suggest": { + "analyzer": "simple", + "max_input_length": 50, + "preserve_position_increments": true, + "preserve_separators": true, + "type": "completion" }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "version": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "version_numified" : { - "type" : "float" + "version_numified": { + "type": "float" } } } diff --git a/es/identity/mapping.json b/es/identity/mapping.json index 5d2b7d5e9..340886289 100644 --- a/es/identity/mapping.json +++ b/es/identity/mapping.json @@ -1,15 +1,15 @@ { - "dynamic" : false, - "properties" : { - "key" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "dynamic": false, + "properties": { + "key": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } } diff --git a/es/mirror/mapping.json b/es/mirror/mapping.json index 884f18ac6..09f2d85e1 100644 --- a/es/mirror/mapping.json +++ b/es/mirror/mapping.json @@ -1,166 +1,166 @@ { - "dynamic" : false, - "properties" : { - "A_or_CNAME" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "aka_name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "ccode" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "city" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "dynamic": false, + "properties": { + "A_or_CNAME": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "aka_name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "ccode": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "city": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "contact" : { - "dynamic" : false, - "properties" : { - "contact_site" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "contact": { + "dynamic": false, + "properties": { + "contact_site": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "contact_user" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "contact_user": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } }, - "continent" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "continent": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "country" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "country": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "dnsrr" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "freq" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "ftp" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "http" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "inceptdate" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" - }, - "location" : { - "type" : "geo_point" - }, - "name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "note" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "org" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "dnsrr": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "freq": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "ftp": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "http": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "inceptdate": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "note": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "org": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "region" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "region": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "reitredate" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" - }, - "rsync" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "src" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" - }, - "tz" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "reitredate": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" + }, + "rsync": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "src": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" + }, + "tz": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } } diff --git a/es/package/mapping.json b/es/package/mapping.json index 79b6e2b2d..82dacee1e 100644 --- a/es/package/mapping.json +++ b/es/package/mapping.json @@ -1,35 +1,35 @@ { - "dynamic" : false, - "properties" : { - "author" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "dynamic": false, + "properties": { + "author": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "dist_version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "dist_version": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "distribution" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "distribution": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "file" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "file": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "module_name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "module_name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "version": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } } diff --git a/es/permission/mapping.json b/es/permission/mapping.json index c03b227c0..688f56bcd 100644 --- a/es/permission/mapping.json +++ b/es/permission/mapping.json @@ -1,20 +1,20 @@ { - "dynamic" : false, - "properties" : { - "co_maintainers" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "dynamic": false, + "properties": { + "co_maintainers": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "module_name" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "module_name": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "owner" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "owner": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } } } diff --git a/es/release/mapping.json b/es/release/mapping.json index 5555d1721..fb75ac875 100644 --- a/es/release/mapping.json +++ b/es/release/mapping.json @@ -1,271 +1,271 @@ { - "dynamic" : false, - "properties" : { - "abstract" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "dynamic": false, + "properties": { + "abstract": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "archive" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "archive": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "author" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "author": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "authorized" : { - "type" : "boolean" + "authorized": { + "type": "boolean" }, - "changes_file" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "changes_file": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "checksum_md5" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "checksum_md5": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "checksum_sha256" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "checksum_sha256": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "date" : { - "format" : "strict_date_optional_time||epoch_millis", - "type" : "date" + "date": { + "format": "strict_date_optional_time||epoch_millis", + "type": "date" }, - "dependency" : { - "dynamic" : false, - "include_in_root" : true, - "properties" : { - "module" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "dependency": { + "dynamic": false, + "include_in_root": true, + "properties": { + "module": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "phase" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "phase": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "relationship" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "relationship": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "version": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } }, - "type" : "nested" + "type": "nested" }, - "deprecated" : { - "type" : "boolean" + "deprecated": { + "type": "boolean" }, - "distribution" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "distribution": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" }, - "camelcase" : { - "analyzer" : "camelcase", - "store" : true, - "type" : "string" + "camelcase": { + "analyzer": "camelcase", + "store": true, + "type": "string" }, - "lowercase" : { - "analyzer" : "lowercase", - "store" : true, - "type" : "string" + "lowercase": { + "analyzer": "lowercase", + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "download_url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "download_url": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "first" : { - "type" : "boolean" + "first": { + "type": "boolean" }, - "id" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "id": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "license" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "license": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "main_module" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "main_module": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "maturity" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "maturity": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "name" : { - "fields" : { - "analyzed" : { - "analyzer" : "standard", - "fielddata" : { - "format" : "disabled" + "name": { + "fields": { + "analyzed": { + "analyzer": "standard", + "fielddata": { + "format": "disabled" }, - "store" : true, - "type" : "string" + "store": true, + "type": "string" }, - "camelcase" : { - "analyzer" : "camelcase", - "store" : true, - "type" : "string" + "camelcase": { + "analyzer": "camelcase", + "store": true, + "type": "string" }, - "lowercase" : { - "analyzer" : "lowercase", - "store" : true, - "type" : "string" + "lowercase": { + "analyzer": "lowercase", + "store": true, + "type": "string" } }, - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "provides" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "provides": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "resources" : { - "dynamic" : true, - "include_in_root" : true, - "properties" : { - "bugtracker" : { - "dynamic" : true, - "include_in_root" : true, - "properties" : { - "mailto" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "resources": { + "dynamic": true, + "include_in_root": true, + "properties": { + "bugtracker": { + "dynamic": "true", + "include_in_root": true, + "properties": { + "mailto": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "web" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "web": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } }, - "type" : "nested" + "type": "nested" }, - "homepage" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "homepage": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "license" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "license": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "repository" : { - "dynamic" : true, - "include_in_root" : true, - "properties" : { - "type" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "repository": { + "dynamic": "true", + "include_in_root": true, + "properties": { + "type": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "url" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "url": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "web" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "web": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" } }, - "type" : "nested" + "type": "nested" } }, - "type" : "nested" + "type": "nested" }, - "stat" : { - "dynamic" : true, - "properties" : { - "gid" : { - "type" : "long" + "stat": { + "dynamic": true, + "properties": { + "gid": { + "type": "long" }, - "mode" : { - "type" : "integer" + "mode": { + "type": "integer" }, - "mtime" : { - "type" : "integer" + "mtime": { + "type": "integer" }, - "size" : { - "type" : "integer" + "size": { + "type": "integer" }, - "uid" : { - "type" : "long" + "uid": { + "type": "long" } } }, - "status" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "status": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "tests" : { - "dynamic" : true, - "properties" : { - "fail" : { - "type" : "integer" + "tests": { + "dynamic": true, + "properties": { + "fail": { + "type": "integer" }, - "na" : { - "type" : "integer" + "na": { + "type": "integer" }, - "pass" : { - "type" : "integer" + "pass": { + "type": "integer" }, - "unknown" : { - "type" : "integer" + "unknown": { + "type": "integer" } } }, - "version" : { - "ignore_above" : 2048, - "index" : "not_analyzed", - "type" : "string" + "version": { + "ignore_above": 2048, + "index": "not_analyzed", + "type": "string" }, - "version_numified" : { - "type" : "float" + "version_numified": { + "type": "float" } } } diff --git a/es/session/mapping.json b/es/session/mapping.json index cd84e1123..d4f130c22 100644 --- a/es/session/mapping.json +++ b/es/session/mapping.json @@ -1,3 +1,3 @@ { - "dynamic" : "false" + "dynamic": false } diff --git a/es/settings.json b/es/settings.json index 3ac1848e7..1d4845446 100644 --- a/es/settings.json +++ b/es/settings.json @@ -1,58 +1,56 @@ { - "analysis" : { - "analyzer" : { - "camelcase" : { - "filter" : [ + "analysis": { + "analyzer": { + "camelcase": { + "filter": [ "lowercase", "unique" ], - "tokenizer" : "camelcase", - "type" : "custom" + "tokenizer": "camelcase", + "type": "custom" }, - "edge" : { - "filter" : [ + "edge": { + "filter": [ "lowercase", "edge" ], - "tokenizer" : "standard", - "type" : "custom" + "tokenizer": "standard", + "type": "custom" }, - "edge_camelcase" : { - "filter" : [ + "edge_camelcase": { + "filter": [ "lowercase", "edge" ], - "tokenizer" : "camelcase", - "type" : "custom" + "tokenizer": "camelcase", + "type": "custom" }, - "fulltext" : { - "type" : "english" + "fulltext": { + "type": "english" }, - "lowercase" : { - "filter" : "lowercase", - "tokenizer" : "keyword" + "lowercase": { + "filter": "lowercase", + "tokenizer": "keyword" } }, - "filter" : { - "edge" : { - "max_gram" : 20, - "min_gram" : 1, - "type" : "edge_ngram" + "filter": { + "edge": { + "max_gram": "20", + "min_gram": "1", + "type": "edge_ngram" } }, - "tokenizer" : { - "camelcase" : { - "pattern" : "([^\\p{L}\\d]+)|(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)|(?<=[\\p{L}&&[^\\p{Lu}]])(?=\\p{Lu})|(?<=\\p{Lu})(?=\\p{Lu}[\\p{L}&&[^\\p{Lu}]])", - "type" : "pattern" + "tokenizer": { + "camelcase": { + "pattern": "([^\\p{L}\\d]+)|(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)|(?<=[\\p{L}&&[^\\p{Lu}]])(?=\\p{Lu})|(?<=\\p{Lu})(?=\\p{Lu}[\\p{L}&&[^\\p{Lu}]])", + "type": "pattern" } } }, - "index" : { - "mapper" : { - "dynamic" : false - }, - "number_of_replicas" : 1, - "number_of_shards" : 1, - "refresh_interval" : "1s" - } + "mapper": { + "dynamic": "false" + }, + "number_of_replicas": 1, + "number_of_shards": 1, + "refresh_interval": "1s" } From c75cf2421ea72f7836dcd694902e3dccbd82bb9e Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 29 Oct 2024 18:39:59 +0100 Subject: [PATCH 3/7] move code out of script role that is used in one script Many parts of the Script role were only used by the mapping script or the purge script. Move them to the scripts themselves. --- lib/MetaCPAN/Role/Script.pm | 208 --------------------------------- lib/MetaCPAN/Script/Mapping.pm | 190 +++++++++++++++++++++++++++++- lib/MetaCPAN/Script/Purge.pm | 16 +++ 3 files changed, 205 insertions(+), 209 deletions(-) diff --git a/lib/MetaCPAN/Role/Script.pm b/lib/MetaCPAN/Role/Script.pm index cd6c46053..7d604f4bb 100644 --- a/lib/MetaCPAN/Role/Script.pm +++ b/lib/MetaCPAN/Role/Script.pm @@ -4,7 +4,6 @@ use Moose::Role; use Carp (); use MooseX::Types::ElasticSearch qw( ES ); -use File::Path (); use IO::Prompt::Tiny qw( prompt ); use Log::Contextual qw( :log :dlog ); use MetaCPAN::Model (); @@ -48,15 +47,6 @@ has exit_code => ( documentation => 'Exit Code to be returned on termination', ); -has arg_await_timeout => ( - init_arg => 'await', - is => 'ro', - isa => Int, - default => 15, - documentation => - 'seconds before connection is considered failed with timeout', -); - has ua => ( is => 'ro', lazy => 1, @@ -86,29 +76,6 @@ has model => ( traits => ['NoGetopt'], ); -has cluster_info => ( - isa => HashRef, - traits => ['Hash'], - is => 'rw', - lazy => 1, - default => sub { {} }, -); - -has indices_info => ( - isa => HashRef, - traits => ['Hash'], - is => 'rw', - lazy => 1, - default => sub { {} }, -); - -has aliases_info => ( - isa => HashRef, - traits => ['Hash'], - is => 'rw', - default => sub { {} }, -); - has port => ( isa => Int, is => 'ro', @@ -126,13 +93,6 @@ has home => ( default => sub { root_dir() }, ); -has quarantine => ( - is => 'ro', - isa => Str, - lazy => 1, - builder => '_build_quarantine', -); - has _minion => ( is => 'ro', isa => 'Minion', @@ -223,140 +183,12 @@ sub _build_cpan_file_map { return $cpan; } -sub _build_quarantine { - my $path = "$ENV{HOME}/QUARANTINE"; - if ( !-d $path ) { - File::Path::mkpath($path); - } - return $path; -} - -sub remote { - shift->es->nodes->info->[0]; -} - sub run { } before run => sub { my $self = shift; $self->set_logger_once; }; -sub _get_indices_info { - my ( $self, $irefresh ) = @_; - - if ( $irefresh || scalar( keys %{ $self->indices_info } ) == 0 ) { - my $sinfo_rs = $self->es->cat->indices( h => [ 'index', 'health' ] ); - my $sindices_parsing = qr/^([^[:space:]]+) +([^[:space:]]+)/m; - - $self->indices_info( {} ); - - while ( $sinfo_rs =~ /$sindices_parsing/g ) { - $self->indices_info->{$1} - = { 'index_name' => $1, 'health' => $2 }; - } - } -} - -sub _get_aliases_info { - my ( $self, $irefresh ) = @_; - - if ( $irefresh || scalar( keys %{ $self->aliases_info } ) == 0 ) { - my $sinfo_rs = $self->es->cat->aliases( h => [ 'alias', 'index' ] ); - my $saliases_parsing = qr/^([^[:space:]]+) +([^[:space:]]+)/m; - - $self->aliases_info( {} ); - - while ( $sinfo_rs =~ /$saliases_parsing/g ) { - $self->aliases_info->{$1} = { 'alias_name' => $1, 'index' => $2 }; - } - } -} - -sub check_health { - my ( $self, $irefresh ) = @_; - my $ihealth = 0; - - $irefresh = 0 unless ( defined $irefresh ); - - $ihealth = $self->await; - - if ($ihealth) { - $self->_get_indices_info($irefresh); - - foreach ( keys %{ $self->indices_info } ) { - $ihealth = 0 - if ( $self->indices_info->{$_}->{'health'} eq 'red' ); - } - } - - if ($ihealth) { - $self->_get_aliases_info($irefresh); - - $ihealth = 0 if ( scalar( keys %{ $self->aliases_info } ) == 0 ); - } - - return $ihealth; -} - -sub await { - my $self = $_[0]; - my $iready = 0; - - if ( scalar( keys %{ $self->cluster_info } ) == 0 ) { - my $es = $self->es; - my $iseconds = 0; - - log_info {"Awaiting Elasticsearch ..."}; - - do { - eval { - $iready = $es->ping; - - if ($iready) { - log_info { - "Awaiting $iseconds / " - . $self->arg_await_timeout - . " : ready" - }; - - $self->cluster_info( \%{ $es->info } ); - } - }; - - if ($@) { - if ( $iseconds < $self->arg_await_timeout ) { - log_info { - "Awaiting $iseconds / " - . $self->arg_await_timeout - . " : unavailable - sleeping ..." - }; - - sleep(1); - - $iseconds++; - } - else { - log_error { - "Awaiting $iseconds / " - . $self->arg_await_timeout - . " : unavailable - timeout!" - }; - - #Set System Error: 112 - EHOSTDOWN - Host is down - $self->exit_code(112); - $self->handle_error( $@, 1 ); - } - } - } while ( !$iready && $iseconds <= $self->arg_await_timeout ); - } - else { - #ElasticSearch Service is available - $iready = 1; - } - - return $iready; -} - sub are_you_sure { my ( $self, $msg ) = @_; my $iconfirmed = 0; @@ -437,46 +269,6 @@ This Role provides the following methods =over 4 -=item C - -This method uses the -L|https://metacpan.org/pod/Search::Elasticsearch::Client::2_0::Direct#ping()> -method to verify the service availabilty and wait for C seconds. -When the service does not become available within C seconds it re-throws the -Exception from the C and sets B to C< 112 >. -The C generates a C<"Search::Elasticsearch::Error::NoNodes"> Exception. -When the service is available it will populate the C C structure with the basic information -about the cluster. - -B It will throw an exceptions when the I service does not become available -within C seconds (as described above). - -See L