TomonoriSoejima / Tejun

notes related to working cases
5 stars 3 forks source link

make big file #63

Open TomonoriSoejima opened 3 years ago

TomonoriSoejima commented 3 years ago
for i in $(seq 1 500); do
    echo "there are $i documents here"
done > input

file=$(cat input |  tr '\n' ' ' )

printf '
{
  "_index": "tomo",
  "_type": "_doc",
  "_source": {
    "aa": "aa",
    "message": "%s"
  }
}'  "$file" | \

jq -c '. | { index: {_index:._index, _type:._type}}, ._source' | http -b http://localhost:9200/_bulk