Created
September 8, 2016 08:38
-
-
Save 2arunpmohan/90b7fd41ecea9a310076a1de83b8556d to your computer and use it in GitHub Desktop.
bash scripts for reference
mapping for pdf attachments in elasticsearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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