Advertisement
GabeKs

Query 1 & Relevant missing hash metadata

Feb 1st, 2021 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.52 KB | None | 0 0
  1. Relavant metadata stored for the given hash:
  2.  "hits": [
  3.       {
  4.         "_index": "k_index.6",
  5.         "_type": "_doc",
  6.         "_id": "Unique id removed",
  7.         "_score": 0,
  8.         "_source": {
  9.           "kmeta:updateTime": "2020-09-06T11:18:43.000Z",
  10.           "kmeta:fileHash": "fffffce6050d2fa50019d5679239e22d"
  11.         }
  12.       },
  13.       {
  14.         "_index": "k_index.6",
  15.         "_type": "_doc",
  16.         "_id": "Unique id removed",
  17.         "_score": 0,
  18.         "_source": {
  19.           "kmeta:updateTime": "2020-09-06T12:01:11.000Z",
  20.           "kmeta:fileHash": "fffffce6050d2fa50019d5679239e22d"
  21.         }
  22.       },
  23.       {
  24.         "_index": "k_index.6",
  25.         "_type": "_doc",
  26.         "_id": "Unique id removed",
  27.         "_score": 0,
  28.         "_source": {
  29.           "kmeta:updateTime": "2020-09-06T13:23:38.000Z",
  30.           "kmeta:fileHash": "fffffce6050d2fa50019d5679239e22d"
  31.         }
  32.       }
  33.     ]
  34.  
  35.  
  36.  
  37. Query 1 returning one of the missing hashes:
  38. GET On: /_search?request_cache=false
  39. {
  40.   "from": 0,
  41.   "size": 0,
  42.   "query": {
  43.     "bool": {
  44.       "filter": [
  45.         {
  46.           "term": {
  47.             "kmeta:fileHash": {
  48.               "value": "fffffce6050d2fa50019d5679239e22d",
  49.               "boost": 1
  50.             }
  51.           }
  52.         },
  53.         {
  54.           "range": {
  55.             "kmeta:updateTime": {
  56.               "from": "2020-09-06T11:10:43.000Z",
  57.               "to": "2020-09-06T13:24:43.000Z",
  58.               "include_lower": true,
  59.               "include_upper": false,
  60.               "time_zone": "Europe/Berlin",
  61.               "boost": 1
  62.             }
  63.           }
  64.         }
  65.       ]
  66.     }
  67.   },
  68.   "aggregations": {
  69.     "kmeta:fileHash": {
  70.       "terms": {
  71.          "include": {
  72.                "partition": 0,
  73.                "num_partitions": 1
  74.         },
  75.         "field": "kmeta:fileHash",
  76.         "size": 1000,
  77.         "shard_size": 1000,
  78.         "min_doc_count": 2,
  79.         "shard_min_doc_count": 1
  80.       }
  81.     }
  82.   }
  83. }
  84.  
  85.  
  86. Result of Query 1
  87.  
  88. {
  89.   "took": 1140,
  90.   "timed_out": false,
  91.   "_shards": {
  92.     "total": 8,
  93.     "successful": 8,
  94.     "skipped": 0,
  95.     "failed": 0
  96.   },
  97.   "hits": {
  98.     "total": {
  99.       "value": 3,
  100.       "relation": "eq"
  101.     },
  102.     "max_score": null,
  103.     "hits": [
  104.  
  105.     ]
  106.   },
  107.   "aggregations": {
  108.     "kmeta:fileHash": {
  109.       "doc_count_error_upper_bound": 0,
  110.       "sum_other_doc_count": 0,
  111.       "buckets": [
  112.         {
  113.           "key": "fffffce6050d2fa50019d5679239e22d",
  114.           "doc_count": 3
  115.         }
  116.       ]
  117.     }
  118.   }
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement