- [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2beta/QueryExpansionSpec.md.txt#SCHEMA_REPRESENTATION)
- [Condition](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2beta/QueryExpansionSpec.md.txt#Condition)

Specification to determine under which conditions query expansion should occur.

| JSON representation |
|---|
| ``` { "condition": enum (`Condition`), "pinUnexpandedResults": boolean } ``` |

| Fields ||
|---|---|
| `condition` | ``enum (`Condition`)`` The condition under which query expansion should occur. Default to `Condition.DISABLED`. |
| `pinUnexpandedResults` | `boolean` Whether to pin unexpanded results. The default value is false. If this field is set to true, unexpanded products are always at the top of the search results, followed by the expanded results. |

## Condition

Enum describing under which condition query expansion should occur.

| Enums ||
|---|---|
| `CONDITION_UNSPECIFIED` | Unspecified query expansion condition. In this case, server behavior defaults to `Condition.DISABLED`. |
| `DISABLED` | Disabled query expansion. Only the exact search query is used, even if `SearchResponse.total_size` is zero. |
| `AUTO` | Automatic query expansion built by Google Retail Search. |