« first day  last day (15 days later) » 

5:02 AM
sir @OpsterESNinjaNishant?
 
5:20 AM
hello
 
hello sir, good day!
 
5:43 AM
Same to you
I answered the question
 
6:23 AM
Tell me if you find it helpful?
 
Sir, is there a way to make the script into one?
'coz thinking about long run processing, this query will be heavy for the machine because there are always 2 separate aggs
ES returns 2 result from different aggs, and then the app or the native back end app will sum them?
is there a script that you will return what you have mentioned above in 1 single response?

this
`{"positive": 1, "neutral": 2, "negative" 1}`
 
Two aggregations will be way more faster than using scripts
We should always try to avoid script as much as possible
Native backend has to just iterate over the result which will never be a performance overhead
 
coz the problem there is....
yes, looking forward, we have 2 aggregations, and then the PHP (PHP is the main language we're using) will sum these 2 aggs
for example, 1 + 2 + 1 = 4 right?
we have a feature that reverse engineers this
I mean if we were able to display these 4 sentiments
we should be able to display what documents have these sentiments
so the problem lies there if we were separating the aggs manually
 
Why do you need 4?
 
no no, it's based from the above example
{"positive": 1, "neutral": 2, "negative" 1}
 
6:37 AM
The count 4 will always be available by the main query. This doesn't need aggregation then
 
it gives the result doc_count of 4, right?
presuming that, with the query you've given is correct pointing to the stackoverflow answer of yours, you mentioned above that the native bakend has to reiterate and add the numbers
so, summing them up, it's 4
so CLI_ID 2 displays 4 doc_count of what we call labeled sentiment, can you follow up to this point?
 
If the end goal is to get total count of document and not the count per sentiment then that can be achieved without using aggregation.
 
no sir, the goal is to get the total count of sentiments ( cms )
 
The total count of sentiments will always be equal to the doc counts given by the query because: cli_id: 0 is always present in every doc so irrespective of cli_id: 2 is present or not the doc will always be counted
And if cli_id: 2 is present then you don't want to count the sentiment for cli_id: 0
So eventually every doc is counted after applying the main query
 
7:01 AM
hello sir
are you still there?
This is the nearest query that I've formulated to reach my desired output, but it isn't working
around the bool : should
it is only fetching the cmx_sentiment of the logged in client
 

« first day  last day (15 days later) »