Skip to main content
GET
/
api
/
v2
/
search
Busca unificada multi-coleção (v2)
curl --request GET \
  --url https://services.pref.rio/app-busca-search/api/v2/search \
  --header 'Authorization: Bearer <token>'
{
  "collections": [
    "<string>"
  ],
  "filtered_count": 123,
  "metadata": {},
  "page": 123,
  "per_page": 123,
  "results": [
    {
      "collection": "<string>",
      "data": {},
      "id": "<string>",
      "score_info": {
        "final_score": 123,
        "hybrid_score": 123,
        "passed_threshold": true,
        "recency_factor": 123,
        "text_match_normalized": 123,
        "threshold_applied": "<string>",
        "threshold_value": 123,
        "vector_similarity": 123
      },
      "type": "<string>"
    }
  ],
  "search_type": "keyword",
  "total_count": 123
}

Authorizations

Authorization
string
header
required

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

Query Parameters

q
string
required

Texto da busca

type
string
required

Tipo de busca: keyword, semantic, hybrid

page
integer
default:1

Número da página (mínimo: 1)

per_page
integer
default:10

Resultados por página (máximo: 100)

include_inactive
boolean
default:false

Incluir documentos inativos (aplica-se apenas a coleções com filtro de status)

alpha
number
default:0.3

Alpha para busca hybrid (0-1). Alpha=0.3 significa 30% texto + 70% vetor.

threshold_keyword
number

Score mínimo para busca keyword (0-1, filtra text_match normalizado)

threshold_semantic
number

Score mínimo para busca semantic (0-1, filtra por similaridade vetorial)

threshold_hybrid
number

Score mínimo para busca hybrid (0-1, filtra score híbrido)

search_fields
string

Override dos campos de busca (comma-separated). Ex: titulo,descricao,conteudo

search_weights
string

Override dos pesos de busca (comma-separated). Ex: 4,2,1

Response

OK

collections
string[]

Which collections were searched

filtered_count
integer

Após aplicar thresholds

metadata
object

Para AI search

page
integer
per_page
integer
results
object[]
search_type
enum<string>
Available options:
keyword,
semantic,
hybrid,
ai
total_count
integer

Total original do Typesense (across all collections)