search

Search for documents

Changed on

Runs a search request for a certain tenant. The tenant should exist at the service and linked to a certain index in the backend. Different tenants may use the same index.

get/search-api/v1/search/{tenant}

Request

  • Base URL
    http://search-service
  • URL
    http://search-service/search-api/v1/search/{tenant}
  • Auth
    HTTP basic

Path parameters

tenantstring required

tenant name

Query parameters

limitinteger

The amount of products to return in the result

offsetinteger

The amount of products to omit from the whole result to select the returned results.

qstring

the user query

sortstring

Full sorting parameter value. This is the name of the sorting and optionally a dash as prefix, thats means the sorting should be descending. Several sorting criterion can be defined by separating the values using comma.

withFacetsboolean

flag to specify if facets should be returned with the requested response. Should be set to false in case only the next batch of hits is requested (e.g. for endless scrolling).

the query that describes the wished result

{
  "q": "blue shirt",
  "sort": "sort=price,-name (price asc and name descending)"
}
filtersobject

Any other parameter is considered as filter. Each one is validated according to the actual data and configuration. Each filter can have multiple values, separated by comma. Commas inside the values have to be double-URL encoded. Depending on the configured filter type these values are used differently (see examples).

Response

successful found results

inputURIstring URI

The URI that was used to get that result view. May be used to generate breadcrumbs.

metaobject
tookInMillisinteger

amount of time the internal search needed to compute that result

Example response

{
  "slices": [
    {
      "hits": [
        {
          "document": {
            "attributes": [
              {
                "name": "color",
                "value": "red",
                "code": "ff0000"
              }
            ],
            "categories": [
              [
                {
                  "id": "7001",
                  "name": "Electronics"
                },
                {
                  "id": "7011",
                  "name": "Notebooks"
                }
              ],
              [
                {
                  "id": "9000",
                  "name": "Sale"
                }
              ]
            ]
          }
        }
      ]
    }
  ]
}

Changes

    • info

      added subschema #13 to the ////// response property anyOf list for the response status

    • info

      added subschema #13 to the ////// response property anyOf list for the response status

    • info

      added subschema #7 subschema #8 subschema #9 subschema #10 subschema #11 subschema #12 to the ////// response property anyOf list for the response status

    • info

      added subschema #7 subschema #8 subschema #9 subschema #10 subschema #11 subschema #12 to the ////// response property anyOf list for the response status