-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a method to get total facets count #67
Comments
Please elaborate more on why it's important. Can't you just calculate count of |
After experimenting with manticore json API, I realised that the issue belongs to To clarify issue:
The code above will hit
And behind the scene, it executes To answer your question: |
OK, I think I see your point. Please review and confirm I understood it right: So the minimal reproducible example is:
No "total" returned in "aggregations": curl -sX POST http://localhost:9308/search -d '{"index":"t","limit":0,"offset":0,"aggs":{"a":{"terms":{"field":"a","size":10}}}}'|jq .
{
"took": 0,
"timed_out": false,
"hits": {
"total": 3,
"hits": []
},
"aggregations": {
"a": {
"buckets": [
{
"key": 2,
"doc_count": 1
},
{
"key": 1,
"doc_count": 2
}
]
}
}
} (should be 2 in this case). and when the number of facets is limited it's impossible to know how many can be returned in total: curl -sX POST http://localhost:9308/search -d '{"index":"t","limit":0,"offset":0,"aggs":{"a":{"terms":{"field":"a","size":1}}}}'|jq .
{
"took": 0,
"timed_out": false,
"hits": {
"total": 3,
"hits": []
},
"aggregations": {
"a": {
"buckets": [
{
"key": 2,
"doc_count": 1
}
]
}
}
} In SQL it can be seen in
Since the JSON protocol doesn't return it, the php client can't return it too. |
Yes, you understood it correctly. |
The library doesn't have a method to get total count of facets.
Here is the code example, imagine an index
jobs
with columnsemployer_id
andemployer_name
:So, adding a method similar to this one could solve the issue:
The text was updated successfully, but these errors were encountered: