ios - Firebase query - Find item with child that contains string -
i'm having bit of trouble firebase query. want query objects, objects child value contains string. far have looks this:
firebase *ref = [[firebase alloc] initwithurl:@"https://dinosaur-facts.firebaseio.com/dinosaurs"]; [[[[ref queryorderedbykey] querystartingatvalue:@"b"] queryendingatvalue:@"b~"] observeeventtype:feventtypechildadded withblock:^(fdatasnapshot *snapshot) { nslog(@"%@", snapshot.key); }];
but gives objects have starting value of "b". want objects contains string "b". how do that?
there no contains or fuzzy matching methods in query api, have guessed if you've scanned the api , the guide on queries.
not has subject been discussed ad nauseam on [1] [2] [3] [4] [5], i've touched several times on why 1 should use real search engine, instead of attempting sort of half-hearted search approach.
there reason it's easier google website find results use built-in search, , primary component of failure.
with of said, answer question of how manually, since there no built-in contains, set server-side process loads/streams data memory , manual searching of contents, preferably sort of caching.
but honestly, elasticsearch faster , simpler, , more efficient here. since that's vast topic, i'll defer blog post on subject.
Comments
Post a Comment