Class RetrievalFilter
- java.lang.Object
-
- software.amazon.awssdk.services.bedrock.model.RetrievalFilter
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<RetrievalFilter.Builder,RetrievalFilter>
@Generated("software.amazon.awssdk:codegen") public final class RetrievalFilter extends Object implements SdkPojo, Serializable, ToCopyableBuilder<RetrievalFilter.Builder,RetrievalFilter>
Specifies the filters to use on the metadata attributes/fields in the knowledge base data sources before returning results.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRetrievalFilter.Builderstatic classRetrievalFilter.Type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<RetrievalFilter>andAll()Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.static RetrievalFilter.Builderbuilder()booleanequals(Object obj)booleanequalsBySdkFields(Object obj)FilterAttributeequalsValue()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.static RetrievalFilterfromAndAll(List<RetrievalFilter> andAll)Create an instance of this class withandAll()initialized to the given value.static RetrievalFilterfromEqualsValue(Consumer<FilterAttribute.Builder> equalsValue)Create an instance of this class withequalsValue()initialized to the given value.static RetrievalFilterfromEqualsValue(FilterAttribute equalsValue)Create an instance of this class withequalsValue()initialized to the given value.static RetrievalFilterfromGreaterThan(Consumer<FilterAttribute.Builder> greaterThan)Create an instance of this class withgreaterThan()initialized to the given value.static RetrievalFilterfromGreaterThan(FilterAttribute greaterThan)Create an instance of this class withgreaterThan()initialized to the given value.static RetrievalFilterfromGreaterThanOrEquals(Consumer<FilterAttribute.Builder> greaterThanOrEquals)Create an instance of this class withgreaterThanOrEquals()initialized to the given value.static RetrievalFilterfromGreaterThanOrEquals(FilterAttribute greaterThanOrEquals)Create an instance of this class withgreaterThanOrEquals()initialized to the given value.static RetrievalFilterfromIn(Consumer<FilterAttribute.Builder> in)Create an instance of this class within()initialized to the given value.static RetrievalFilterfromIn(FilterAttribute in)Create an instance of this class within()initialized to the given value.static RetrievalFilterfromLessThan(Consumer<FilterAttribute.Builder> lessThan)Create an instance of this class withlessThan()initialized to the given value.static RetrievalFilterfromLessThan(FilterAttribute lessThan)Create an instance of this class withlessThan()initialized to the given value.static RetrievalFilterfromLessThanOrEquals(Consumer<FilterAttribute.Builder> lessThanOrEquals)Create an instance of this class withlessThanOrEquals()initialized to the given value.static RetrievalFilterfromLessThanOrEquals(FilterAttribute lessThanOrEquals)Create an instance of this class withlessThanOrEquals()initialized to the given value.static RetrievalFilterfromListContains(Consumer<FilterAttribute.Builder> listContains)Create an instance of this class withlistContains()initialized to the given value.static RetrievalFilterfromListContains(FilterAttribute listContains)Create an instance of this class withlistContains()initialized to the given value.static RetrievalFilterfromNotEquals(Consumer<FilterAttribute.Builder> notEquals)Create an instance of this class withnotEquals()initialized to the given value.static RetrievalFilterfromNotEquals(FilterAttribute notEquals)Create an instance of this class withnotEquals()initialized to the given value.static RetrievalFilterfromNotIn(Consumer<FilterAttribute.Builder> notIn)Create an instance of this class withnotIn()initialized to the given value.static RetrievalFilterfromNotIn(FilterAttribute notIn)Create an instance of this class withnotIn()initialized to the given value.static RetrievalFilterfromOrAll(List<RetrievalFilter> orAll)Create an instance of this class withorAll()initialized to the given value.static RetrievalFilterfromStartsWith(Consumer<FilterAttribute.Builder> startsWith)Create an instance of this class withstartsWith()initialized to the given value.static RetrievalFilterfromStartsWith(FilterAttribute startsWith)Create an instance of this class withstartsWith()initialized to the given value.static RetrievalFilterfromStringContains(Consumer<FilterAttribute.Builder> stringContains)Create an instance of this class withstringContains()initialized to the given value.static RetrievalFilterfromStringContains(FilterAttribute stringContains)Create an instance of this class withstringContains()initialized to the given value.<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)FilterAttributegreaterThan()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.FilterAttributegreaterThanOrEquals()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.booleanhasAndAll()For responses, this returns true if the service returned a value for the AndAll property.inthashCode()booleanhasOrAll()For responses, this returns true if the service returned a value for the OrAll property.FilterAttributein()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.FilterAttributelessThan()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.FilterAttributelessThanOrEquals()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.FilterAttributelistContains()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.FilterAttributenotEquals()Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.FilterAttributenotIn()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.List<RetrievalFilter>orAll()Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()static Class<? extends RetrievalFilter.Builder>serializableBuilderClass()FilterAttributestartsWith()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.FilterAttributestringContains()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:RetrievalFilter.BuildertoBuilder()StringtoString()Returns a string representation of this object.RetrievalFilter.Typetype()Retrieve an enum value representing which member of this object is populated.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
equalsValue
public final 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" }- Returns:
- 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" }
-
notEquals
public final FilterAttribute notEquals()
Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.
The following example would return data sources that don't contain an animal attribute whose value is 'cat':
"notEquals": { "key": "animal", "value": "cat" }- Returns:
- Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value
doesn't match the value in this object are returned.
The following example would return data sources that don't contain an animal attribute whose value is 'cat':
"notEquals": { "key": "animal", "value": "cat" }
-
greaterThan
public final 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 }- Returns:
- 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 }
-
greaterThanOrEquals
public final 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 }- Returns:
- 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 }
-
lessThan
public final FilterAttribute 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:
- 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 }
-
lessThanOrEquals
public final 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 }- Returns:
- 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 }
-
in
public final FilterAttribute 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:
- 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"] }
-
notIn
public final FilterAttribute 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:
- 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"] }
-
startsWith
public final 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" }- Returns:
- 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" }
-
listContains
public final 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" }- Returns:
- 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" }
-
stringContains
public final 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" }- Returns:
- 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" }
-
hasAndAll
public final boolean hasAndAll()
For responses, this returns true if the service returned a value for the AndAll property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
andAll
public final List<RetrievalFilter> andAll()
Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasAndAll()method.- Returns:
- Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.
-
hasOrAll
public final boolean hasOrAll()
For responses, this returns true if the service returned a value for the OrAll property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
orAll
public final List<RetrievalFilter> orAll()
Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasOrAll()method.- Returns:
- Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.
-
toBuilder
public RetrievalFilter.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<RetrievalFilter.Builder,RetrievalFilter>
-
builder
public static RetrievalFilter.Builder builder()
-
serializableBuilderClass
public static Class<? extends RetrievalFilter.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String toString()
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
-
fromEqualsValue
public static RetrievalFilter fromEqualsValue(FilterAttribute equalsValue)
Create an instance of this class withequalsValue()initialized to the given value.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" }
-
fromEqualsValue
public static RetrievalFilter fromEqualsValue(Consumer<FilterAttribute.Builder> equalsValue)
Create an instance of this class withequalsValue()initialized to the given value.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" }
-
fromNotEquals
public static RetrievalFilter fromNotEquals(FilterAttribute notEquals)
Create an instance of this class withnotEquals()initialized to the given value.Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.
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 that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.The following example would return data sources that don't contain an animal attribute whose value is 'cat':
"notEquals": { "key": "animal", "value": "cat" }
-
fromNotEquals
public static RetrievalFilter fromNotEquals(Consumer<FilterAttribute.Builder> notEquals)
Create an instance of this class withnotEquals()initialized to the given value.Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.
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 that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.The following example would return data sources that don't contain an animal attribute whose value is 'cat':
"notEquals": { "key": "animal", "value": "cat" }
-
fromGreaterThan
public static RetrievalFilter fromGreaterThan(FilterAttribute greaterThan)
Create an instance of this class withgreaterThan()initialized to the given value.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 }
-
fromGreaterThan
public static RetrievalFilter fromGreaterThan(Consumer<FilterAttribute.Builder> greaterThan)
Create an instance of this class withgreaterThan()initialized to the given value.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 }
-
fromGreaterThanOrEquals
public static RetrievalFilter fromGreaterThanOrEquals(FilterAttribute greaterThanOrEquals)
Create an instance of this class withgreaterThanOrEquals()initialized to the given value.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 }
-
fromGreaterThanOrEquals
public static RetrievalFilter fromGreaterThanOrEquals(Consumer<FilterAttribute.Builder> greaterThanOrEquals)
Create an instance of this class withgreaterThanOrEquals()initialized to the given value.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 }
-
fromLessThan
public static RetrievalFilter fromLessThan(FilterAttribute lessThan)
Create an instance of this class withlessThan()initialized to the given value.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 }
-
fromLessThan
public static RetrievalFilter fromLessThan(Consumer<FilterAttribute.Builder> lessThan)
Create an instance of this class withlessThan()initialized to the given value.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 }
-
fromLessThanOrEquals
public static RetrievalFilter fromLessThanOrEquals(FilterAttribute lessThanOrEquals)
Create an instance of this class withlessThanOrEquals()initialized to the given value.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 }
-
fromLessThanOrEquals
public static RetrievalFilter fromLessThanOrEquals(Consumer<FilterAttribute.Builder> lessThanOrEquals)
Create an instance of this class withlessThanOrEquals()initialized to the given value.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 }
-
fromIn
public static RetrievalFilter fromIn(FilterAttribute in)
Create an instance of this class within()initialized to the given value.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"] }
-
fromIn
public static RetrievalFilter fromIn(Consumer<FilterAttribute.Builder> in)
Create an instance of this class within()initialized to the given value.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"] }
-
fromNotIn
public static RetrievalFilter fromNotIn(FilterAttribute notIn)
Create an instance of this class withnotIn()initialized to the given value.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"] }
-
fromNotIn
public static RetrievalFilter fromNotIn(Consumer<FilterAttribute.Builder> notIn)
Create an instance of this class withnotIn()initialized to the given value.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"] }
-
fromStartsWith
public static RetrievalFilter fromStartsWith(FilterAttribute startsWith)
Create an instance of this class withstartsWith()initialized to the given value.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" }
-
fromStartsWith
public static RetrievalFilter fromStartsWith(Consumer<FilterAttribute.Builder> startsWith)
Create an instance of this class withstartsWith()initialized to the given value.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" }
-
fromListContains
public static RetrievalFilter fromListContains(FilterAttribute listContains)
Create an instance of this class withlistContains()initialized to the given value.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" }
-
fromListContains
public static RetrievalFilter fromListContains(Consumer<FilterAttribute.Builder> listContains)
Create an instance of this class withlistContains()initialized to the given value.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" }
-
fromStringContains
public static RetrievalFilter fromStringContains(FilterAttribute stringContains)
Create an instance of this class withstringContains()initialized to the given value.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" }
-
fromStringContains
public static RetrievalFilter fromStringContains(Consumer<FilterAttribute.Builder> stringContains)
Create an instance of this class withstringContains()initialized to the given value.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" }
-
fromAndAll
public static RetrievalFilter fromAndAll(List<RetrievalFilter> andAll)
Create an instance of this class withandAll()initialized to the given value.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.
-
fromOrAll
public static RetrievalFilter fromOrAll(List<RetrievalFilter> orAll)
Create an instance of this class withorAll()initialized to the given value.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.
-
type
public RetrievalFilter.Type type()
Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will beRetrievalFilter.Type.UNKNOWN_TO_SDK_VERSIONif the service returned a member that is only known to a newer SDK version. When this class is created directly in your code, this will beRetrievalFilter.Type.UNKNOWN_TO_SDK_VERSIONif zero members are set, andnullif more than one member is set.
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-
-