[Glass] Indexing question
Martin McClure
martin.mcclure at gemtalksystems.com
Mon Dec 9 17:14:03 PST 2013
On 12/09/2013 04:56 PM, BrunoBB wrote:
> Hi,
>
> A subset of instances of FormInstance could have keys named 'name' and
> 'surname'.
>
> So for that particular subset i wanna create a index by 'name' and
> 'surname'. Where name and surname are keys in the Dictonary <fields> of the
> class FormInstance. (name and surname only exists for these particular
> instances)
>
> For another particular subset i wanna create a index by 'form_number'. Where
> 'form_number' is a keys in <fields> Dictionary of FormInstance.
>
> The criteria it will be the values of the some keys in <fields> Dictionary
> of FormInstance.
>
> Do you understand what i mean ?
Perhaps.
So when you have a query like
name = 'abc'
surname = 'def'
then you want the result set to contain only FormInstances that have
those fields? And when you query by form_number you want to get only
those instances?
If that's right, I would think you would put the name-and-surname ones
in one collection, and the form_number ones in a different collection.
If you need to have all instances of FormInstance in the same collection
for some reason, you can have that collection as well.
Regards,
-Martin
More information about the Glass
mailing list