Advertisement
Guest User

shard cache date filter

a guest
Feb 17th, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.58 KB | None | 0 0
  1. $ ./query_cache_test2.sh
  2. Get ES version:
  3. {
  4. "status" : 200,
  5. "name" : "Kukulcan",
  6. "cluster_name" : "elasticsearch_j",
  7. "version" : {
  8. "number" : "1.4.3",
  9. "build_hash" : "36a29a7144cfde87a960ba039091d40856fcb9af",
  10. "build_timestamp" : "2015-02-11T14:23:15Z",
  11. "build_snapshot" : false,
  12. "lucene_version" : "4.10.3"
  13. },
  14. "tagline" : "You Know, for Search"
  15. }
  16.  
  17. Remove old index...
  18. {
  19. "acknowledged" : true
  20. }
  21.  
  22. Make index and add some data - default mappings are fine
  23. {
  24. "_index" : "shardcache",
  25. "_type" : "type",
  26. "_id" : "1",
  27. "_version" : 1,
  28. "created" : true
  29. }
  30. {
  31. "_index" : "shardcache",
  32. "_type" : "type",
  33. "_id" : "2",
  34. "_version" : 1,
  35. "created" : true
  36. }
  37.  
  38. Wait for ES to be synced (aka refresh indices)...
  39. {
  40. "_shards" : {
  41. "total" : 10,
  42. "successful" : 5,
  43. "failed" : 0
  44. }
  45. }
  46.  
  47. Enable query cache by default
  48. {
  49. "acknowledged" : true
  50. }
  51.  
  52. Show settings: verify query cache enabled
  53. {
  54. "shardcache" : {
  55. "settings" : {
  56. "index" : {
  57. "creation_date" : "1424207625781",
  58. "uuid" : "Ki9Mr_TrT72C8VV0lwM7wQ",
  59. "cache" : {
  60. "query" : {
  61. "enable" : "true"
  62. }
  63. },
  64. "number_of_replicas" : "1",
  65. "number_of_shards" : "5",
  66. "version" : {
  67. "created" : "1040399"
  68. }
  69. }
  70. }
  71. }
  72. }
  73.  
  74. Verify empty cache...
  75. {
  76. "_shards" : {
  77. "total" : 10,
  78. "successful" : 5,
  79. "failed" : 0
  80. },
  81. "_all" : {
  82. "primaries" : {
  83. "query_cache" : {
  84. "memory_size" : "0b",
  85. "memory_size_in_bytes" : 0,
  86. "evictions" : 0,
  87. "hit_count" : 0,
  88. "miss_count" : 0
  89. }
  90. },
  91. "total" : {
  92. "query_cache" : {
  93. "memory_size" : "0b",
  94. "memory_size_in_bytes" : 0,
  95. "evictions" : 0,
  96. "hit_count" : 0,
  97. "miss_count" : 0
  98. }
  99. }
  100. },
  101. "indices" : {
  102. "shardcache" : {
  103. "primaries" : {
  104. "query_cache" : {
  105. "memory_size" : "0b",
  106. "memory_size_in_bytes" : 0,
  107. "evictions" : 0,
  108. "hit_count" : 0,
  109. "miss_count" : 0
  110. }
  111. },
  112. "total" : {
  113. "query_cache" : {
  114. "memory_size" : "0b",
  115. "memory_size_in_bytes" : 0,
  116. "evictions" : 0,
  117. "hit_count" : 0,
  118. "miss_count" : 0
  119. }
  120. }
  121. }
  122. }
  123. }
  124.  
  125. internal date range filtered agg...
  126. {
  127. "took" : 4,
  128. "timed_out" : false,
  129. "_shards" : {
  130. "total" : 5,
  131. "successful" : 5,
  132. "failed" : 0
  133. },
  134. "hits" : {
  135. "total" : 2,
  136. "max_score" : 0.0,
  137. "hits" : [ ]
  138. },
  139. "aggregations" : {
  140. "tweets_per_day" : {
  141. "buckets" : [ {
  142. "key_as_string" : "2012-01-01T00:00:00.000Z",
  143. "key" : 1325376000000,
  144. "doc_count" : 1
  145. }, {
  146. "key_as_string" : "2016-01-01T00:00:00.000Z",
  147. "key" : 1451606400000,
  148. "doc_count" : 1
  149. } ]
  150. }
  151. }
  152. }
  153.  
  154. Verify empty cache...
  155. {
  156. "_shards" : {
  157. "total" : 10,
  158. "successful" : 5,
  159. "failed" : 0
  160. },
  161. "_all" : {
  162. "primaries" : {
  163. "query_cache" : {
  164. "memory_size" : "0b",
  165. "memory_size_in_bytes" : 0,
  166. "evictions" : 0,
  167. "hit_count" : 0,
  168. "miss_count" : 0
  169. }
  170. },
  171. "total" : {
  172. "query_cache" : {
  173. "memory_size" : "0b",
  174. "memory_size_in_bytes" : 0,
  175. "evictions" : 0,
  176. "hit_count" : 0,
  177. "miss_count" : 0
  178. }
  179. }
  180. },
  181. "indices" : {
  182. "shardcache" : {
  183. "primaries" : {
  184. "query_cache" : {
  185. "memory_size" : "0b",
  186. "memory_size_in_bytes" : 0,
  187. "evictions" : 0,
  188. "hit_count" : 0,
  189. "miss_count" : 0
  190. }
  191. },
  192. "total" : {
  193. "query_cache" : {
  194. "memory_size" : "0b",
  195. "memory_size_in_bytes" : 0,
  196. "evictions" : 0,
  197. "hit_count" : 0,
  198. "miss_count" : 0
  199. }
  200. }
  201. }
  202. }
  203. }
  204.  
  205. Running without date filter...
  206. {
  207. "took" : 1,
  208. "timed_out" : false,
  209. "_shards" : {
  210. "total" : 5,
  211. "successful" : 5,
  212. "failed" : 0
  213. },
  214. "hits" : {
  215. "total" : 2,
  216. "max_score" : 0.0,
  217. "hits" : [ ]
  218. },
  219. "aggregations" : {
  220. "tweets_per_day" : {
  221. "buckets" : [ {
  222. "key_as_string" : "2012-01-01T00:00:00.000Z",
  223. "key" : 1325376000000,
  224. "doc_count" : 1
  225. }, {
  226. "key_as_string" : "2016-01-01T00:00:00.000Z",
  227. "key" : 1451606400000,
  228. "doc_count" : 1
  229. } ]
  230. }
  231. }
  232. }
  233.  
  234. Now verify something in the cache:
  235. {
  236. "_shards" : {
  237. "total" : 10,
  238. "successful" : 5,
  239. "failed" : 0
  240. },
  241. "_all" : {
  242. "primaries" : {
  243. "query_cache" : {
  244. "memory_size" : "1.2kb",
  245. "memory_size_in_bytes" : 1235,
  246. "evictions" : 0,
  247. "hit_count" : 0,
  248. "miss_count" : 5
  249. }
  250. },
  251. "total" : {
  252. "query_cache" : {
  253. "memory_size" : "1.2kb",
  254. "memory_size_in_bytes" : 1235,
  255. "evictions" : 0,
  256. "hit_count" : 0,
  257. "miss_count" : 5
  258. }
  259. }
  260. },
  261. "indices" : {
  262. "shardcache" : {
  263. "primaries" : {
  264. "query_cache" : {
  265. "memory_size" : "1.2kb",
  266. "memory_size_in_bytes" : 1235,
  267. "evictions" : 0,
  268. "hit_count" : 0,
  269. "miss_count" : 5
  270. }
  271. },
  272. "total" : {
  273. "query_cache" : {
  274. "memory_size" : "1.2kb",
  275. "memory_size_in_bytes" : 1235,
  276. "evictions" : 0,
  277. "hit_count" : 0,
  278. "miss_count" : 5
  279. }
  280. }
  281. }
  282. }
  283. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement