Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F34634020
extract elastic index settings for relforge
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Cparle
Sep 6 2021, 10:15 AM
2021-09-06 10:15:54 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
extract elastic index settings for relforge
View Options
#!/bin/bash
curl -s https://search.svc.eqiad.wmnet:9243/index_to_copy
|
jq
'
def walk(f):
. as $in
| if type == "object" then
reduce keys[] as $key
( {}; . + { ($key): ($in[$key] | walk(f)) } ) | f
elif type == "array" then map( walk(f) ) | f
else f
end;
{
settings: (.[].settings |
.index.number_of_replicas = "0" |
.index.auto_expand_replicas = "0-0" |
.index.routing.allocation.total_shards_per_node = "-1" |
delpaths([
["index", "creation_date"],
["index", "uuid"],
["index", "version", "created"],
["index", "version", "upgraded"],
["index", "provided_name"]
])
),
mappings: (.[].mappings |
delpaths([
["page", "properties", "coordinates", "properties", "coord", "lat_lon"]
]) |
# 2.x -> 5.x migration
walk(
if (type == "object") and (.type == "string") then
.type = "text"
else
.
end
) |
walk(
if (type == "object") and (.ignore_above) then
del(.ignore_above)
else
.
end
)
)
}'
> index_settings.json
curl -s -XPUT https://relforge1003.eqiad.wmnet:9243/index_in_relforge -d @index_settings.json
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9175725
Default Alt Text
extract elastic index settings for relforge (1 KB)
Attached To
Mode
P16419 extract elastic index settings for relforge
Attached
Detach File
Event Timeline
Log In to Comment