Skip to content

Instantly share code, notes, and snippets.

@horaciod
Created February 18, 2019 15:32
Show Gist options
  • Select an option

  • Save horaciod/03884083c305bd7eb13c09b240c836a5 to your computer and use it in GitHub Desktop.

Select an option

Save horaciod/03884083c305bd7eb13c09b240c836a5 to your computer and use it in GitHub Desktop.
Update / Add fields in solr index based in search (agregar o modificar registros en un indice solr usando un resultado de búsqueda
#!/usr/bin/bash
# primer parametro que buscar ej: country_str:argentina
# segundo parametro que archivo de template utilizar. ej: chile.j
##### archivo template
##### { "id": .id , country_str:{"set":"Chile" }}
echo "$2 en portal '$1'"
solrdump -verbose -server http://localhost:8389/solr/biblio -q "$1" -fl 'id' |jq -f $2 -c >update.json
solrbulk -server http://localhost:8389/solr/biblio update.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment