Indexing Attachment file to elastic search

后端 未结 4 755
暖寄归人
暖寄归人 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

    There is an alternative solution - plugin at http://elasticwarehouse.org. You can upload binary file using _ewupload?, read newly generated ID and update your different index with this reference.

    Install plugin:

    plugin -install elasticwarehouseplugin -u http://elasticwarehouse.org/elasticwarehouse/elasticsearch-elasticwarehouseplugin-1.2.2-1.7.0-with-dependencies.zip
    

    Restart cluster, then:

    curl -XPOST "http://127.0.0.1:9200/_ewupload?folder=/myfolder&filename=mybinaryfile.bin" --data-binary @mybinaryfile.bin
    

    Sample response:

    {"id":"nWvrczBcSEywHRBBBwfy2g","version":1,"created":true}
    

提交回复
热议问题