QuickBlox / q-municate-ios

Q-municate iOS repository
http://q-municate.com
MIT License
163 stars 86 forks source link

How Fuzzy search can be implemented? #334

Open kushal211 opened 6 years ago

kushal211 commented 6 years ago

Hi,

I would like to know that is there any way by which I can implement fuzzy search? I want to implement search on the phone number.

e.g. if I search for a phone number "347376", then it will get me the user which has the phone number "XX347376XX".

ghost commented 6 years ago

hi @kushal211, as for QBUser - there is no such feature,

You should use custom objects for this and fetch 'em using ctn operator:

Operator Applicable to types Usage example Description
lt Integer, Float score_value[lt]=1000 Less Than operator
lte Integer, Float score_value[lte]=850 Less Than or Equal to operator
gt Integer, Float bonus_count[gt]=2.45 Greater Than operator
gte Integer, Float bonus_count[gte]=56.443 Greater Than or Equal to operator
ne Integer, Float, String, Boolean game_mode_name[ne]=ctf Not Equal to operator
in Integer, Float, String game_mode_name[in]=deathmatch,rage Contained IN array operator
nin Integer, Float, String game_mode_name[nin]=survivor,crazy_nightmare Not contained IN array
all Array game_modes[all]=survivor,crazy ALL contained IN array
or Integer, Float, String 1.name[or]=sam,igor2.name[or]=sam&lastname[or]=johnson 1.Will return records with name sam or igor 2.Will return records with name sam or lastname johnson
ctn String username[ctn]=son Will return all records where username field contains son substring
ghost commented 6 years ago

Hi @kushal211, Any updates?

kushal211 commented 6 years ago

Hi @pro100andrey ,

Yes, I was also thought the same. This thing can be possible using custom objects. I need to store user detail in Custom objects like Name, Phone number and search for it using query. It seems little extra process.

But can you please take it as a requested feature for your next updates or so. This thing is really helpful.

Thank You :)