public sealed class SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec : IMessage<SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec>, IEquatable<SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec>, IDeepCloneable<SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1beta API class SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec.
Boost applies to documents which match a condition.
Strength of the condition boost, which should be in [-1, 1]. Negative
boost means demotion. Default is 0.0.
Setting to 1.0 gives the document a big promotion. However, it does
not necessarily mean that the boosted document will be the top result
at all times, nor that other documents will be excluded. Results
could still be shown even when none of them matches the condition.
And results that are significantly more relevant to the search query
can still trump your heavily favored but irrelevant documents.
Setting to -1.0 gives the document a big demotion. However, results
that are deeply relevant might still be shown. The document will have
an upstream battle to get a fairly high ranking, but it is not
blocked out completely.
Setting to 0.0 means no boost applied. The boosting condition is
ignored. Only one of the (condition, boost) combination or the
boost_control_spec below are set. If both are set then the global boost
is ignored and the more fine-grained boost_control_spec is applied.
An expression which specifies a boost condition. The syntax and
supported fields are the same as a filter expression. See
[SearchRequest.filter][google.cloud.discoveryengine.v1beta.SearchRequest.filter]
for detail syntax and limitations.
Examples:
To boost documents with document ID "doc_1" or "doc_2", and
color "Red" or "Blue":
(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))
[[["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 information for the \u003ccode\u003eConditionBoostSpec\u003c/code\u003e class within the Google Cloud Discovery Engine v1beta API, specifically for version 1.0.0-beta18.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eConditionBoostSpec\u003c/code\u003e is used to apply boosts to documents that match a specified condition, influencing their ranking in search results.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBoost\u003c/code\u003e property allows setting a boost value between -1 and 1, where negative values demote documents, positive values promote, and 0 means no boost is applied.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCondition\u003c/code\u003e property uses an expression syntax, similar to filter expressions, to define the criteria that documents must meet to receive the boost.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBoostControlSpec\u003c/code\u003e property is a more complex way to customize ranking based on customer defined attributes.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1beta API - Class SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec (1.0.0-beta19)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta19 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec)\n- [1.0.0-beta18](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/1.0.0-beta18/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec) \n\n public sealed class SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec : IMessage\u003cSearchRequest.Types.BoostSpec.Types.ConditionBoostSpec\u003e, IEquatable\u003cSearchRequest.Types.BoostSpec.Types.ConditionBoostSpec\u003e, IDeepCloneable\u003cSearchRequest.Types.BoostSpec.Types.ConditionBoostSpec\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1beta API class SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec.\n\nBoost applies to documents which match a condition. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec \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.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types)[BoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec.Types)[ConditionBoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SearchRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types)[BoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec.Types)[ConditionBoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[SearchRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types)[BoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec.Types)[ConditionBoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec), [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.V1Beta](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1Beta.dll\n\nConstructors\n------------\n\n### ConditionBoostSpec()\n\n public ConditionBoostSpec()\n\n### ConditionBoostSpec(ConditionBoostSpec)\n\n public ConditionBoostSpec(SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec other)\n\nProperties\n----------\n\n### Boost\n\n public float Boost { get; set; }\n\nStrength of the condition boost, which should be in \\[-1, 1\\]. Negative\nboost means demotion. Default is 0.0.\n\nSetting to 1.0 gives the document a big promotion. However, it does\nnot necessarily mean that the boosted document will be the top result\nat all times, nor that other documents will be excluded. Results\ncould still be shown even when none of them matches the condition.\nAnd results that are significantly more relevant to the search query\ncan still trump your heavily favored but irrelevant documents.\n\nSetting to -1.0 gives the document a big demotion. However, results\nthat are deeply relevant might still be shown. The document will have\nan upstream battle to get a fairly high ranking, but it is not\nblocked out completely.\n\nSetting to 0.0 means no boost applied. The boosting condition is\nignored. Only one of the (condition, boost) combination or the\nboost_control_spec below are set. If both are set then the global boost\nis ignored and the more fine-grained boost_control_spec is applied.\n\n### BoostControlSpec\n\n public SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec.Types.BoostControlSpec BoostControlSpec { get; set; }\n\nComplex specification for custom ranking based on customer defined\nattribute value.\n\n### Condition\n\n public string Condition { get; set; }\n\nAn expression which specifies a boost condition. The syntax and\nsupported fields are the same as a filter expression. See\n\\[SearchRequest.filter\\]\\[google.cloud.discoveryengine.v1beta.SearchRequest.filter\\]\nfor detail syntax and limitations.\n\nExamples:\n\n- To boost documents with document ID \"doc_1\" or \"doc_2\", and color \"Red\" or \"Blue\": `(document_id: ANY(\"doc_1\", \"doc_2\")) AND (color: ANY(\"Red\", \"Blue\"))`"]]