Class LookupDef.Builder

java.lang.Object
ai.vectros.types.LookupDef.Builder
All Implemented Interfaces:
LookupDef._FinalStage, LookupDef.FieldNameStage
Enclosing class:
LookupDef

public static final class LookupDef.Builder extends Object implements LookupDef.FieldNameStage, LookupDef._FinalStage
  • Method Details

    • from

      public LookupDef.Builder from(LookupDef other)
      Specified by:
      from in interface LookupDef.FieldNameStage
    • fieldName

      public LookupDef._FinalStage fieldName(@NotNull @NotNull String fieldName)

      Name of the payload field to index.

      Name of the payload field to index.

      Specified by:
      fieldName in interface LookupDef.FieldNameStage
      Returns:
      Reference to this so that method calls can be chained together.
    • allowOverflow

      public LookupDef._FinalStage allowOverflow(Boolean allowOverflow)

      Each schema has a fixed budget of fast exact-match lookup indexes. An exact-match lookup beyond that budget is rejected unless you set this flag, which opts the field into a higher-cost secondary index (more storage and transactional writes). Range-enabled lookups do not count against the budget. This flag has no effect on a field that fits within the budget.

      Specified by:
      allowOverflow in interface LookupDef._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • allowOverflow

      public LookupDef._FinalStage allowOverflow(Optional<Boolean> allowOverflow)

      Each schema has a fixed budget of fast exact-match lookup indexes. An exact-match lookup beyond that budget is rejected unless you set this flag, which opts the field into a higher-cost secondary index (more storage and transactional writes). Range-enabled lookups do not count against the budget. This flag has no effect on a field that fits within the budget.

      Specified by:
      allowOverflow in interface LookupDef._FinalStage
    • sortBy

      public LookupDef._FinalStage sortBy(String sortBy)

      For an exact-match lookup, the index sort key: createdAt (the default), lastUpdated, or a declared field on this schema. This setting is locked once the field is created.

      Specified by:
      sortBy in interface LookupDef._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • sortBy

      public LookupDef._FinalStage sortBy(Optional<String> sortBy)

      For an exact-match lookup, the index sort key: createdAt (the default), lastUpdated, or a declared field on this schema. This setting is locked once the field is created.

      Specified by:
      sortBy in interface LookupDef._FinalStage
    • rangeEnabled

      public LookupDef._FinalStage rangeEnabled(Boolean rangeEnabled)

      If true, this field also supports ordered range and prefix lookups (from/to/prefix) in addition to exact-match lookups. Range-enabled fields are billed at the range-index rate. Cannot be set on a sensitive field, because a blind index is not orderable. This setting is locked once the field is created.

      Specified by:
      rangeEnabled in interface LookupDef._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • rangeEnabled

      public LookupDef._FinalStage rangeEnabled(Optional<Boolean> rangeEnabled)

      If true, this field also supports ordered range and prefix lookups (from/to/prefix) in addition to exact-match lookups. Range-enabled fields are billed at the range-index rate. Cannot be set on a sensitive field, because a blind index is not orderable. This setting is locked once the field is created.

      Specified by:
      rangeEnabled in interface LookupDef._FinalStage
    • unique

      public LookupDef._FinalStage unique(Boolean unique)

      If true, enforces that this field's value is unique within your account.

      Specified by:
      unique in interface LookupDef._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • unique

      public LookupDef._FinalStage unique(Optional<Boolean> unique)

      If true, enforces that this field's value is unique within your account.

      Specified by:
      unique in interface LookupDef._FinalStage
    • build

      public LookupDef build()
      Specified by:
      build in interface LookupDef._FinalStage
    • additionalProperty

      public LookupDef.Builder additionalProperty(String key, Object value)
      Specified by:
      additionalProperty in interface LookupDef._FinalStage
    • additionalProperties

      public LookupDef.Builder additionalProperties(Map<String,Object> additionalProperties)
      Specified by:
      additionalProperties in interface LookupDef._FinalStage