0

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?

Lipis
  • 21,388
  • 20
  • 94
  • 121
Brandon
  • 2,886
  • 3
  • 29
  • 44

2 Answers2

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