Skip to content

Instantly share code, notes, and snippets.

Created June 29, 2012 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3015553 to your computer and use it in GitHub Desktop.
Save anonymous/3015553 to your computer and use it in GitHub Desktop.
Loading 10K items, faceting them, checking cache usage
curl -XPUT 'http://localhost:9200/products/product/_mapping?pretty=true' -d'{
"product": {
"properties": {
"year": { "type": "long" }
}
}
}'
for i in {1..10000}
do
curl -XPOST "http://localhost:9200/products/product/$i?pretty=true" -d "{
"year": $i,
"b": false
}"
done
curl -XPOST 'http://localhost:9200/products/_refresh?pretty=true'
curl -XPOST http://localhost:9200/products/product/_search -d '{"facets": { "year": {"statistical":{"field":"year"}}}}'
curl -s http://localhost:9200/_cluster/nodes/stats?pretty=1|grep cache --after 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment