last day (16 days later) » 

5:47 AM
hello and good day sir!
finally, a chat room!
ok I got this query made through Kibana
going back to the index, I have a nested field called cms
 
I understood that there is always a nested field cms that holds cli_id and sentiment as nested docs
Doc 1 in my example was this :
{
"_id": 1,
"cms": [
{
"cli_id": 0,
"sentiment": "positive"
}
]
}
 
yes sir! that's correct
so every document there is in my index, the default element of the cms nested field is that element with **"cli_id" : 0 **
you don't have to think about where that 1st element comes from, coz it's from our python script
 
Yup all I want is the clarity on count
For the eg in my comment
 
ok ok, let's talk about the clarity on count
reviewing your question sir...
My question is this: If there are 4 docs in total. doc 1 with cms having no nested doc with cli_id: <logged in cli_id> and have sentiment positive for cli_id: 0, doc 2 have cli_id: <logged in cli_id> with sentiment value as neutral, doc 3 has sentiment as negative and doc 4 neutral forcli_id: <logged in cli_id>. Now what count you want: {default: 1, with_sentiment : 3} OR {"positive": 1, "neutral": 2, "negative" 1} ?
doc1:
aw
doc1:
{
cli_id:0,
cmx_sentiment: "positive"
}

doc2
{
cli_id: 2,
cmx_sentiment: "neutral"
}

doc3
{
cli_id: 0,
cmx_sentiment: "negative"
}

doc4
{
cli_id: 2,
cmx_sentiment: "neutral"
}

is my depiction correct according to your example sir?
 
6:03 AM
doc3
{
cli_id: 2,
cmx_sentiment: "negative"
}
rest is correct
 
if YES, if the client with cli_id 2 logs in, the count will be, NEUTRAL: 2
oh
if that's the case

{"positive": 1, "neutral": 2, "negative" 1}
your 2nd answer is the correct one
 
Ok , I got the clarity on count now
I'll soon update my answer accordingly
 
NICE NICE!!! THANK YOU SO MUCH!
as long as the logged in client hasn't placed the label yet, the element with cli_id will be fetched
 
I'm in office right now, so please expect a delay in the update.
 
but this takes place in the "aggs" sir, not in the main filter of the elasticsearch query
NO WORRIES SIR!
THANK YOU VERY MUCH FOR YOUR KIND UNDERSTANDING! ^_^
 
6:07 AM
Yes, I'll use aggregations
No problem, we all are here to help each other
 
just take your time, damn... no worries sir. this was my problem since last December
 
 
10 hours later…
3:49 PM
hello sir? @OpsterESNinjaNishant
 

  last day (16 days later) »