view scripts/search/solr-delete-id @ 12:c2e2d794847f

new: add config.properties file for gazetteer
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 30 Sep 2015 13:43:54 +0200
parents a50cf11e5178
children
line wrap: on
line source

#!/bin/bash
if [ -z "$1" ]; then
  echo "No Solr ID provided."
  exit 1
else
  echo "Deleting Solr id $1"
  OUTPUT=`curl -s http://localhost:8983/solr/update/json?commit=true -H "Content-type: application/json" -X POST -d "{\"delete\": { \"query\":\"id:$1\"}}"`
  # exit code 7 is expected when Solr is down
  EXIT_CODE=$?
  #echo $EXIT_CODE
  #echo $OUTPUT
fi