---
title: "Search"
method: POST
path: "/api/v2/search"
tags: ["SearchV2"]
---

# Search

`POST /api/v2/search`

The Search method is used to retrieve <b>search results</b> or to retrieve the contents for a <b>Landing Page</b> . Either the <i>Keyword</i> or <i>CustomUrl</i> parameter should be included anytime this method is used. The following are use-cases for when this method should be used.

## Request body

- SearchRequest — Search params
  - `IndexName` string — Search a given index
  - `Query` string — Custom search query
  - `Variant` VariantOptions
    - `CountFacetHitOnChild` boolean — Return facet count based on child hits
    - `PageNo` integer
    - `MaxPerPage` integer — Count of hawk child attributes hits
    - `SortCode` string
    - `SortBy` string
  - `BoostQueries` BoostQueries[]
    - `Query` string
    - `Boost` number, float
  - `DistanceUnitType` 1 | 2 | 3 — Defines type of distance unit; Miles [1], Meters [2], Kilometers [3] Default value is set to Miles [1]
  - `RequestType` 0 | 1 | 2 | 3 | 4 | 5 | 6 — Defines the type of search being performed. DefaultSearch is teh keyword or landing page request.
  - `ImageData` string — Base64 encoded image
  - `ImageText` string — Optional additional text description of an image
  - `kValue` integer — Optional additional text description of an image
  - `FacetHierarchyLevelOverride` object — Facet Hierarchy Level Override
  - `NestedId` string — Nested Id
  - `ClientGuid` string — API Client Guid
  - `Keyword` string — Search term. If term isn’t included we search everything
  - `PageId` integer
  - `PageNo` integer — Current page number
  - `MaxPerPage` integer — Max number of elements on a page
  - `SearchWithin` string
  - `SortBy` string — Sort by a filed name
  - `SortingSetCode` string — Set sorting set evaluation override
  - `PaginationSetCode` string — Set pagination set evaluation override
  - `FacetSelections` object — Selected facets names with values
  - `CustomUrl` string — Landing page Custom URL
  - `IsInPreview` boolean — Flag set to true will display elements in a preview mode. Flag set to false will display live data
  - `Is100CoverageTurnedOn` boolean — Flag set to true will display elements in a preview mode. Flag set to false will display live data
  - `ExplainDocId` string — Explain document id
  - `FacetOverride` string[] — An array of facet names that Elastic Search will return in a response
  - `FieldOverride` string[] — An array of field names that Elastic Search will return in a response
  - `SmartBar` SmartBar — Smart Bar turns On/Off: 'Boost and Bury', 'Visibility Rules', 'Presonalized Boost', 'Popularity Boost', 'Item Pin Processor' , 'KeywordReplacement'
    - `BoostAndBury` boolean
    - `VisibilityRules` boolean
    - `PersonalizedBoost` boolean
    - `PopularityBoost` boolean
    - `ItemPin` boolean
    - `PopularitySalesBoost` boolean
    - `PopularityAdd2CartBoost` boolean
    - `PopularityLandingPageBoost` boolean
    - `KeywordReplacement` boolean
    - `PreviewDate` string, date-time
  - `ClientData` ClientData
    - `VisitorId` string, uuid
    - `VisitId` string, uuid
    - `Custom` object
    - `ExtendedCustom` object
    - `PreviewBuckets` integer[]
    - `Source` string
    - `Origin` Coordinate
      - `Latitude` number, double
      - `Longitude` number, double
    - `ZipCode` string
  - `SearchType` string — Defines type of search; RegularSearch [1] or RefineSearch [2]
  - `IgnoreSpellcheck` boolean — If flag is set, spellcheck is being ignored, original keyword is used for query

## Response `200`

OK

- object

---

[API](https://skmtc.net/hawksearch/apis/hawksearch-elasticsearch-indexingapi.md) · [All operations](https://skmtc.net/hawksearch/apis/hawksearch-elasticsearch-indexingapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hawksearch/hawksearch-elasticsearch-indexingapi/versions/24cba7bf3468/schema)
