Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

HomeDev GuideRecipesAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

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.

🚧

Important

Optimizely Graph also has parent and child queries, but they are deprecated. Optimizely Graph has replaced them with _link and joins 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 or noteq – 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 or endsWith – Search by prefix or suffix.
  • in or notIn – 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:

🚧

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:
    • eqornotEq – Match or exclude exact terms.
    • in or notIn – Match within a list.
    • contains or match – 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