Skip to main content
POST
/
6
/
{hashid}
/
_search
Search query (POST)
curl --request POST \
  --url https://{search_zone}-search.doofinder.com/6/{hashid}/_search \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "rpp": 123,
  "page": 123,
  "indices": [
    "<string>"
  ],
  "filter": {},
  "exclude": {},
  "facets": [
    {
      "field": "<string>",
      "size": 123
    }
  ],
  "sort": [
    {}
  ],
  "session_id": "<string>",
  "user_id": "<string>",
  "stats": true,
  "auto_filters": true,
  "custom_results": true,
  "excluded_results": true,
  "grouping": true,
  "with_variants": [
    "<string>"
  ],
  "skip_auto_filters": [
    "<string>"
  ],
  "skip_top_facet": [
    "<string>"
  ],
  "title_facet": true,
  "top_facet": true
}
'
{
  "custom_results_id": 5,
  "facets": [
    {
      "brand": {
        "terms": {
          "items": [
            {
              "name": "Adidas",
              "count": 5
            },
            {
              "name": "Nike",
              "count": 3
            }
          ],
          "selected": []
        }
      }
    }
  ],
  "query_name": "fuzzy",
  "results": [
    {
      "description": "The best product description ever",
      "dfid": "1234567890abcdef1234567890abcdef@product@1234567890abcdef",
      "id": "my_id",
      "image_url": "http://www.example.com/images/alt_product_image.jpg",
      "title": "My item",
      "url": "http://www.example.com/alt_product_description.htm"
    }
  ],
  "total": 1
}

Authorizations

Authorization
string
header
required

Doofinder API key. Pass it as: Authorization: Token <api_key>

Path Parameters

hashid
string
required

Unique id of a search engine.

Body

application/json

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.

filter_execution
enum<string>

Boolean logic applied to filters. Default is "and".

Available options:
and,
or
sort
object[]

Sort criteria. Each entry is a map of field name to direction (e.g. [{"price": "asc"}]).

query_name
enum<string>

Force a specific query type.

Available options:
match_and,
match_or,
fuzzy
session_id
string

Identifier of search session

Maximum string length: 32
user_id
string

Identifier of user

Maximum string length: 36
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

OK

Search response. Some fields can not be included in the request if they have not data.

banner
Banner Response · object

Banner response for a query search.

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
(Term Facet Response · object | Range Facet Response · object)[]

Information about different groupings that can be made for certain fields in the search results.

Facet terms search response. Used to aggregate a field by their values.

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 · object[]
total
integer

Total number of items that can be fetched.