Skip to content

Instantly share code, notes, and snippets.

@2arunpmohan
Created September 8, 2016 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2arunpmohan/90b7fd41ecea9a310076a1de83b8556d to your computer and use it in GitHub Desktop.
Save 2arunpmohan/90b7fd41ecea9a310076a1de83b8556d to your computer and use it in GitHub Desktop.
bash scripts for reference mapping for pdf attachments in elasticsearch
#!/bin/bash
if [ -z $1 ] ; then
echo "Please enter hostname"
exit
fi
hostname=$1
curl -XDELETE "http://$hostname:9175/pdf-attachment-04"
echo
curl -X PUT "http://$hostname:9175/pdf-attachment-04" -d '{
"mappings": {
"person" : {
"properties" : {
"file" : {
"type" : "attachment",
"fields" : {
"content" : {"store" : "yes"},
"title" : {"store" : "yes"},
"date" : {"store" : "yes"},
"author" : {"store" : "yes"},
"keywords" : {"store" : "yes"},
"content_type" : {"store" : "yes"},
"content_length" : {"store" : "yes"},
"language" : {"store" : "yes"}
}
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment