2arunpmohan
9/8/2016 - 8:38 AM

bash scripts for reference mapping for pdf attachments in elasticsearch

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"}
                    }
                }
            }
        }
}
    
}'