Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ ./query_cache_test2.sh
- Get ES version:
- {
- "status" : 200,
- "name" : "Kukulcan",
- "cluster_name" : "elasticsearch_j",
- "version" : {
- "number" : "1.4.3",
- "build_hash" : "36a29a7144cfde87a960ba039091d40856fcb9af",
- "build_timestamp" : "2015-02-11T14:23:15Z",
- "build_snapshot" : false,
- "lucene_version" : "4.10.3"
- },
- "tagline" : "You Know, for Search"
- }
- Remove old index...
- {
- "acknowledged" : true
- }
- Make index and add some data - default mappings are fine
- {
- "_index" : "shardcache",
- "_type" : "type",
- "_id" : "1",
- "_version" : 1,
- "created" : true
- }
- {
- "_index" : "shardcache",
- "_type" : "type",
- "_id" : "2",
- "_version" : 1,
- "created" : true
- }
- Wait for ES to be synced (aka refresh indices)...
- {
- "_shards" : {
- "total" : 10,
- "successful" : 5,
- "failed" : 0
- }
- }
- Enable query cache by default
- {
- "acknowledged" : true
- }
- Show settings: verify query cache enabled
- {
- "shardcache" : {
- "settings" : {
- "index" : {
- "creation_date" : "1424207625781",
- "uuid" : "Ki9Mr_TrT72C8VV0lwM7wQ",
- "cache" : {
- "query" : {
- "enable" : "true"
- }
- },
- "number_of_replicas" : "1",
- "number_of_shards" : "5",
- "version" : {
- "created" : "1040399"
- }
- }
- }
- }
- }
- Verify empty cache...
- {
- "_shards" : {
- "total" : 10,
- "successful" : 5,
- "failed" : 0
- },
- "_all" : {
- "primaries" : {
- "query_cache" : {
- "memory_size" : "0b",
- "memory_size_in_bytes" : 0,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 0
- }
- },
- "total" : {
- "query_cache" : {
- "memory_size" : "0b",
- "memory_size_in_bytes" : 0,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 0
- }
- }
- },
- "indices" : {
- "shardcache" : {
- "primaries" : {
- "query_cache" : {
- "memory_size" : "0b",
- "memory_size_in_bytes" : 0,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 0
- }
- },
- "total" : {
- "query_cache" : {
- "memory_size" : "0b",
- "memory_size_in_bytes" : 0,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 0
- }
- }
- }
- }
- }
- internal date range filtered agg...
- {
- "took" : 4,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 2,
- "max_score" : 0.0,
- "hits" : [ ]
- },
- "aggregations" : {
- "tweets_per_day" : {
- "buckets" : [ {
- "key_as_string" : "2012-01-01T00:00:00.000Z",
- "key" : 1325376000000,
- "doc_count" : 1
- }, {
- "key_as_string" : "2016-01-01T00:00:00.000Z",
- "key" : 1451606400000,
- "doc_count" : 1
- } ]
- }
- }
- }
- Verify empty cache...
- {
- "_shards" : {
- "total" : 10,
- "successful" : 5,
- "failed" : 0
- },
- "_all" : {
- "primaries" : {
- "query_cache" : {
- "memory_size" : "0b",
- "memory_size_in_bytes" : 0,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 0
- }
- },
- "total" : {
- "query_cache" : {
- "memory_size" : "0b",
- "memory_size_in_bytes" : 0,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 0
- }
- }
- },
- "indices" : {
- "shardcache" : {
- "primaries" : {
- "query_cache" : {
- "memory_size" : "0b",
- "memory_size_in_bytes" : 0,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 0
- }
- },
- "total" : {
- "query_cache" : {
- "memory_size" : "0b",
- "memory_size_in_bytes" : 0,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 0
- }
- }
- }
- }
- }
- Running without date filter...
- {
- "took" : 1,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "failed" : 0
- },
- "hits" : {
- "total" : 2,
- "max_score" : 0.0,
- "hits" : [ ]
- },
- "aggregations" : {
- "tweets_per_day" : {
- "buckets" : [ {
- "key_as_string" : "2012-01-01T00:00:00.000Z",
- "key" : 1325376000000,
- "doc_count" : 1
- }, {
- "key_as_string" : "2016-01-01T00:00:00.000Z",
- "key" : 1451606400000,
- "doc_count" : 1
- } ]
- }
- }
- }
- Now verify something in the cache:
- {
- "_shards" : {
- "total" : 10,
- "successful" : 5,
- "failed" : 0
- },
- "_all" : {
- "primaries" : {
- "query_cache" : {
- "memory_size" : "1.2kb",
- "memory_size_in_bytes" : 1235,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 5
- }
- },
- "total" : {
- "query_cache" : {
- "memory_size" : "1.2kb",
- "memory_size_in_bytes" : 1235,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 5
- }
- }
- },
- "indices" : {
- "shardcache" : {
- "primaries" : {
- "query_cache" : {
- "memory_size" : "1.2kb",
- "memory_size_in_bytes" : 1235,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 5
- }
- },
- "total" : {
- "query_cache" : {
- "memory_size" : "1.2kb",
- "memory_size_in_bytes" : 1235,
- "evictions" : 0,
- "hit_count" : 0,
- "miss_count" : 5
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement