Skip to content

    Pre-launch API. The concepts described here are settled, but the API shape is not: request and response fields, parameters and defaults can still change. Build against it, and talk to your Luigi's Box contact before you put an integration into production.

    Compute facets for a result set

    View source
    Deprecated
    GET
    /discovery/v1/facets
    curl --request GET \
    --url 'https://api.eu1.luigisbox.ai/discovery/v1/facets?channel_id=example&guid=example&facet_fields=example&debug=false' \
    --header 'Authorization: Bearer <token>'

    Compute facets for a previously executed search or listing.

    Rate limited: a 429 carries Retry-After.

    Facets are computed over the result set identified by guid: per-field values for a keyword field, min/max bounds for a numeric one.

    channel_id
    required
    Channel Id

    Channel identifier (serving destination).

    string
    >= 1 characters

    Channel identifier (serving destination).

    guid
    required
    Guid

    GUID from a prior /search or /listing response to facet on.

    string
    >= 1 characters

    GUID from a prior /search or /listing response to facet on.

    facet_fields
    required
    Facet Fields

    Comma-separated facet fields. Each entry is a plain field name or ‘name^count’ where count limits the number of returned keyword facet values (positive integer). Use ’^’ for namespaced fields, e.g. ‘lbx:price^30’. The ‘name:count’ form is also accepted.

    string

    Comma-separated facet fields. Each entry is a plain field name or ‘name^count’ where count limits the number of returned keyword facet values (positive integer). Use ’^’ for namespaced fields, e.g. ‘lbx:price^30’. The ‘name:count’ form is also accepted.

    hierarchy_anchor
    Hierarchy Anchor

    Open branches to expand in hierarchical facets. Each value is ’:<node_path>’ where node_path is the fully expanded, ’ > ‘-joined node path (e.g. ‘lbx:category_hierarchy:category/jewelry > category/rings’). Repeatable across fields and open branches; omitted expands roots only.

    Array<string>

    Open branches to expand in hierarchical facets. Each value is ’:<node_path>’ where node_path is the fully expanded, ’ > ‘-joined node path (e.g. ‘lbx:category_hierarchy:category/jewelry > category/rings’). Repeatable across fields and open branches; omitted expands roots only.

    hierarchy_depth
    Hierarchy Depth

    Requested child-level expansion for hierarchical facets. Each value is ’:’ where depth is the number of child levels to expand from the roots and must be between 1 and 5 (e.g. ‘lbx:category_hierarchy:5’). A field may appear at most once. Values outside the range, non-integers, and repeated fields are rejected with 422.

    Array<string>

    Requested child-level expansion for hierarchical facets. Each value is ’:’ where depth is the number of child levels to expand from the roots and must be between 1 and 5 (e.g. ‘lbx:category_hierarchy:5’). A field may appear at most once. Values outside the range, non-integers, and repeated fields are rejected with 422.

    debug
    Debug

    Request ranking diagnostics. Honoured only on the first page for callers holding discovery:debug; silently ignored otherwise.

    boolean

    Request ranking diagnostics. Honoured only on the first page for callers holding discovery:debug; silently ignored otherwise.

    Successful Response

    Media type application/json
    FacetsResponse

    Response of the facets endpoint.

    object
    debug
    Any of:
    object
    key
    additional properties
    any
    facets
    required
    Facet

    Per-field facet aggregation results. Values, bounds and counts cover only the objects this channel can serve.

    object
    key
    additional properties
    Any of:
    TermsFacet

    Terms facet — distinct values for a categorical field.

    object
    field
    required
    Field

    The faceted field name.

    string
    type
    Type
    string
    default: terms
    Allowed value: terms
    values
    Values
    Array<string>
    guid
    required
    Guid

    GUID identifying this result set.

    string
    Example
    {
    "facets": {
    "additionalProperty": {
    "type": "terms"
    }
    }
    }

    Malformed request

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Missing or invalid credentials

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Authenticated but not permitted

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Resource not found

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Request validation failed

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Rate limit exceeded

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Upstream service failed

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    validation_errors
    Any of:
    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }