# ccdw_aggr_search_query

This table provides details on search queries and their outcomes.

> **Note:** This table is constrained by IP Address Filters configured in Business Manager.

:::note
`ccdw_aggr_search_query` aggregates data specifically from search events, while `ccdw_aggr_search` aggregates data directly from visits. Because these tables track different events and methods, aggregating the `ccdw_aggr_search_query` table doesn't reproduce the same numerical results found in `ccdw_aggr_search`.
:::

| Column Alias                        | Data Type | Key    | Description                                                                                                    | Index? |
| ----------------------------------- | --------- | ------ | -------------------------------------------------------------------------------------------------------------- | ------ |
| `search_date`                       | DATE      |        | Date of the search activity.                                                                                   | Yes    |
| `site_id`                           | SMALLINT  | **FK** | Foreign key to [`ccdw_dim_site`](/docs/commerce/b2c-commerce/guide/jdbc_ccdw_dim_site.md).                     | Yes    |
| `registered`                        | BOOLEAN   |        | Boolean indicating if the user was registered.                                                                 | Yes    |
| `device_class_code`                 | VARCHAR   | **FK** | Device class code from [`ccdw_dim_user_agent`](/docs/commerce/b2c-commerce/guide/jdbc_ccdw_dim_user_agent.md). | Yes    |
| `locale_code`                       | VARCHAR   | **FK** | Locale code from [`ccdw_dim_locale`](/docs/commerce/b2c-commerce/guide/jdbc_ccdw_dim_locale.md).               | Yes    |
| `query`                             | VARCHAR   |        | The actual search query entered.                                                                               | Yes    |
| `num_searches_with_results`         | INTEGER   |        | Number of searches for this query that yielded results.                                                        | No     |
| `num_searches_without_results`      | INTEGER   |        | Number of searches for this query that yielded no results.                                                     | No     |
| `num_results`                       | INTEGER   |        | Total number of search results returned for this query.                                                        | No     |
| `num_visits_with_search_results`    | INTEGER   |        | Number of visits that included searches with results.                                                          | No     |
| `num_visits_without_search_results` | INTEGER   |        | Number of visits that included searches without results.                                                       | No     |
| `num_clicks`                        | INTEGER   |        | Total number of clicks on search results for this query.                                                       | No     |
