Guest User

Untitled

a guest
Jan 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. {
  2. "reviews": {
  3. "mappings": {
  4. "hotels": {
  5. "properties": {
  6. "entityCollection": {
  7. "properties": {
  8. "entities": {
  9. "type": "nested",
  10. "properties": {
  11. "displayName": {
  12. "type": "text",
  13. "fields": {
  14. "keyword": {
  15. "type": "keyword"
  16. }
  17. }
  18. },
  19. "id": {
  20. "type": "text",
  21. "fields": {
  22. "keyword": {
  23. "type": "keyword"
  24. }
  25. }
  26. },
  27. "type": {
  28. "type": "text",
  29. "fields": {
  30. "keyword": {
  31. "type": "keyword"
  32. }
  33. }
  34. }
  35. }
  36. }
  37. }
  38. },
  39. "reviewSubmissionTime": {
  40. "type": "date"
  41. }
  42. }
  43. }
  44. }
  45. }
  46. }
  47.  
  48. {
  49. "_source": {
  50. "reviewSubmissionTime": "2013-11-18T08:00:00.000Z",
  51. "entityCollection": {
  52. "entities": [
  53. {
  54. "id": "staff",
  55. "type": "tag"
  56. },
  57. {
  58. "id": "dining",
  59. "type": "tag"
  60. },
  61. {
  62. "id": "restaurant",
  63. "type": "tag"
  64. }
  65. ]
  66. }
  67. }
  68. }
  69.  
  70. {
  71. "size": 0,
  72. "query": {
  73. "bool": {
  74. "filter": [
  75. {
  76. "range": {
  77. "reviewSubmissionTime": {
  78. "gte": "2013-01-01",
  79. "format": "yyyy-MM-dd"
  80. }
  81. }
  82. }
  83. ]
  84. }
  85. },
  86. "aggs": {
  87. "tags": {
  88. "nested": {
  89. "path": "entityCollection.entities"
  90. },
  91. "aggs": {
  92. "selected_tags": {
  93. "filter": {
  94. "bool": {
  95. "must": [
  96. {
  97. "terms": {
  98. "entityCollection.entities.id": [
  99. "staff"
  100. ]
  101. }
  102. }
  103. ]
  104. }
  105. },
  106. "aggs": {
  107. "docs": {
  108. "reverse_nested": {},
  109. "aggs": {
  110. "parent_docs": {
  111. "top_hits": {
  112. "_source": {
  113. "includes": [
  114. "entityCollection.entities.id",
  115. "entityCollection.entities.type",
  116. "reviewSubmissionTime"
  117. ]
  118. }
  119. }
  120. }
  121. }
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }
  129.  
  130. {
  131. "took": 58,
  132. "timed_out": false,
  133. "_shards": {
  134. "total": 3,
  135. "successful": 3,
  136. "failed": 0
  137. },
  138. "hits": {
  139. "total": 1632254,
  140. "max_score": 0,
  141. "hits": []
  142. },
  143. "aggregations": {
  144. "tags": {
  145. "doc_count": 1749430,
  146. "selected_tags": {
  147. "doc_count": 134003,
  148. "docs": {
  149. "doc_count": 134003,
  150. "parent_docs": {
  151. "hits": {
  152. "total": 134003,
  153. "max_score": 1.4e-45,
  154. "hits": [
  155. {
  156. "_index": "reviews",
  157. "_type": "hotels",
  158. "_id": "61721588",
  159. "_score": 0,
  160. "_source": {
  161. "entityCollection": {
  162. "entities": [
  163. {
  164. "id": "staff",
  165. "type": "tag"
  166. },
  167. {
  168. "id": "roomBed",
  169. "type": "tag"
  170. }
  171. ]
  172. },
  173. "reviewSubmissionTime": "2013-11-13T04:27:29.000Z"
  174. }
  175. },
  176. {
  177. "_index": "reviews",
  178. "_type": "hotels",
  179. "_id": "61730048",
  180. "_score": 0,
  181. "_source": {
  182. "entityCollection": {
  183. "entities": [
  184. {
  185. "id": "staff",
  186. "type": "tag"
  187. },
  188. {
  189. "id": "breakfast",
  190. "type": "tag"
  191. }
  192. ]
  193. },
  194. "reviewSubmissionTime": "2013-11-13T12:25:36.000Z"
  195. }
  196. },
  197. {
  198. "_index": "xreviews-2013-1012",
  199. "_type": "psrHotels",
  200. "_id": "61773871",
  201. "_score": 0,
  202. "_source": {
  203. "entityCollection": {
  204. "entities": [
  205. {
  206. "id": "staff",
  207. "type": "tag"
  208. },
  209. {
  210. "id": "dining",
  211. "type": "tag"
  212. },
  213. {
  214. "id": "casino",
  215. "type": "tag"
  216. },
  217. {
  218. "id": "restaurant",
  219. "type": "tag"
  220. },
  221. {
  222. "id": "skyScraper",
  223. "type": "tag"
  224. }
  225. ]
  226. },
  227. "reviewSubmissionTime": "2013-11-14T01:02:14.000Z"
  228. }
  229. }
  230. ]
  231. }
  232. }
  233. }
  234. }
  235. }
  236. }
  237. }
Add Comment
Please, Sign In to add comment