Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. {
  2. "aggs": {
  3. "status": {
  4. "terms": {
  5. "field": "status",
  6. "size": 0
  7. }
  8. }
  9. },
  10. "filter": {
  11. "nested": {
  12. "path": "participants",
  13. "filter": {
  14. "bool": {
  15. "must": [
  16. {
  17. "term": {
  18. "user_id": 1
  19. }
  20. },
  21. {
  22. "term": {
  23. "archived": false
  24. }
  25. },
  26. {
  27. "term": {
  28. "has_unread": true
  29. }
  30. }
  31. ]
  32. }
  33. }
  34. }
  35. },
  36. "query": {
  37. "filtered": {
  38. "filter": {
  39. "bool": {
  40. "must_not": [
  41. {
  42. "term": {
  43. "status": 8
  44. }
  45. }
  46. ]
  47. }
  48. }
  49. }
  50. }
  51. }
  52.  
  53. {
  54. "term": {
  55. "user_id": 1
  56. }
  57. }
  58.  
  59. {
  60. "term": {
  61. "participants.user_id": 1
  62. }
  63. }
  64.  
  65. {
  66. "query": {
  67. "filtered": {
  68. "filter": {
  69. "bool": {
  70. "must" : {
  71. "nested" : {
  72. "path" : "participants",
  73. "filter": {
  74. "bool": {
  75. "must": [
  76. {
  77. "term": {
  78. "participants.user_id": 1
  79. }
  80. },
  81. {
  82. "term": {
  83. "participants.archived": false
  84. }
  85. },
  86. {
  87. "term": {
  88. "participants.has_unread": true
  89. }
  90. }
  91. ]
  92. }
  93. }
  94. }
  95. },
  96. "must_not": {
  97. "term": {
  98. "status": 8
  99. }
  100. }
  101. }
  102. }
  103. }
  104. },
  105. "aggs": {
  106. "status": {
  107. "terms": {
  108. "field": "status",
  109. "size": 0
  110. }
  111. }
  112. }
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement