Class SearchRequest.CrowdingSpec.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<SearchRequest.CrowdingSpec.Builder>
com.google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Builder
All Implemented Interfaces:
SearchRequest.CrowdingSpecOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
SearchRequest.CrowdingSpec

public static final class SearchRequest.CrowdingSpec.Builder extends com.google.protobuf.GeneratedMessage.Builder<SearchRequest.CrowdingSpec.Builder> implements SearchRequest.CrowdingSpecOrBuilder
 Specification for crowding. Crowding improves the diversity of search
 results by limiting the number of results that share the same field value.
 For example, crowding on the color field with a max_count of 3 and mode
 DROP_CROWDED_RESULTS will return at most 3 results with the same color
 across all pages.
 
Protobuf type google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<SearchRequest.CrowdingSpec.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<SearchRequest.CrowdingSpec.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<SearchRequest.CrowdingSpec.Builder>
    • getDefaultInstanceForType

      public SearchRequest.CrowdingSpec getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public SearchRequest.CrowdingSpec buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public SearchRequest.CrowdingSpec.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SearchRequest.CrowdingSpec.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<SearchRequest.CrowdingSpec.Builder>
    • mergeFrom

      public SearchRequest.CrowdingSpec.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SearchRequest.CrowdingSpec.Builder>
      Throws:
      IOException
    • getField

      public String getField()
       The field to use for crowding. Documents can be crowded by a field in the
       [Document][google.cloud.discoveryengine.v1.Document] object. Crowding
       field is case sensitive.
       
      string field = 1;
      Specified by:
      getField in interface SearchRequest.CrowdingSpecOrBuilder
      Returns:
      The field.
    • getFieldBytes

      public com.google.protobuf.ByteString getFieldBytes()
       The field to use for crowding. Documents can be crowded by a field in the
       [Document][google.cloud.discoveryengine.v1.Document] object. Crowding
       field is case sensitive.
       
      string field = 1;
      Specified by:
      getFieldBytes in interface SearchRequest.CrowdingSpecOrBuilder
      Returns:
      The bytes for field.
    • setField

      public SearchRequest.CrowdingSpec.Builder setField(String value)
       The field to use for crowding. Documents can be crowded by a field in the
       [Document][google.cloud.discoveryengine.v1.Document] object. Crowding
       field is case sensitive.
       
      string field = 1;
      Parameters:
      value - The field to set.
      Returns:
      This builder for chaining.
    • clearField

       The field to use for crowding. Documents can be crowded by a field in the
       [Document][google.cloud.discoveryengine.v1.Document] object. Crowding
       field is case sensitive.
       
      string field = 1;
      Returns:
      This builder for chaining.
    • setFieldBytes

      public SearchRequest.CrowdingSpec.Builder setFieldBytes(com.google.protobuf.ByteString value)
       The field to use for crowding. Documents can be crowded by a field in the
       [Document][google.cloud.discoveryengine.v1.Document] object. Crowding
       field is case sensitive.
       
      string field = 1;
      Parameters:
      value - The bytes for field to set.
      Returns:
      This builder for chaining.
    • getMaxCount

      public int getMaxCount()
       The maximum number of documents to keep per value of the field. Once
       there are at least max_count previous results which contain the same
       value for the given field (according to the order specified in
       `order_by`), later results with the same value are "crowded away".
       If not specified, the default value is 1.
       
      int32 max_count = 2;
      Specified by:
      getMaxCount in interface SearchRequest.CrowdingSpecOrBuilder
      Returns:
      The maxCount.
    • setMaxCount

      public SearchRequest.CrowdingSpec.Builder setMaxCount(int value)
       The maximum number of documents to keep per value of the field. Once
       there are at least max_count previous results which contain the same
       value for the given field (according to the order specified in
       `order_by`), later results with the same value are "crowded away".
       If not specified, the default value is 1.
       
      int32 max_count = 2;
      Parameters:
      value - The maxCount to set.
      Returns:
      This builder for chaining.
    • clearMaxCount

      public SearchRequest.CrowdingSpec.Builder clearMaxCount()
       The maximum number of documents to keep per value of the field. Once
       there are at least max_count previous results which contain the same
       value for the given field (according to the order specified in
       `order_by`), later results with the same value are "crowded away".
       If not specified, the default value is 1.
       
      int32 max_count = 2;
      Returns:
      This builder for chaining.
    • getModeValue

      public int getModeValue()
       Mode to use for documents that are crowded away.
       
      .google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode mode = 3;
      Specified by:
      getModeValue in interface SearchRequest.CrowdingSpecOrBuilder
      Returns:
      The enum numeric value on the wire for mode.
    • setModeValue

      public SearchRequest.CrowdingSpec.Builder setModeValue(int value)
       Mode to use for documents that are crowded away.
       
      .google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode mode = 3;
      Parameters:
      value - The enum numeric value on the wire for mode to set.
      Returns:
      This builder for chaining.
    • getMode

       Mode to use for documents that are crowded away.
       
      .google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode mode = 3;
      Specified by:
      getMode in interface SearchRequest.CrowdingSpecOrBuilder
      Returns:
      The mode.
    • setMode

       Mode to use for documents that are crowded away.
       
      .google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode mode = 3;
      Parameters:
      value - The mode to set.
      Returns:
      This builder for chaining.
    • clearMode

       Mode to use for documents that are crowded away.
       
      .google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode mode = 3;
      Returns:
      This builder for chaining.