Search Rail
Full-text search and filtering endpoints.
Overview
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.
Endpoints
Search
http
POST /v1/searchtypescript
const results = await iof.search.query({
index: "contracts",
query: "murabaha vehicle",
filters: {
status: "active",
type: ["MURABAHA", "IJARAH"],
},
limit: 20,
});Response:
json
{
"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
}
}
}Multi-Index Search
http
POST /v1/search/multitypescript
const results = await iof.search.multiQuery({
queries: [
{ index: "contracts", query: "murabaha" },
{ index: "customers", query: "john" },
],
});Get Suggestions
http
GET /v1/search/suggesttypescript
const suggestions = await iof.search.suggest({
index: "contracts",
query: "mura",
limit: 5,
});Response:
json
{
"suggestions": ["murabaha", "murabaha vehicle", "murabaha property"]
}Searchable Indices
| Index | Description |
|---|---|
contracts | All contracts |
customers | Customer records |
transactions | Transaction history |
documents | Uploaded documents |
Filter Operators
| Operator | Example |
|---|---|
= | status = "active" |
!= | type != "DRAFT" |
>, < | amount > 10000 |
>=, <= | createdAt >= "2024-01-01" |
IN | type IN ["MURABAHA", "IJARAH"] |
TO | amount 1000 TO 50000 |
Search Options
| Option | Description |
|---|---|
limit | Results per page (max 100) |
offset | Pagination offset |
sort | Sort field and direction |
facets | Enable faceted counts |
highlight | Highlight matches |
Performance
- Typical response: < 50ms
- Max results: 1000 per query
- Real-time indexing: < 100ms delay
Next Steps
- Analytics Rail - Data insights
- API Overview - All endpoints