Nested facet or facet_filter?


(zh3w4ng) #1

Hi everyone,

I'm new to elasticsearch and hope any expert can help me with this problem.
I want to remove the redundancy of repeated requests from the same session
and obtain the room's unique view counts from every country.

Here is the mapping. sid means session id.

mappings:{
fluentd:{
properties:{
sid:{type:"string"},
params:{
properties:{
room_id:{type:"string"}
}
},
country:{type:"string"},
controller:{type:"string"},
action:{type:"string"}
}
}
}

I have the basic code for counting without ruling out multiple requests
from the same session. I don't know what I should to to remove the
redundancy.

curl -XGET 'http://log_server:9200/one_day_log/_search' -d '{
"query":{"bool":{"must":[
{"match":{"controller":"rooms"}},
{"match":{"action":"show"}},
{"match":{"params.id":"138999"}}
]}},
"facets":{
"countries":{"terms":{"field":"country"}}
}
}'

Thanks,
Zhe

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/fe8fc39a-5075-4915-9648-eeefccc8aa77%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #2