Working on an iPhone app with Parse DB backend I'm trying to implement a search functionality using search tokens. I read Parse's white papers on scalable search, relations vs. pointers, documentation, various SO / Parse.com discussions, etc. - unfortunately couldn't find any similarity to my problem.
I'm using a class SearchToken
where I'm storing unique sanitised tokens and I have a PFRelation *tokenRelation
in related class Article
(every article can have multiple search tokens; every token can be related to multiple articles).
I'm trying to form a query that finds all objects from Article
class that contain all searched tokens (e.g. @"token1", @"token2"
). Unfortunately whereKey:containsAllObjectsInArray:
doesn't work on PFRelation
attributes which further complicates things for me.
An easy option would be to convert that PFRelation
attribute to an array of pointers but I know that the number of associated tokens can exceed everywhere-mentioned limit of 100 objects so I'm bit hesitant here.
My question is: is there any other way of querying objects matching all conditions in related objects (via PFRelation
) or is there any better way of implementing tokenised search feature?