Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
utilities
Import Process CLI
Commits
9918cfda
Commit
9918cfda
authored
Jul 29, 2021
by
Jonas Waeber
Browse files
move query util script to folder
parent
8bdfcac3
Changes
3
Hide whitespace changes
Inline
Side-by-side
utilities/elastic_scripts/query.json
deleted
100644 → 0
View file @
8bdfcac3
{
"script"
:
{
"source"
:
"for (item in ctx._source.access) { if (item.name.it[0] == 'Nel local') { item.name.it = params.name } }"
,
"lang"
:
"painless"
,
"params"
:
{
"name"
:
[
"Sul posto"
]
}
},
"query"
:
{
"term"
:
{
"access.name.it.filter"
:
"Nel local"
}
}
}
utilities/elastic_scripts/udpate_by_query/query.json
0 → 100644
View file @
9918cfda
{
"query"
:
{
"term"
:
{
"recordSet.facet"
:
"bar-001"
}
},
"script"
:
{
"params"
:
{
"institution"
:
[
{
"facet"
:
[],
"filter"
:
"csa"
,
"name"
:
{
"de"
:
[
"Cinémathèque suisse"
],
"fr"
:
[
"Cinémathèque suisse"
],
"it"
:
[
"Cinémathèque suisse"
],
"un"
:
[]}},
{
"facet"
:
[],
"filter"
:
"bar"
,
"name"
:
{
"de"
:
[
"Schweizerisches Bundesarchiv"
],
"fr"
:
[
"Archives fédérales suisses"
],
"it"
:
[
"Archivio federale svizero"
],
"un"
:
[]}
}
]
},
"source"
:
"ctx._source['institution'] = params.institution"
}}
utilities/elastic_scripts/update_by_query.sh
→
utilities/elastic_scripts/
udpate_by_query/
update_by_query.sh
View file @
9918cfda
curl
-X
POST
-H
'Content-Type: application/json'
-d
"@query.json"
"localhost:8080/documents-v21/_update_by_query"
curl
-X
POST
-H
'Content-Type: application/json'
-d
"@query.json"
"localhost:8080/documents-v21/_update_by_query"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment