news-ai / tabulae

API for media list management
https://tabulae.newsai.org/
0 stars 0 forks source link

get all email campaigns #411

Closed AbhiAgarwal closed 7 years ago

AbhiAgarwal commented 7 years ago
{
    "size": 0,
    "query": {
        "bool": {
            "must": [{
                "term": {
                    "data.CreatedBy": 5749563331706880
                }
            }, {
                "term": {
                    "data.IsSent": true
                }
            }]
        }
    },
    "aggs": {
        "distinct_subjects": {
            "cardinality": {
                "field": "data.Subject"
            }
        }
    }
}
AbhiAgarwal commented 7 years ago

not difficult to achive. let's not use this solution though... it's really hard to see the uniqueness and ES doesn't always do the best job at showing cardinality well. we should probably index it into another index & query that. adds more complexity to querying, but read/write easier in the future.