Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "aggs": {
- "status": {
- "terms": {
- "field": "status",
- "size": 0
- }
- }
- },
- "filter": {
- "nested": {
- "path": "participants",
- "filter": {
- "bool": {
- "must": [
- {
- "term": {
- "user_id": 1
- }
- },
- {
- "term": {
- "archived": false
- }
- },
- {
- "term": {
- "has_unread": true
- }
- }
- ]
- }
- }
- }
- },
- "query": {
- "filtered": {
- "filter": {
- "bool": {
- "must_not": [
- {
- "term": {
- "status": 8
- }
- }
- ]
- }
- }
- }
- }
- }
- {
- "term": {
- "user_id": 1
- }
- }
- {
- "term": {
- "participants.user_id": 1
- }
- }
- {
- "query": {
- "filtered": {
- "filter": {
- "bool": {
- "must" : {
- "nested" : {
- "path" : "participants",
- "filter": {
- "bool": {
- "must": [
- {
- "term": {
- "participants.user_id": 1
- }
- },
- {
- "term": {
- "participants.archived": false
- }
- },
- {
- "term": {
- "participants.has_unread": true
- }
- }
- ]
- }
- }
- }
- },
- "must_not": {
- "term": {
- "status": 8
- }
- }
- }
- }
- }
- },
- "aggs": {
- "status": {
- "terms": {
- "field": "status",
- "size": 0
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement