Skip to main content

Problem

You need to answer transactional questions—such as “is this provider in-network for cardiology?”—without denormalizing data. Traversed properties let the Search API expose vetted fields from related resources so you can filter precisely while staying within a single request.

Prerequisites

  • A partition where the traversed property is configured as filterable. See Traversed properties overview.
  • The traversed path prefixed with @<traversed-property-name>.@<other-collection-key> in your partition schema. See Traversed property notation for more information on traversed property paths.
  • Workspace credentials that can call the Search API.

Steps

1. Shape the filter for the transactional question

Map the user question to the traversed field. For example, if cardiology services are exposed as @hasDiscipline.@service.code, an equality filter answers “does this clinic provide cardiology?”:
{
  "filter": {
    "eq": {
      "@hasDiscipline.@service.code": "cardiology"
    }
  },
  "traversedProperties": ["@hasDiscipline.@service.code"]
}

2. Send the Search API request

Combine the filter with your usual pagination or sorting parameters. The Search API treats the traversed field like a native attribute, making the call safe for synchronous, per-click experiences.
curl -X POST "https://$CLINIA_WORKSPACE/partitions/{partitionKey}/v1/collections/{collectionKey}/query" \
  -H "X-Clinia-API-Key: $CLINIA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    {
      "filter": {
        "eq": {
          "@hasDiscipline.@service.code": "cardiology"
        }
      },
      "traversedProperties": ["@hasDiscipline.@service.code"]
    },
    "page": 0,
    "size": 10
  }'
Parse the JSON response as you would for any search request; the hits that remain all satisfy the traversed constraint.
I