---
title: "Search query (POST)"
method: POST
path: "/6/{hashid}/_search"
tags: ["Search"]
---

# Search query (POST)

`POST /6/{hashid}/_search`

Search through indexed items of a search engine.
Identical to the GET variant but accepts parameters as a JSON body,
which is useful when query strings would be too long or when sending
complex nested structures (filters, facets, sort).

## Path parameters

- `hashid` string, required

## Request body

- SearchRequest — Search parameters sent as a JSON body. All fields are optional.
  - `query` string — The search term. Cannot be longer than 200 characters or 10 words.
  - `rpp` integer — Results per page (max 100, rpp * page < 1000).
  - `page` integer — Page number of the results to return.
  - `indices` string[] — Restrict the search to one or more indices (e.g. ["product", "page"]).
  - `filter` object — Filter parameters for items. Keys are field names, values are lists of terms or range objects (gte, lte, gt, lt).
  - `exclude` object — Negative filters. Same structure as filter.
  - `facets` object[] — Aggregations to compute. Each entry must include a "field" key.
    - `field` string
    - `size` integer
    - `type` 'term' | 'range'
  - `filter_execution` 'and' | 'or' — Boolean logic applied to filters. Default is "and".
  - `sort` object[] — Sort criteria. Each entry is a map of field name to direction (e.g. [{"price": "asc"}]).
  - `query_name` 'match_and' | 'match_or' | 'fuzzy' — Force a specific query type.
  - `session_id` string — Identifier of search session
  - `user_id` string — Identifier of user
  - `stats` boolean — Enable/Disable this search in stats reports. Default: true
  - `auto_filters` boolean — Enable/Disable auto filters feature. Default: false
  - `custom_results` boolean — Enable/Disable custom results feature. Default: true
  - `excluded_results` boolean — Enable/Disable excluded items feature. Default: true
  - `grouping` boolean — Enable/Disable grouping of variants as single items.
  - `with_variants` string[] — When grouping is active, include a df_variants array in each hit with the listed fields from each variant document.
  - `skip_auto_filters` string[] — Fields to exclude from auto_filters processing.
  - `skip_top_facet` string[] — Fields to exclude from top_facet processing.
  - `title_facet` boolean — Enable/Disable title_facet feature. Default: false
  - `top_facet` boolean — Enable/Disable top_facet feature. Default: false

## Response `200`

OK

- SearchResponse — Search response. Some fields can not be included in the request if they have not data.
  - `banner` BannerResponse — Banner response for a query search.
    - `blank` boolean — Display the banner link in a new window.
    - `html_code` string — Html code to be used as banner instead of an image.
    - `id` integer — Banner identification.
    - `image` string — Image URL used as banner.
    - `link` string — URL to be redirected when click over banner.
    - `mobile_image` string — Image URL used as banner for mobile devices.
  - `count` integer — Total number of items found in the search engine for the searched term.
  - `custom_results_id` integer — Id of applied custom results. This field will not be included if none of the custom results apply.
  - `dynamic_boosting_rule_id` integer — Id of applied dynamic boosting rule. This field will not be included if none of the dynamic boosting rules apply.
  - `facets` union[] — Information about different groupings that can be made for certain fields in the search results.
    - union
      - TermFacetResponse — Facet terms search response. Used to aggregate a field by their values.
        - `key` string — Name of the aggregated field.
        - `terms` object — Facet terms list
          - `items` object[]
            - `count` integer — Number of elements
            - `name` string — Name of the term
          - `selected` object[] — Items that are selected as part of a filter.
            - `count` integer — Number of elements
            - `name` string — Name of the term
      - RangeFacetResponse — Facet range search response. Used to return the min and max values for the aggregated field.
        - `key` string — Name of the aggregated field.
        - `range` object
          - `from` number — Selected start point of the range.
          - `max` number — Maximum value of the field.
          - `min` number — Minimum value of the field.
          - `to` number — Selected end point of the range.
  - `query_name` string — In order to get the best possible results, Doofinder tries several types of querying. This is the type of the query Doofinder made to obtain these results.
  - `results` Item[]
    - `description` string — Item description.
    - `dfid` string, required — Doofinder result doofinder id. It comes in every Doofinder results for every item.
    - `id` string, required — Unique identification of an indexed item.
    - `image_url` string — Item image url.
    - `title` string, required — Item title.
    - `url` string — Item url.
  - `total` integer — Total number of items that can be fetched.

## Other responses

- `400` — Bad Request — invalid query parameters (invalid rpp, page, query_name, sort, filter_execution, session_id, or user_id).
- `403` — Forbidden — missing or invalid API token, client IP is blocked, or CORS `Origin` not allowed.
- `404` — Not Found — search engine mapping does not exist.

---

[API](https://skmtc.dev/doofinder/apis/recommendations-api.md) · [All operations](https://skmtc.dev/doofinder/apis/recommendations-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/doofinder/recommendations-api/revisions/50dc63ab0921/schema)
