Skip to main content
POST
/
ai
/
data
/
v1
/
search
Search publisher data
curl --request POST \
  --url https://platform.ai.gloo.com/ai/data/v1/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "How can I find true happiness?",
  "collection": "GlooProd",
  "tenant": "TestOrg",
  "certainty": 0.5,
  "limit": 1
}
'
{
  "data": [
    {
      "uuid": "12345678-abcd-1234-abcd-1234567890ab",
      "metadata": {
        "creation_time": "2025-09-02T23:49:49.338000Z",
        "last_update_time": "2025-09-02T23:50:36.348000Z",
        "distance": 0.39595216512680054,
        "certainty": 0.8020238876342773,
        "score": 0,
        "explain_score": "",
        "is_consistent": false,
        "rerank_score": null
      },
      "properties": {
        "item_title": "Finding True Happiness",
        "publisher": "Test Org",
        "publication_date": "2025-09-02",
        "snippet": "# Finding True Happiness: A Christian Perspective",
        "type": "Article",
        "item_id": "12345678-abcd-1234-abcd-1234567890aa"
      },
      "references": null,
      "vector": {},
      "collection": "GlooProd"
    }
  ],
  "intent": 1
}
This is a semantic search endpoint. It searches by meaning, not by exact keyword or prefix matching. Write queries as natural language questions or phrases for best results.

Before You Start

This endpoint uses AI-powered semantic search to find content based on the meaning of your query — not exact text matching. For example, a query like “secrets to a happy marriage” will return content about “rules for keeping a marriage healthy,” even though none of the exact words overlap. This is not a keyword or prefix search. Queries like "happ" or "happiness AND marriage" will not behave as expected. Use complete, natural-language phrases instead.

Search Developer Guide

Understand how semantic search works, how to tune the certainty threshold, and how to combine search with RAG.

Search Tutorial

Working code examples in 6 languages — JavaScript, TypeScript, Python, PHP, Go, and Java.

Tips for Effective Queries

  • Use natural language — “How can I find true happiness?” works better than “happiness find true”
  • Adjust certainty — The default threshold is 0.75, which is strict. If you’re getting few or no results, try lowering it to 0.5
  • Results are ranked by semantic distance — not keyword frequency. The certainty and distance fields in the response indicate how closely each result matches your query’s meaning

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
query
string
required

Search query.

Minimum string length: 1
collection
string
required

Collection to search in.

Minimum string length: 1
tenant
string
required

Tenant to search in.

certainty
number
default:0.75

The minimum certainty threshold for snippets.

Required range: 0 <= x <= 1
limit
integer
default:10

Maximum number of results to return.

Required range: x >= 1

Response

Successful response

data
object[]
required
intent
integer
required