HOSTED SEARCHBETA
Indexes and search
Search an index as people type: filters from parse, facets, the map and paging, answered in milliseconds.
Hosted search and WordPress are in private beta. Your account needs the beta enabled to use these APIs.
Search
POST
/api/v1/indexes/{index}/searchAuthenticationUse a key with search listings permission:
Manage API keys Authorization: Bearer <key>.curl -X POST https://nabdaq.dev/api/v1/indexes/main-listings/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filters": [
{
"field": "location",
"operator": "eq",
"value": "dubai_marina"
},
{
"field": "property_type",
"operator": "eq",
"value": "apartment"
},
{
"field": "bedrooms",
"operator": "eq",
"value": 2
},
{
"field": "price",
"operator": "lt",
"value": 2000000
}
],
"sort": [
{
"field": "price",
"direction": "asc"
}
],
"facets": [
"property_type",
"bedrooms",
"price"
],
"map": {
"mode": "points"
},
"page": 0,
"per_page": 20
}'| Body | Meaning |
|---|---|
filters | Exactly what parse returns (its extra keys are ignored). A filter the index cannot use comes back in ignored with a reason. |
sort | As parse returns it, or your own. Price sorts compare rents per year. |
keywords | Free words matched against title, building, project, reference and place; the last word as a prefix. |
geo | bbox [west, south, east, north], polygon (3–500 [lng, lat] points) or around { lat, lng, radius_m }. |
facets | Counts per value or range; each field ignores its own filter. |
map | points (up to 5,000, then clusters) or clusters for a zoom. |
page | per_page up to 50; the first 1,000 results of a query are reachable. |
min_revision | Read your own writes: waits up to 300 ms for that revision. |
With no results, relaxations says how many listings each dropped filter would give.
Real time
Writes are committed by the index's writer and answer with a new revision. Searches run in the Cloudflare data center nearest the visitor (Dubai for UAE visitors) from an in-memory copy, and see changes within about a second.
Create an index
In the dashboard under Indexes, once the private beta is enabled for your account.