[URGENT] Handling min_doc_count with adjacency matrix?


(Garima B) #1

Hi all -
We're a group of college students doing a project on visualizing Twitter data using Elastic Search service (we're ingesting tweets from Twitter Streaming API, cleaning them and sending it to Elastic Search). We are trying to use the Adjacency Matrix Bucket aggregator with two filters.

**However, ** buckets where no document is found are not returned at all which is creating issues in our front-end.

For example: this is our query:
{ query: {
bool: {
must: [
],
},
},
aggs: {
interactions: {
adjacency_matrix: {
filters: {
aaa_femaleSender: { terms: { 'sender.gender': [1] } },
bbb_maleSender: { terms: { 'sender.gender': [0] } },
},
},
},
},
}

What is returned is sometimes this:
{
"aaa_femaleSender": 1678571,
"aaa_femaleSender&keyword": 1,
"bbb_maleSender": 2080783,
"keyword": 3
}
Where we would like it to be:
{
"aaa_femaleSender": 1678571,
"aaa_femaleSender&keyword": 1,
"bbb_maleSender&keyword":0,
"bbb_maleSender": 2080783,
"keyword": 3
}

Is there a way for buckets to be returned with min_doc_count? We aren't totally familiar with querying Elasitc Search.

THANK YOU!Preformatted text


(Mark Harwood) #2

Empty buckets may be convenient in your example with only two filters but larger numbers of filters would explode the number of combinations, most of which would typically be empty so would be very sizeable.

As a feature it would be giving many users a handy tool to shoot themselves in the foot.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.