I have a Google App Engine application with a specific model, let me call it a game. This applies to a football game, its date, referee (reference), a list of 2 clubs (links), evaluation, its phase (reference), competition (reference) and season (reference). In other words, it has several fields that I intend to make searchable on the advanced search page.
For example, if someone wants to search for all games by season (say: 2008/2009) and by date (say, after January 1, 2009), I have to parse the GET variables and come up with something like:
games = Game.all()
if (variables.hasFilter("season")
games.filter("game_season = ", season)
if (variables.hasFilter("after_date")
games.filter("game_date > ", after_date)
This requires a specific composite index:
- kind: Game
properties:
- name: game_season
- name: game_date
, - , , , , :
- kind: Game
properties:
- name: game_season
- name: game_club
, - , , :
- kind: Game
properties:
- name: game_season
- name: game_date
- name: game_club
: , , , Google App Engine NeedIndexError, , ?
, (, 6 - , , , , , ). , .. , .
:
GAE , , , , 6 , 5, 4, 3 2 ?
, ? , , - "" , , :
games = Game.all()
// GET.
if (variables.hasFilter( "" )
games.filter( "game_season =", )
games.filter( "game_season =" *)
if (variables.hasFilter( "date" )
games.filter( "game_date =", )
games.filter( "game_date =" *)
if (variables.hasFilter( "club" )
games.filter( "game_club =", )
games.filter( "game_club =" *)
, , , . (, , ).
.