Search Rail
Search Rail
Section titled “Search Rail”Full-text search and filtering endpoints.
Overview
Section titled “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
Section titled “Endpoints”Search
Section titled “Search”POST /v1/searchconst 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 } }}Multi-Index Search
Section titled “Multi-Index Search”POST /v1/search/multiconst results = await iof.search.multiQuery({ queries: [ { index: "contracts", query: "murabaha" }, { index: "customers", query: "john" }, ],});Get Suggestions
Section titled “Get Suggestions”GET /v1/search/suggestconst suggestions = await iof.search.suggest({ index: "contracts", query: "mura", limit: 5,});Response:
{ "suggestions": ["murabaha", "murabaha vehicle", "murabaha property"]}Searchable Indices
Section titled “Searchable Indices”| Index | Description |
|---|---|
contracts | All contracts |
customers | Customer records |
transactions | Transaction history |
documents | Uploaded documents |
Filter Operators
Section titled “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
Section titled “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
Section titled “Performance”- Typical response: < 50ms
- Max results: 1000 per query
- Real-time indexing: < 100ms delay
Next Steps
Section titled “Next Steps”- Analytics Rail - Data insights
- API Overview - All endpoints