Class SearchRequest.BoostSpec.ConditionBoostSpec (0.26.0)

public static final class SearchRequest.BoostSpec.ConditionBoostSpec extends GeneratedMessageV3 implements SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder

Boost applies to documents which match a condition.

Protobuf type google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > SearchRequest.BoostSpec.ConditionBoostSpec

Static Fields

BOOST_FIELD_NUMBER

public static final int BOOST_FIELD_NUMBER
Field Value
TypeDescription
int

CONDITION_FIELD_NUMBER

public static final int CONDITION_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static SearchRequest.BoostSpec.ConditionBoostSpec getDefaultInstance()
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static SearchRequest.BoostSpec.ConditionBoostSpec.Builder newBuilder()
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec.Builder

newBuilder(SearchRequest.BoostSpec.ConditionBoostSpec prototype)

public static SearchRequest.BoostSpec.ConditionBoostSpec.Builder newBuilder(SearchRequest.BoostSpec.ConditionBoostSpec prototype)
Parameter
NameDescription
prototypeSearchRequest.BoostSpec.ConditionBoostSpec
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec.Builder

parseDelimitedFrom(InputStream input)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.BoostSpec.ConditionBoostSpec parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<SearchRequest.BoostSpec.ConditionBoostSpec> parser()
Returns
TypeDescription
Parser<ConditionBoostSpec>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getBoost()

public float getBoost()

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.

float boost = 2;

Returns
TypeDescription
float

The boost.

getCondition()

public String getCondition()

An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations.

Examples:

  • To boost documents with document ID "doc_1" or "doc_2", and color "Red" or "Blue":
    • (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))

string condition = 1;

Returns
TypeDescription
String

The condition.

getConditionBytes()

public ByteString getConditionBytes()

An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations.

Examples:

  • To boost documents with document ID "doc_1" or "doc_2", and color "Red" or "Blue":
    • (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))

string condition = 1;

Returns
TypeDescription
ByteString

The bytes for condition.

getDefaultInstanceForType()

public SearchRequest.BoostSpec.ConditionBoostSpec getDefaultInstanceForType()
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec

getParserForType()

public Parser<SearchRequest.BoostSpec.ConditionBoostSpec> getParserForType()
Returns
TypeDescription
Parser<ConditionBoostSpec>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public SearchRequest.BoostSpec.ConditionBoostSpec.Builder newBuilderForType()
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected SearchRequest.BoostSpec.ConditionBoostSpec.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public SearchRequest.BoostSpec.ConditionBoostSpec.Builder toBuilder()
Returns
TypeDescription
SearchRequest.BoostSpec.ConditionBoostSpec.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException