← Back to APIs
RAG PIPELINE — KEYWORD SEARCH

Text Search (Keyword Search)

Run a BM25 full-text keyword search against your Azure AI Search index. The engine tokenizes the query and matches it against indexed document chunks, returning the top results ranked by keyword relevance. This is the simplest retrieval method and a good starting point in a RAG pipeline before adding semantic or vector search.

POST · Azure AI Search BM25 Full-Text Search Variables: azureAiSearch_ResourceName, azureAISearch_IndexName, azureAISearch_Key
01

Endpoint

POST https://{{azureAiSearch_ResourceName}}.search.windows.net/indexes/{{azureAISearch_IndexName}}/docs/search?api-version=2025-05-01-preview
PropertyValue
MethodPOST
Content-Typeapplication/json
ServiceAzure AI Search (direct API call)
API Version2025-05-01-preview
02

Postman Collection Variables Required

Set these variables in the Postman collection before calling this API azureAiSearch_ResourceName — Your Azure AI Search resource name
azureAISearch_IndexName — The name of your Azure AI Search index
azureAISearch_Key — Your Azure AI Search API key
03

Authentication

Azure AI Search API Key

Header: api-key{{azureAISearch_Key}}
04

Request Body

FieldTypeRequiredDescription
search String Required The query text to search for. Keywords are matched against all indexed text fields.
select String Optional Comma-separated list of fields to return. Example: "section,content". Omit to return all fields.
top Integer Optional Number of results to return. Default is 50. Use 3–5 for RAG context chunks.

Request Body (from Postman collection)

{
  "search" : "How do I configure Azure AI Search with OutSystems?",
  "select" : "section,content",
  "top"    : 3
}
05

Sample Request

cURL

curl -X POST \
  -H "api-key: <your-azure-search-key>" \
  -H "Content-Type: application/json" \
  -d '{"search":"How do I configure Azure AI Search?","select":"section,content","top":3}' \
  "https://<resource>.search.windows.net/indexes/<index>/docs/search?api-version=2025-05-01-preview"
06

Response — 200 OK

Sample Response

{
  "@odata.context" : "...",
  "value": [
    {
      "@search.score" : 4.2831,
      "section"       : "Configuring the Search Service",
      "content"       : "To configure Azure AI Search, navigate to your resource in the Azure portal..."
    },
    // more results...
  ]
}
07

Error Responses

200
OK — Search results returned. Empty value[] means no matches found.
401
Unauthorized — api-key header missing or invalid.
403
Forbidden — Key does not have read access to this index.
404
Not Found — Index does not exist in the specified Azure AI Search resource.
400
Bad Request — Malformed JSON or invalid field name in select.