I just started using GAE's search API and I'm looking for the equivalent of a SQL group by count statement. Does something like this currently exist?
Asked
Active
Viewed 302 times
0
-
2No you have to write your own – Mar 11 '13 at 16:37
2 Answers
0
No, that's not what it's for at all. It's a full-text search API, and has no support for things like grouping or other relational concepts.

Daniel Roseman
- 588,541
- 66
- 880
- 895
-
I just figured that since it returns number_found for a given search, that there might be some grouping mechanism to get multiple counts. More of a hope that anything else, but that makes sense. – Brandon Mar 11 '13 at 19:42
-
What if i use `search.AtomField` or `search.NumberField`? Can I group by this fields? Or is there a way to find distinct documents? – Kirill Cherepanov Nov 02 '16 at 17:39
0
As @Daniel Roseman noted, GROUP BY does not apply for the full-text Search API.
On Datastore there is count (but it's very expensive) but no GROUP BY.
Google CLoud SQL: it's basically a managed MySql instance - both GROUP BY and COUNT are available.
Google Big Query is a distributed on-demand map-reduce system with SQL-like query language. It has both GROUP BY and COUNT. They are both expensive as queries are charged by rows x columns scanned (no indexes exist). BQ is very powerful (and fast) but exporting data to it from GAE is tedious as there is no direct API.

Peter Knego
- 79,991
- 11
- 123
- 154