Hello

I want to analysis " who read the how many books?"

When bookid is duplicate, I don't want to count.

POST /bookdatas/_search
{
    "size": 0,
    "facets": {
        "ips_stats": {
            "terms_stats": {
                "key_field": "userId",
                "value_field": "duration",
                "size": 5
            },
      "facet_filter": {
        "fquery": {
          "query": {
            "filtered": {
              "query": {
                "bool": {
                  "should": [
                    {
                      "query_string": {
                        "query": "\"(Google)[email protected]\""
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
        }
    }
}

result 
 "facets": {
      "ips_stats": {
         "_type": "terms_stats",
         "missing": 0,
         "terms": [
            {
               "term": "(Google)[email protected]",
               "count": 64,
               "total_count": 3,
               "min": 2,
               "max": 139436,
               "total": 140733,
               "mean": 46911
            },


userId  prdId  duration  chapId(Google)[email protected]
(Google)[email protected](Google)[email protected]
A user only read a book, but count is three.

Can you give me a suggestion??

Thanks

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/6e865a48-54ad-4f95-aa60-732598d35de8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to