MXP Platform

Search API

Discovery service REST endpoints for product search, autocomplete, and visual search

The Discovery service is the primary search API for MXP. All endpoints are served from the Discovery pod (default port 8080).

Endpoints

MethodPathDescription
POST/searchMulti-stage semantic/full-text product search
GET/searchSearch via query string (browser-friendly, hidden from Swagger)
POST/vector-searchDense-embedding approximate nearest-neighbour search
POST/images/searchVisual search — upload an image to find visually similar products

Catalog

MethodPathDescription
GET/itemsList products in the catalog for a tenant
GET/item/{id}Fetch a single product by ID

Autocomplete

MethodPathDescription
GET/suggestionsRanked autocomplete suggestions by query prefix

Recommendations

MethodPathDescription
POST/recommendationsProduct recommendations (proxied to Recommendation System)

Categories

MethodPathDescription
POST/categoriesBrowse categories for a tenant
POST/categories/levelsCategory tree by level

Multi-tenancy

MethodPathDescription
GET/tenantsList available tenant identifiers

POST /search

Executes the full multi-stage pipeline: QUS semantic parsing → merchandising rules → staged Elasticsearch search → facet calculation → optional Google Retail fallback.

Request body

{
  "query": "blue running shoes",
  "tenant": "my-tenant",
  "size": 20,
  "from": 0,
  "filters": [{ "field": "brand", "value": "Nike" }],
  "facets": ["brand", "color", "price"],
  "sort": "relevance"
}
FieldTypeRequiredDescription
querystringYesNatural language search query
tenantstringYesTenant identifier (must match a GCS config directory)
sizeintegerNoNumber of results to return (default: 20)
fromintegerNoPagination offset (default: 0)
filtersarrayNoPre-applied field filters
facetsarrayNoFacets to compute and return
sortstringNorelevance (default), price_asc, price_desc

Response

{
  "products": [
    {
      "id": "SKU-12345",
      "title": "Nike Air Zoom Pegasus 40",
      "price": 130.00,
      "brand": "Nike",
      "color": "Blue",
      "score": 0.987
    }
  ],
  "total": 142,
  "facets": {
    "brand": [{ "value": "Nike", "count": 34 }],
    "color": [{ "value": "Blue", "count": 17 }]
  },
  "queryGraph": { ... }
}

POST /vector-search

Encodes the query string into a dense embedding vector and performs approximate nearest-neighbour search against pre-indexed product embeddings.

Requires the Vector Search service to be running and configured.

Request body

Same structure as POST /search. The query field is converted to a dense vector via the configured ML provider (AWS Bedrock Titan/Claude or Google Gemini).


POST /images/search

Accepts a multipart image upload and returns visually similar products.

Request (multipart/form-data)

FieldTypeDescription
filebinaryProduct image (JPEG or PNG)
tenantstringTenant identifier (query param)

GET /suggestions

Returns ranked autocomplete suggestions for a query prefix.

Query parameters

ParameterTypeRequiredDescription
qStrstringYesQuery prefix (must not be blank)
tenantstringNoTenant identifier (defaults to default)

Response

[
  { "suggestion": "jeans", "type": "query" },
  { "suggestion": "jeans slim fit", "type": "query" },
  { "suggestion": "jean jacket", "type": "query" }
]