Search API

Search for products

post

Search for products

Authorizations
Body
strategystring · enumRequired

Strategy to use for search

Example: SEMANTICPossible values:
schemaIdstringRequired

ID of the product schema you're querying against

Example: ticketed-events
querystringRequired

The search term

Example: speakeasy venues to listen to live music and have a cocktail
topNintegerRequired

Number of results to retrieve

Example: 10
fullTextSearchFieldsstring[]Optional

Array of product property paths to use in a full-text and hybrid search. Note that only properties marked as full-text searchable in the product schema will be able to be used here.

Example: ["name","description"]
profileIdstringOptional

Unique identifier of the anonymous or known profile. Only required when using a geo filter on the profile's location.

Example: abcd-1234-abcd-1234
Responses
200

Fetched search results successfully

No content

post
POST /search HTTP/1.1
Host: product-api.userflux.co
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 615

{
  "strategy": "SEMANTIC",
  "schemaId": "ticketed-events",
  "query": "speakeasy venues to listen to live music and have a cocktail",
  "topN": 10,
  "fullTextSearchFields": [
    "name",
    "description"
  ],
  "filter": {
    "propertyFiltersJoin": "AND",
    "propertyFilters": [
      {
        "property": "category",
        "operator": "EQUAL",
        "dataType": "STRING",
        "value": "music"
      }
    ],
    "geoFilter": {
      "type": "RADIUS",
      "radius": {
        "source": "CUSTOM",
        "distance": 25,
        "distanceUnit": "KILOMETERS",
        "latitude": 51.5074,
        "longitude": -0.1278
      },
      "geoBox": {
        "pair": "NE_SW",
        "northLatitude": 51.5074,
        "northLongitude": -0.1278,
        "southLatitude": 51.5074,
        "southLongitude": -0.1278
      }
    }
  },
  "profileId": "abcd-1234-abcd-1234"
}

No content

Last updated