evanp/databank — Issue #7: Use indices in search in Redis
Author: evanp
Created: 2011-11-30 17:53:19+00:00
State: open

The redis driver does a full "type scan" on every search. For fields listed in schema.indices, it should keep a set for objects that match a value.

Example: given this schema: {'person': {pkey: 'email', indices: ['name.last']}} (email = primary key, additional index on name.last), we should keep a set at "index:person:name.last:Prodromou" with the keys of every matching object.

Search should do a set intersection on indexed properties in the criteria, then scan the resulting keys for any unindexed criteria, if necessary.