ios - Parse.com user search without regex -


i have app have users user name , spot real name. allow users query find other users. query looks this:

pfquery *userquery = [pfuser query]; [userquery wherekey:kcpusername containsstring:[searchtext lowercasestring]];  pfquery *userrealnamequery = [pfuser query]; [usernamequery wherekey:kcpuserfullname containsstring: searchtext];  pfquery *userrealnamewithcapsquery = [pfuser query]; [userrealnamewithcapsquery wherekey:kcpuserfullname containsstring:[searchtext capitalizedstring]];  pfquery *userrealnamewithlowerquery = [pfuser query]; [userrealnamewithlowerquery wherekey:kcpuserfullname containsstring:[searchtext lowercasestring]];  pfquery *finalquery = [pfquery orquerywithsubqueries:@[userquery, userrealnamequery, userrealnamewithcapsquery, userrealnamewithlowerquery]]; 

this works great, returning list of users match searchtext. however, i've become aware containsstring uses regex, if have many users searching @ same time run 80 regex queries / min limitation in parse. using hasprefix: uses regex. query can think of use equalto: method, mean user must know looking , how spell names (either user or real).

any suggestions?

my final solution problem create separate field, call combined_names. field concatenation of real , user names (all lowercase). can single regex call on , same results. while not removing regex calls, goes 4 calls 1.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -