Indexing Attachment file to elastic search

后端 未结 4 756
暖寄归人
暖寄归人 2021-01-06 15:03

I have typed this command to index a document in Elasticsearch

create an index

curl -X PUT \"localhost:9200/test_idx_1x\"

4条回答
  •  星月不相逢
    2021-01-06 15:08

    http://es-cn.medcl.net/tutorials/2011/07/18/attachment-type-in-action.html

    #!/bin/sh
    
    coded=`cat fn6742.pdf | perl -MMIME::Base64 -ne 'print encode_base64($_)'`
    json="{\"file\":\"${coded}\"}"
    echo "$json" > json.file
    curl -X POST "localhost:9200/test/attachment/" -d @json.file
    

提交回复
热议问题