Ger user by prefix

0 votes
Hi,

I have another question about the App42 API.

In our app, one of the features is to provide search suggestion when searching other users. Is there anyway or future plan to get a user by prefix?

For example, there are four users: John, jerry, Johnson and Wilson. If I search by "j" or "J", "Jone jerry Johnson" will pop up. If I search by "jO", "John Johnson" will pop up.

Thanks!
asked Jul 24, 2014 in App42 Cloud API-BaaS by Bob Anoop (19 points)
recategorized Oct 24, 2014 by sushil

1 Answer

+1 vote
Hi Anoop,
 
Kindly find the below code snippet in which you can add a query where key as "like" and value as "J" for finding the records of user using UserService.
 
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("like", "J");
userService.setOtherMetaHeaders(otherMetaHeaders);
ArrayList<User> getUsersObj = userService.getAllUsers();
 
The above code snippet is in Java, if you are working with other sdk then let me know or you can take refrence of this and send the input parameter in setOtherMetaHeaders function.
 
Thanks.
answered Jul 25, 2014 by hs00105 (517 points)
Ok I will have a try at that. Thanks!
Sure, let me know if it helps.
Thanks
Hey man it works perfectly!
I was wondering if there is any doc that describes the meta header fields because I cannot find it and it is so cool.
Search By Profile Info
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...