PlatformXeDocs
Get API Key

Search

SDK methods for the federated search index — upsert resources and query across apps.

The client.search namespace upserts records into PlatformXe's federated search index and queries it. Available in TypeScript, Python, and Go SDKs.

SDKInstallNamespace
TypeScriptnpm install @caldera/platformxe-sdkclient.search
Pythonpip install platformxeclient.search
Gogo get github.com/calderaxe/platformxe-goclient.Search

Index a resource

Upserts are accepted asynchronously (HTTP 202). The actual write is performed by the inngest worker; results may take a few seconds to appear in queries.

The app fraud (any case or padding) is reserved for PlatformXe's fraud desk: indexing under it is 400 RESERVED_SEARCH_APP (ErrCodeReservedSearchApp in Go).

await client.search.index({
  app: 'lettings',
  entityType: 'PROPERTY',
  entityId: 'prop_abc',
  title: 'Lekki Penthouse',
  subtitle: '3-bed, oceanfront, Lagos',
  keywords: 'lekki lagos penthouse 3 bedroom oceanfront luxury',
  rank: 100,
  metadata: { pricePerNightNGN: 75000, bedrooms: 3 },
});

Query

ILIKE search across title + keywords. Returns at most 20 results. Queries shorter than 2 characters return an empty array. Entries of the reserved app fraud are never returned to an API key, whatever its scopes (app=fraud finds nothing); they show only in portal search, behind the fraud pages' access rule.

const results = await client.search.query({ q: 'lekki', app: 'lettings' });
for (const r of results) {
  console.log(r.entityType, r.entityId, r.title);
}
results = client.search.query(q="lekki", app="lettings")
results, err := client.Search.Query("lekki", "lettings")

Index request fields

FieldTypeDescription
appstringSource app owning the resource.
entityTypestringPolymorphic entity kind (PROPERTY, BOOKING, PARTNER).
entityIdstringStable identifier of the entity.
titlestringDisplay title surfaced in search results.
subtitlestring (optional)Searchable snippet.
keywordsstring (optional)Space-separated terms used in the ILIKE search.
ranknumber (optional)Higher values rank higher in results.
metadataRecord<string, unknown> (optional)Echoed back in query results.

Scopes required

MethodScope
search.index()search:index
search.query()search:read