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 v1 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.v1.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 page provides reference documentation for the \u003ccode\u003eSearchRequest.Types.BoostSpec.Types.ConditionBoostSpec\u003c/code\u003e class within the Google Cloud Discovery Engine v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eConditionBoostSpec\u003c/code\u003e class is used to apply boosts to documents that match a specified condition, offering control over document ranking.\u003c/p\u003e\n"],["\u003cp\u003eIt supports setting a \u003ccode\u003eBoost\u003c/code\u003e value (ranging from -1.0 to 1.0) to promote or demote documents based on the defined \u003ccode\u003eCondition\u003c/code\u003e, and a \u003ccode\u003eBoostControlSpec\u003c/code\u003e to create custom rankings.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this class is 1.6.0, with several earlier versions also available, including 1.5.0, 1.4.0, 1.3.0, 1.2.0, 1.1.0, and 1.0.0-beta06.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1 API - Class SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec (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.BoostSpec.Types.ConditionBoostSpec)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.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 v1 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.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[BoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types)[ConditionBoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types.ConditionBoostSpec), [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)[BoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types)[ConditionBoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.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.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types)[BoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SearchRequest.Types.BoostSpec.Types)[ConditionBoostSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.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.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### 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.v1.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\"))`"]]