Search capabilities with Optimizely Graph
How to use search capabilities in Optimizely Graph to search your content in Content Management System (CMS) (SaaS).
Optimizely CMS (SaaS) uses Optimizely Graph, a headless content delivery API that lets you query and search your content.
Note
The Optimizely Graph documentation contains information on how to configure Optimizely Graph and get started.
If you are just getting started with GraphQL, see the official GraphQL documentation.
Query your content
Queries let you request specific data from the Optimizely servers, ensuring you retrieve only the information you need. You define which fields and relationships to include within a single query. Unlike traditional REST APIs, where you make multiple calls to different endpoints to fetch different data sets, GraphQL lets you request the data you need with a single query.
- Cyclic queries – Although against the GraphQL spec, Optimizely Graph supports self-referential queries.
- Recursive queries – You can traverse nested relationships by specifying query depth.
Important
Optimizely Graph also has parent and child queries, but they are deprecated. Optimizely Graph has replaced them with
_link
andjoins with linking
. See the Other features of Optimizely Graph section.
Arguments
Arguments act as parameters to refine your GraphQL queries.
- Locale – Fetch content based on location.
- Where – Apply conditions to filter and search for values within your query.
- Orderby – Sort the query results.
- Skip – Omit a specific number of results.
- Limit – Restrict the number of returned results.
- Filter IDs – Filter content items by their unique IDs (GUIDs).
- Cursor – Implement pagination of results.
Operators
Operators help refine queries based on field values. See Operators in the Optimizely Graph documentation.
match
– Search for exact or near-exact matches.contains
– Find values that contain a specific string.eq
ornoteq
– Equals or not equals.gt
,gte
,lt
,lte
– Greater than, greater than or equal, less than, less than or equal.exist
– Check for the presence of a field.startsWith
orendsWith
– Search by prefix or suffix.in
ornotIn
– Match against a list of values.like
– Pattern-based search.
Other features of Optimizely Graph
The following are available in Optimizely Graph to help you query your content:
- Inline fragments – Retrieve common fields across different content types in a single query.
- Synonyms – Expand keyword searches for better results.
- Boosting – Adjust ranking for relevance.
- Hit count – Display the number of results returned.
- Autocomplete – Implement word completion in search inputs.
- Modified and deleted content items – Query updates to content items.
- Joins with linking – Join data across content types and sources within a single query.
- Text extraction field – Extract text from PDFs and images to enable searchability.
Important
Stop words are deprecated. Optimizely Graph previously used them for filtering out common words.
Search in CMS (SaaS)
Optimizely Graph provides powerful search capabilities that can be categorized into filtering, full-text search, and faceted search. Searching in CMS (SaaS) using Optimizely Graph retrieves content from Optimizely Graph based on specified query parameters. It lets you filter, rank, and refine content retrieval. It enables structured and efficient content discovery from the headless CMS.
Filter
Filtering lets you refine search results by applying conditions to specific fields.
- Exact filtering – Filters content based on exact values.
eq
– Retrieve content where the field exactly matches a value.in
– Match against multiple exact values.
- Partial filtering – Filters content based on string matching.
startsWith
– Match strings by prefix.endsWith
– Match strings by suffix.
- Geo search – Filters content based on geographical location.
lat
– Latitude.lon
– Longitude.
- Logical connector – Filters content using Boolean connectors.
_and
– Combine multiple conditions._or
– Return results that match any condition._not
– Exclude specific results.
Full-text search
Full-text (lexical) search lets you do keyword-based searching across content text.
match
– Returns the most relevant results by applying text-matching techniques.contains
– Matches phrases exactly.- Fuzzy search – Handles misspellings using the following:
eq
ornotEq
– Match or exclude exact terms.in
ornotIn
– Match within a list.contains
ormatch
– Flexible keyword search.
- Semantic search – Goes beyond keyword matching by understanding the query's context and intent.
Note
Semantic search is an experimental feature and is subject to change.
- Highlight – Displays search result snippets containing the matched words.
Faceted Search
Faceted search lets you refine results using structured filters based on the following:
- Attributes (for example, categories or tags)
- Date ranges
- Pricing tiers
Updated 10 days ago