---
title: "search"

doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/storefront-api/products/queries/search'
  md: 'https://developer.shopline.com/docs/storefront-api/products/queries/search.md'
---
# search

- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Type Signature

`SearchResultItemConnection`

## Arguments

* `after`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  Returns elements following the specified cursor. The `first` argument must also be specified when using this argument.

* `before`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  Returns elements preceding the specified cursor. The `last` argument must also be specified when using this argument.

* `first`

  [Int](https://developer.shopline.com/docs/storefront-api/common/scalars/int.md)

  Returns the first n elements in the list. 

* `last`

  [Int](https://developer.shopline.com/docs/storefront-api/common/scalars/int.md)

  Returns the last n elements in the list. 

* `reverse`

  [Boolean](https://developer.shopline.com/docs/storefront-api/common/scalars/boolean.md)

  Whether to reverse the order of the list. 
  
  ● true: reverse
  
  ● false: do not reverse
  
  Default value: false

* `sortKey`

  [SearchSortKeys](https://developer.shopline.com/docs/storefront-api/products/enums/search-sort-keys.md)

  Sort the underlying list by the given key.

* `productFilters`

  [[ProductFilterInput]](https://developer.shopline.com/docs/storefront-api/products/inputs/product-filter-input.md)

  Returns a subset of products matching all product filters. The input must not contain more than 250 values.

* `rawQuery`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  The search query.

## Returns

* `edges`

  [[SearchResultItemEdge!]](https://developer.shopline.com/docs/storefront-api/products/objects/search-result-item-edge.md)

  A list of edges.

* `nodes`

  [[Product]](https://developer.shopline.com/docs/storefront-api/products/objects/product.md)

  A list of the nodes contained in SearchResultItemEdge.

* `pageInfo`

  [PageInfo!](https://developer.shopline.com/docs/storefront-api/online-store/objects/page-info.md)

  Information to aid in pagination.
  

* `productFilters`

  [[Filter]](https://developer.shopline.com/docs/storefront-api/common-objects/objects/filter.md)

  A list of available filters.

* `totalCount`

  [Int](https://developer.shopline.com/docs/storefront-api/common/scalars/int.md)

  The total number of results.

## Code Example

```graphql
 {
	search(after, before, first, last, reverse, sortKey, productFilters, rawQuery ) 
		 {
			# SearchResultItemConnection fields
		}
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/storefront-api/overview.md#status-and-error-codes).

