Interface RetrievalFilter.Builder

All Superinterfaces:
Buildable, CopyableBuilder<RetrievalFilter.Builder,RetrievalFilter>, SdkBuilder<RetrievalFilter.Builder,RetrievalFilter>, SdkPojo
Enclosing class:
RetrievalFilter

@Mutable @NotThreadSafe public static interface RetrievalFilter.Builder extends SdkPojo, CopyableBuilder<RetrievalFilter.Builder,RetrievalFilter>
  • Method Details

    • andAll

      Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.

      Parameters:
      andAll - Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • andAll

      Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.

      Parameters:
      andAll - Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • andAll

      Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.

      This is a convenience method that creates an instance of the RetrievalFilter.Builder avoiding the need to create one manually via RetrievalFilter.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to andAll(List<RetrievalFilter>).

      Parameters:
      andAll - a consumer that will call methods on RetrievalFilter.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • equalsValue

      RetrievalFilter.Builder equalsValue(FilterAttribute equalsValue)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value matches the value in this object.

      The following example would return data sources with an animal attribute whose value is cat:

      "equals": { "key": "animal", "value": "cat" }

      Parameters:
      equalsValue - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value matches the value in this object.

      The following example would return data sources with an animal attribute whose value is cat:

      "equals": { "key": "animal", "value": "cat" }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • equalsValue

      default RetrievalFilter.Builder equalsValue(Consumer<FilterAttribute.Builder> equalsValue)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value matches the value in this object.

      The following example would return data sources with an animal attribute whose value is cat:

      "equals": { "key": "animal", "value": "cat" }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to equalsValue(FilterAttribute).

      Parameters:
      equalsValue - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • greaterThan

      RetrievalFilter.Builder greaterThan(FilterAttribute greaterThan)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than the value in this object.

      The following example would return data sources with an year attribute whose value is greater than 1989:

      "greaterThan": { "key": "year", "value": 1989 }

      Parameters:
      greaterThan - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than the value in this object.

      The following example would return data sources with an year attribute whose value is greater than 1989:

      "greaterThan": { "key": "year", "value": 1989 }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • greaterThan

      default RetrievalFilter.Builder greaterThan(Consumer<FilterAttribute.Builder> greaterThan)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than the value in this object.

      The following example would return data sources with an year attribute whose value is greater than 1989:

      "greaterThan": { "key": "year", "value": 1989 }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to greaterThan(FilterAttribute).

      Parameters:
      greaterThan - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • greaterThanOrEquals

      RetrievalFilter.Builder greaterThanOrEquals(FilterAttribute greaterThanOrEquals)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object.

      The following example would return data sources with an year attribute whose value is greater than or equal to 1989:

      "greaterThanOrEquals": { "key": "year", "value": 1989 }

      Parameters:
      greaterThanOrEquals - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object.

      The following example would return data sources with an year attribute whose value is greater than or equal to 1989:

      "greaterThanOrEquals": { "key": "year", "value": 1989 }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • greaterThanOrEquals

      default RetrievalFilter.Builder greaterThanOrEquals(Consumer<FilterAttribute.Builder> greaterThanOrEquals)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object.

      The following example would return data sources with an year attribute whose value is greater than or equal to 1989:

      "greaterThanOrEquals": { "key": "year", "value": 1989 }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to greaterThanOrEquals(FilterAttribute).

      Parameters:
      greaterThanOrEquals - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • in

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object.

      The following example would return data sources with an animal attribute that is either cat or dog:

      "in": { "key": "animal", "value": ["cat", "dog"] }

      Parameters:
      in - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object.

      The following example would return data sources with an animal attribute that is either cat or dog:

      "in": { "key": "animal", "value": ["cat", "dog"] }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • in

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object.

      The following example would return data sources with an animal attribute that is either cat or dog:

      "in": { "key": "animal", "value": ["cat", "dog"] }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to in(FilterAttribute).

      Parameters:
      in - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • lessThan

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than the value in this object.

      The following example would return data sources with an year attribute whose value is less than to 1989.

      "lessThan": { "key": "year", "value": 1989 }

      Parameters:
      lessThan - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than the value in this object.

      The following example would return data sources with an year attribute whose value is less than to 1989.

      "lessThan": { "key": "year", "value": 1989 }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • lessThan

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than the value in this object.

      The following example would return data sources with an year attribute whose value is less than to 1989.

      "lessThan": { "key": "year", "value": 1989 }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to lessThan(FilterAttribute).

      Parameters:
      lessThan - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • lessThanOrEquals

      RetrievalFilter.Builder lessThanOrEquals(FilterAttribute lessThanOrEquals)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object.

      The following example would return data sources with an year attribute whose value is less than or equal to 1989.

      "lessThanOrEquals": { "key": "year", "value": 1989 }

      Parameters:
      lessThanOrEquals - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object.

      The following example would return data sources with an year attribute whose value is less than or equal to 1989.

      "lessThanOrEquals": { "key": "year", "value": 1989 }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • lessThanOrEquals

      default RetrievalFilter.Builder lessThanOrEquals(Consumer<FilterAttribute.Builder> lessThanOrEquals)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object.

      The following example would return data sources with an year attribute whose value is less than or equal to 1989.

      "lessThanOrEquals": { "key": "year", "value": 1989 }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to lessThanOrEquals(FilterAttribute).

      Parameters:
      lessThanOrEquals - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • listContains

      RetrievalFilter.Builder listContains(FilterAttribute listContains)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is a list that contains the value as one of its members.

      The following example would return data sources with an animals attribute that is a list containing a cat member (for example ["dog", "cat"]).

      "listContains": { "key": "animals", "value": "cat" }

      Parameters:
      listContains - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is a list that contains the value as one of its members.

      The following example would return data sources with an animals attribute that is a list containing a cat member (for example ["dog", "cat"]).

      "listContains": { "key": "animals", "value": "cat" }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • listContains

      default RetrievalFilter.Builder listContains(Consumer<FilterAttribute.Builder> listContains)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is a list that contains the value as one of its members.

      The following example would return data sources with an animals attribute that is a list containing a cat member (for example ["dog", "cat"]).

      "listContains": { "key": "animals", "value": "cat" }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to listContains(FilterAttribute).

      Parameters:
      listContains - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • notEquals

      Knowledge base data sources are returned when:

      • It contains a metadata attribute whose name matches the key and whose value doesn't match the value in this object.

      • The key is not present in the document.

      The following example would return data sources that don't contain an animal attribute whose value is cat.

      "notEquals": { "key": "animal", "value": "cat" }

      Parameters:
      notEquals - Knowledge base data sources are returned when:

      • It contains a metadata attribute whose name matches the key and whose value doesn't match the value in this object.

      • The key is not present in the document.

      The following example would return data sources that don't contain an animal attribute whose value is cat.

      "notEquals": { "key": "animal", "value": "cat" }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • notEquals

      Knowledge base data sources are returned when:

      • It contains a metadata attribute whose name matches the key and whose value doesn't match the value in this object.

      • The key is not present in the document.

      The following example would return data sources that don't contain an animal attribute whose value is cat.

      "notEquals": { "key": "animal", "value": "cat" }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to notEquals(FilterAttribute).

      Parameters:
      notEquals - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • notIn

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object.

      The following example would return data sources whose animal attribute is neither cat nor dog.

      "notIn": { "key": "animal", "value": ["cat", "dog"] }

      Parameters:
      notIn - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object.

      The following example would return data sources whose animal attribute is neither cat nor dog.

      "notIn": { "key": "animal", "value": ["cat", "dog"] }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • notIn

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object.

      The following example would return data sources whose animal attribute is neither cat nor dog.

      "notIn": { "key": "animal", "value": ["cat", "dog"] }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to notIn(FilterAttribute).

      Parameters:
      notIn - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • orAll

      Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.

      Parameters:
      orAll - Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • orAll

      Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.

      Parameters:
      orAll - Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • orAll

      Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.

      This is a convenience method that creates an instance of the RetrievalFilter.Builder avoiding the need to create one manually via RetrievalFilter.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to orAll(List<RetrievalFilter>).

      Parameters:
      orAll - a consumer that will call methods on RetrievalFilter.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • startsWith

      RetrievalFilter.Builder startsWith(FilterAttribute startsWith)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value starts with the value in this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

      The following example would return data sources with an animal attribute starts with ca (for example, cat or camel).

      "startsWith": { "key": "animal", "value": "ca" }

      Parameters:
      startsWith - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value starts with the value in this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

      The following example would return data sources with an animal attribute starts with ca (for example, cat or camel).

      "startsWith": { "key": "animal", "value": "ca" }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • startsWith

      default RetrievalFilter.Builder startsWith(Consumer<FilterAttribute.Builder> startsWith)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value starts with the value in this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

      The following example would return data sources with an animal attribute starts with ca (for example, cat or camel).

      "startsWith": { "key": "animal", "value": "ca" }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to startsWith(FilterAttribute).

      Parameters:
      startsWith - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • stringContains

      RetrievalFilter.Builder stringContains(FilterAttribute stringContains)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is one of the following:

      • A string that contains the value as a substring. The following example would return data sources with an animal attribute that contains the substring at (for example cat).

        "stringContains": { "key": "animal", "value": "at" }

      • A list with a member that contains the value as a substring. The following example would return data sources with an animals attribute that is a list containing a member that contains the substring at (for example ["dog", "cat"]).

        "stringContains": { "key": "animals", "value": "at" }

      Parameters:
      stringContains - Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is one of the following:

      • A string that contains the value as a substring. The following example would return data sources with an animal attribute that contains the substring at (for example cat).

        "stringContains": { "key": "animal", "value": "at" }

      • A list with a member that contains the value as a substring. The following example would return data sources with an animals attribute that is a list containing a member that contains the substring at (for example ["dog", "cat"]).

        "stringContains": { "key": "animals", "value": "at" }

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • stringContains

      default RetrievalFilter.Builder stringContains(Consumer<FilterAttribute.Builder> stringContains)

      Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is one of the following:

      • A string that contains the value as a substring. The following example would return data sources with an animal attribute that contains the substring at (for example cat).

        "stringContains": { "key": "animal", "value": "at" }

      • A list with a member that contains the value as a substring. The following example would return data sources with an animals attribute that is a list containing a member that contains the substring at (for example ["dog", "cat"]).

        "stringContains": { "key": "animals", "value": "at" }

      This is a convenience method that creates an instance of the FilterAttribute.Builder avoiding the need to create one manually via FilterAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to stringContains(FilterAttribute).

      Parameters:
      stringContains - a consumer that will call methods on FilterAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: