Skip to content

Instantly share code, notes, and snippets.

@cldellow
Created June 29, 2012 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cldellow/3018581 to your computer and use it in GitHub Desktop.
Save cldellow/3018581 to your computer and use it in GitHub Desktop.
Load 10K items of type product, 100K items of type othertype, memory usage to facet the first type grows 10x
curl -XPUT 'http://localhost:9200/products/othertype/_mapping?pretty=true' -d'{
"othertype": {
"properties": {
"year": { "type": "long" },
"b": { "type": "boolean" }
}
}
}'
curl -XPUT 'http://localhost:9200/products/product/_mapping?pretty=true' -d'{
"product": {
"properties": {
"year": { "type": "long" },
"b": { "type": "boolean" }
}
}
}'
for i in {1..10000}
do
curl -XPOST "http://localhost:9200/products/product/$i?pretty=true" -d "{
"year": [$i],
"b": false
}"
done
for i in {1..100000}
do
curl -XPOST "http://localhost:9200/products/othertype/$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