Example: Search for Profiles with an Email Address
Retrieve up to 5 profiles with an email address in the database. This query checks for the existence of theprofile_info.emails
field.
Example: Search for Data Science Professionals
Search for 10 people working in data science. Usingmatch
query we perform a full text search, meaning that we may get people who currently work as data scientists or in a similar position.
Perform an Exact Match Search
Thanks to mappingprofile_info.current_title
as both text
and keyword
(See OpenSearch Mapping), we can easily perform an exact search on this field. Below we search for people whose role is titled “Data Scientist”. Mind that we use term
query to perform the search.
Combine Multiple Search Conditions
To perform a search based on multiple conditions, we need to use a boolean query. We want all the conditions to be met, somust
clause is the proper one. The below query will return all Software Developers working at The Swarm company. For other logical operation refer to OpenSearch documentation.
Search for Recently Updated Profiles
Retrieve profiles in theInformation Technology and Services
industry that had their current job updated within a specific date range. This query uses a combination of range and term filters.
Search by Location and Past Experience
Retrieve profiles of people located in the United States who previously held a product-related role at Google. This query uses a nested query to access past experiences and excludes current roles with the must_not clause.Search by Company Name in Work Experience
Retrieve profiles of people with current or past experience at Google. This query uses a nested query to match work history by company name.Search by Company Name in Past Experience
Retrieve profiles of people who have worked at Google in the past but are not currently employed there. This query uses a nested query to search for past experience at Google and a must_not clause to exclude current employment at the company.Search for Profiles with Recent Job Changes
This query retrieves profiles with newly updated job roles. Thecurrent_job_updated_at
field is used to filter profiles based on a specified time range. The date in the range filter can be adjusted to target job changes relevant to the specific use case.