---
title: search_queries
description: >-
  Reference for the ShopifyQL `search_queries` table. Every metric and
  dimension, paired with worked example queries.
api_version: 2026-07
source_url:
  html: >-
    https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/search_queries
  md: >-
    https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/search_queries.md
api_name: shopifyql
---

# search\_​queries

The `search_queries` [schema](https://shopify.dev/docs/api/shopifyql/latest/schemas) captures online store search with one row per search term. Use it to report how often terms are searched and how often they get a click, rather than for broader funnel analysis.

### Use cases

* **Query volume**: Group [`search_queries`](#searchqueriesmetric-propertydetail-searchqueries) by [`search_query`](#searchqueriesdimension-propertydetail-searchquery) to rank the most-searched terms.
* **Clicked queries**: Filter [`search_result_was_clicked`](#searchqueriesdimension-propertydetail-searchresultwasclicked) when counting queries that resulted in a click.
* **Click trend**: Trend [`search_queries_with_clicks`](#searchqueriesmetric-propertydetail-searchquerieswithclicks) by week to see how often searches lead to a click over time.

Examples

### Examples

* ####

  ##### Description

  Show the 50 most-run \`search\_queries\` last month, split by whether the result was clicked. This example uses \[\`HAVING\`]\(/docs/api/shopifyql/latest/syntax/having) \`search\_queries > 10\` to drop long-tail queries from the ranking.

  ##### ShopifyQL

  ```shopifyql
  FROM search_queries
    SHOW search_queries, search_queries_with_clicks
    GROUP BY search_query, search_result_was_clicked WITH TOTALS, GROUP_TOTALS
    HAVING search_queries > 10
    DURING last_month
    ORDER BY search_queries DESC
    LIMIT 50
  VISUALIZE search_queries TYPE list_with_dimension_values
  ```

* ####

  ##### Description

  Break down \`search\_queries\` and clicked queries by hour of day this month. This example uses \[\`WITH TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with#total-columns) to add the total across all hours.

  ##### ShopifyQL

  ```shopifyql
  FROM search_queries
    SHOW search_queries, search_queries_with_clicks
    GROUP BY hour_of_day WITH TOTALS
    DURING this_month
    ORDER BY hour_of_day ASC
  VISUALIZE search_queries TYPE grouped_bar
  ```

* ####

  ##### Description

  Compare \`search\_queries\` and \`search\_queries\_with\_clicks\` last month against the month before. This example uses \[\`COMPARE TO previous\_period\`]\(/docs/api/shopifyql/latest/syntax/compare-to) to benchmark your date range against the equal-length period right before it.

  ##### ShopifyQL

  ```shopifyql
  FROM search_queries
    SHOW search_queries, search_queries_with_clicks
    WITH PERCENT_CHANGE
    DURING last_month
    COMPARE TO previous_period
  ```

* ####

  ##### Description

  Track weekly \`search\_queries\_with\_clicks\` across this quarter. This example uses \[\`WITH TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with#total-columns) to add a quarter-to-date total beside the weekly rows.

  ##### ShopifyQL

  ```shopifyql
  FROM search_queries
    SHOW search_queries_with_clicks
    TIMESERIES week WITH TOTALS
    DURING this_quarter
    ORDER BY week ASC
  VISUALIZE search_queries_with_clicks TYPE bar
  ```

***

## Metrics

Counts and calculations that let you track key business indicators. Metrics show up as the columns when queried.

Metrics you can use when querying `FROM search_queries`.

* **search\_​queries**

  **INTEGER**

  Number of search queries

* **search\_​queries\_​with\_​clicks**

  **INTEGER**

  Number of search queries in which the customer clicked on a search result

### INTEGER

A whole number without decimal places, used for counts, quantities, and other discrete numeric values.

```ts
```

***

## Dimensions

Attributes of your data that let you look more granularly at aspects of the data. Group and filter by dimensions to shape the rows your query returns.

Dimensions you can use when querying `FROM search_queries`.

* **day**

  **DAY\_TIMESTAMP**

  Day (timestamp) the data was recorded

* **day\_​of\_​week**

  **DAY\_OF\_WEEK**

  The day of the week, with values Monday through Sunday.

* **hour**

  **HOUR\_TIMESTAMP**

  Hour (timestamp) the data was recorded

* **hour\_​of\_​day**

  **HOUR\_OF\_DAY**

  The hour of the day, with values 0 through 23.

* **minute**

  **MINUTE\_TIMESTAMP**

  Minute (timestamp) the data was recorded

* **month**

  **MONTH\_TIMESTAMP**

  Month (timestamp) the data was recorded

* **month\_​of\_​year**

  **MONTH\_OF\_YEAR**

  The month of the year, with values 1 through 12.

* **quarter**

  **QUARTER\_TIMESTAMP**

  Quarter (timestamp) the data was recorded

* **search\_​query**

  **STRING**

  Search query made on your online store

* **search\_​result\_​was\_​clicked**

  **BOOLEAN**

  Whether a search led to a click on one of its results, with values `true` and `false`.

* **second**

  **SECOND\_TIMESTAMP**

  Second (timestamp) the data was recorded

* **shop\_​id**

  **IDENTITY**

  The unique Shopify identifier for your store. Use [`shop_id`](#searchqueriesdimension-propertydetail-shopid) with [`shop_name`](#searchqueriesdimension-propertydetail-shopname) to show readable store labels.

* **week**

  **WEEK\_TIMESTAMP**

  Week (timestamp) the data was recorded

* **week\_​of\_​year**

  **WEEK\_OF\_YEAR**

  The week of the year, with values 1 through 53.

* **year**

  **YEAR\_TIMESTAMP**

  Year (timestamp) the data was recorded

* **shop\_​name**

  **STRING**

  Name of your store

### DAY\_TIMESTAMP

A date value truncated to day precision.

```ts
```

### DAY\_OF\_WEEK

A day within a week, used for weekday-based grouping and filtering.

```ts
```

### HOUR\_TIMESTAMP

A timestamp truncated to hour precision.

```ts
```

### HOUR\_OF\_DAY

An hour within a day, typically represented as an integer from 0 to 23.

```ts
```

### MINUTE\_TIMESTAMP

A timestamp truncated to minute precision.

```ts
```

### MONTH\_TIMESTAMP

A date value representing the start of a month.

```ts
```

### MONTH\_OF\_YEAR

A month number within a year.

```ts
```

### QUARTER\_TIMESTAMP

A date value representing the start of a fiscal quarter.

```ts
```

### STRING

A sequence of characters representing text data.

```ts
```

### BOOLEAN

A true or false value representing binary states.

```ts
```

### SECOND\_TIMESTAMP

A timestamp truncated to second precision.

```ts
```

### IDENTITY

A unique identifier for a Shopify resource such as a customer, product, or order.

```ts
```

### WEEK\_TIMESTAMP

A date value representing the start of a week.

```ts
```

### WEEK\_OF\_YEAR

A week number within a year.

```ts
```

### YEAR\_TIMESTAMP

A date value representing the start of a year.

```ts
```

***

## Related schemas

* [`searches`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/searches): Storewide search volume and intent for a higher-level view of search activity.
* [`search_conversions`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/search_conversions): Search-driven funnel volume for tracking queries downstream to checkout.
* [`global_searches`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/global_searches): Catalog exposure from search requests outside your storefront.

***
