Reputation: 610
I have a "User" entity with the these properties: id, first_name, last_name, email, etc.
What's the best way to search for a full name? That combining first_name and last name of course. I couldn't find String-contains like query
Upvotes: 1
Views: 31
Reputation: 39814
You could split the full name you want to search for into first name and last name, then perform a query filtered with 2 equality checks on the 2 properties combined with an AND
condition.
The exact syntax depends on the datastore library you use.
And you need to have a composite index for that query.
Upvotes: 1