Skip to content

Search Rail

Full-text search and filtering endpoints.

The Search rail provides:

  • Full-text search across resources
  • Faceted filtering
  • Real-time indexing
  • Typo tolerance

Powered by our search engine for fast, relevant results.

POST /v1/search
const results = await iof.search.query({
index: "contracts",
query: "murabaha vehicle",
filters: {
status: "active",
type: ["MURABAHA", "IJARAH"],
},
limit: 20,
});

Response:

{
"hits": [
{
"id": "contract_abc",
"type": "MURABAHA",
"description": "Vehicle financing - Toyota Camry",
"status": "active",
"_score": 0.95
}
],
"totalHits": 42,
"processingTimeMs": 12,
"facets": {
"type": {
"MURABAHA": 30,
"IJARAH": 12
},
"status": {
"active": 35,
"draft": 7
}
}
}
POST /v1/search/multi
const results = await iof.search.multiQuery({
queries: [
{ index: "contracts", query: "murabaha" },
{ index: "customers", query: "john" },
],
});
GET /v1/search/suggest
const suggestions = await iof.search.suggest({
index: "contracts",
query: "mura",
limit: 5,
});

Response:

{
"suggestions": ["murabaha", "murabaha vehicle", "murabaha property"]
}
IndexDescription
contractsAll contracts
customersCustomer records
transactionsTransaction history
documentsUploaded documents
OperatorExample
=status = "active"
!=type != "DRAFT"
>, <amount > 10000
>=, <=createdAt >= "2024-01-01"
INtype IN ["MURABAHA", "IJARAH"]
TOamount 1000 TO 50000
OptionDescription
limitResults per page (max 100)
offsetPagination offset
sortSort field and direction
facetsEnable faceted counts
highlightHighlight matches
  • Typical response: < 50ms
  • Max results: 1000 per query
  • Real-time indexing: < 100ms delay