v1

latestOpenAPI 3.0.02026-07-22122745.8 KB
Search

Search query (POST)

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).

post/6/{hashid}/_search

Path parameters

hashidstring required

Unique id of a search engine.

Request body

querystring

The search term. Cannot be longer than 200 characters or 10 words.

rppinteger

Results per page (max 100, rpp * page < 1000).

pageinteger

Page number of the results to return.

indicesstring[]

Restrict the search to one or more indices (e.g. ["product", "page"]).

filterobject

Filter parameters for items. Keys are field names, values are lists of terms or range objects (gte, lte, gt, lt).

excludeobject

Negative filters. Same structure as filter.

filter_execution'and' | 'or'

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

sortobject[]

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_idstring

Identifier of search session

user_idstring

Identifier of user

statsboolean

Enable/Disable this search in stats reports. Default: true

auto_filtersboolean

Enable/Disable auto filters feature. Default: false

custom_resultsboolean

Enable/Disable custom results feature. Default: true

excluded_resultsboolean

Enable/Disable excluded items feature. Default: true

groupingboolean

Enable/Disable grouping of variants as single items.

with_variantsstring[]

When grouping is active, include a df_variants array in each hit with the listed fields from each variant document.

skip_auto_filtersstring[]

Fields to exclude from auto_filters processing.

skip_top_facetstring[]

Fields to exclude from top_facet processing.

title_facetboolean

Enable/Disable title_facet feature. Default: false

top_facetboolean

Enable/Disable top_facet feature. Default: false

Response

OK

countinteger

Total number of items found in the search engine for the searched term.

custom_results_idinteger

Id of applied custom results. This field will not be included if none of the custom results apply.

dynamic_boosting_rule_idinteger

Id of applied dynamic boosting rule. This field will not be included if none of the dynamic boosting rules apply.

query_namestring

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.

totalinteger

Total number of items that can be fetched.

Example response

{
  "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
}