aggregate - ElasticSearch: scoped aggregation -


my understanding can apply aggs scope of query. if run query only, brings 21k hits. however, when add aggs it, comes empty. doing wrong?

thank you,

{   "query": {     "bool": {       "must": [          { "term": {"app.raw": "me"} }         ,{ "term": {"cat.raw": "iv"} }         ,{ "term": {"sub.raw": "act"} }       ]     }   } ,   "aggs": {     "distinct_users": {       "cardinality": {         "field": "login",         "precision_threshold": 1000       }     }   }   } 

because request elasticsearch has "aggs" parameter, "size" parameter defaults 0 , query results not returned, aggregation results.

add "size" field whatever value want topmost object in query return search hits, e.g.

{   query: {     ...   },   size: 42,   aggs: {     ...   } } 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -