public sealed class SearchRequest.Types.QueryExpansionSpec : IMessage<SearchRequest.Types.QueryExpansionSpec>, IEquatable<SearchRequest.Types.QueryExpansionSpec>, IDeepCloneable<SearchRequest.Types.QueryExpansionSpec>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1 API class SearchRequest.Types.QueryExpansionSpec.
Specification to determine under which conditions query expansion should
occur.
public SearchRequest.Types.QueryExpansionSpec.Types.Condition Condition { get; set; }
The condition under which query expansion should occur. Default to
[Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
Whether to pin unexpanded results. If this field is set to true,
unexpanded products are always at the top of the search results, followed
by the expanded results.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides reference documentation for the \u003ccode\u003eSearchRequest.Types.QueryExpansionSpec\u003c/code\u003e class within the Google Cloud Discovery Engine v1 API for .NET.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eQueryExpansionSpec\u003c/code\u003e class defines the specifications that control when query expansion should occur during a search.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the API documentation for the class \u003ccode\u003eSearchRequest.Types.QueryExpansionSpec\u003c/code\u003e is 1.6.0, with the ability to navigate down to the beta version of 1.0.0.\u003c/p\u003e\n"],["\u003cp\u003eThe class has two main properties: \u003ccode\u003eCondition\u003c/code\u003e, which specifies the conditions for query expansion, and \u003ccode\u003ePinUnexpandedResults\u003c/code\u003e, which determines if unexpanded results should be prioritized.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eQueryExpansionSpec\u003c/code\u003e class can be constructed using parameterless constructor, or by using another instance of \u003ccode\u003eSearchRequest.Types.QueryExpansionSpec\u003c/code\u003e as an argument.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1 API - Class SearchRequest.Types.QueryExpansionSpec (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec) \n\n public sealed class SearchRequest.Types.QueryExpansionSpec : IMessage\u003cSearchRequest.Types.QueryExpansionSpec\u003e, IEquatable\u003cSearchRequest.Types.QueryExpansionSpec\u003e, IDeepCloneable\u003cSearchRequest.Types.QueryExpansionSpec\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1 API class SearchRequest.Types.QueryExpansionSpec.\n\nSpecification to determine under which conditions query expansion should\noccur. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SearchRequest.Types.QueryExpansionSpec \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[SearchRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[QueryExpansionSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SearchRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[QueryExpansionSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[SearchRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[QueryExpansionSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.QueryExpansionSpec), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.DiscoveryEngine.V1](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1.dll\n\nConstructors\n------------\n\n### QueryExpansionSpec()\n\n public QueryExpansionSpec()\n\n### QueryExpansionSpec(QueryExpansionSpec)\n\n public QueryExpansionSpec(SearchRequest.Types.QueryExpansionSpec other)\n\nProperties\n----------\n\n### Condition\n\n public SearchRequest.Types.QueryExpansionSpec.Types.Condition Condition { get; set; }\n\nThe condition under which query expansion should occur. Default to\n\\[Condition.DISABLED\\]\\[google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED\\].\n\n### PinUnexpandedResults\n\n public bool PinUnexpandedResults { get; set; }\n\nWhether to pin unexpanded results. If this field is set to true,\nunexpanded products are always at the top of the search results, followed\nby the expanded results."]]