Class RetrievalFilter
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<RetrievalFilter.Builder,RetrievalFilter>
Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see Query configurations. See the examples below to see how to use these filters.
This data type is used in the following API operations:
-
Retrieve request – in the
filterfield -
RetrieveAndGenerate request – in the
filterfield
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic enum -
Method Summary
Modifier and TypeMethodDescriptionfinal List<RetrievalFilter>andAll()Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.static RetrievalFilter.Builderbuilder()final booleanfinal booleanequalsBySdkFields(Object obj) final FilterAttributeKnowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value matches thevaluein 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 RetrievalFilterCreate an instance of this class within()initialized to the given value.static RetrievalFilterCreate 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.final <T> Optional<T>getValueForField(String fieldName, Class<T> clazz) final FilterAttributeKnowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is greater than thevaluein this object.final FilterAttributeKnowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is greater than or equal to thevaluein this object.final booleanFor responses, this returns true if the service returned a value for the AndAll property.final inthashCode()final booleanhasOrAll()For responses, this returns true if the service returned a value for the OrAll property.final FilterAttributein()Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is in the list specified in thevaluein this object.final FilterAttributelessThan()Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is less than thevaluein this object.final FilterAttributeKnowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is less than or equal to thevaluein this object.final FilterAttributeKnowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is a list that contains thevalueas one of its members.final FilterAttributeKnowledge base data sources are returned when:final FilterAttributenotIn()Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value isn't in the list specified in thevaluein this object.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.static Class<? extends RetrievalFilter.Builder>final FilterAttributeKnowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value starts with thevaluein this object.final FilterAttributeKnowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is one of the following:final StringtoString()Returns a string representation of this object.type()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, waitMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
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
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.
-
equalsValue
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value matches thevaluein this object.The following example would return data sources with an
animalattribute whose value iscat:"equals": { "key": "animal", "value": "cat" }- Returns:
- Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value matches thevaluein this object.The following example would return data sources with an
animalattribute whose value iscat:"equals": { "key": "animal", "value": "cat" }
-
greaterThan
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is greater than thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than1989:"greaterThan": { "key": "year", "value": 1989 }- Returns:
- Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is greater than thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than1989:"greaterThan": { "key": "year", "value": 1989 }
-
greaterThanOrEquals
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is greater than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than or equal to1989:"greaterThanOrEquals": { "key": "year", "value": 1989 }- Returns:
- Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is greater than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than or equal to1989:"greaterThanOrEquals": { "key": "year", "value": 1989 }
-
in
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is in the list specified in thevaluein this object.The following example would return data sources with an
animalattribute that is eithercatordog:"in": { "key": "animal", "value": ["cat", "dog"] }- Returns:
- Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is in the list specified in thevaluein this object.The following example would return data sources with an
animalattribute that is eithercatordog:"in": { "key": "animal", "value": ["cat", "dog"] }
-
lessThan
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is less than thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than to1989."lessThan": { "key": "year", "value": 1989 }- Returns:
- Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is less than thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than to1989."lessThan": { "key": "year", "value": 1989 }
-
lessThanOrEquals
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is less than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than or equal to1989."lessThanOrEquals": { "key": "year", "value": 1989 }- Returns:
- Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is less than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than or equal to1989."lessThanOrEquals": { "key": "year", "value": 1989 }
-
listContains
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is a list that contains thevalueas one of its members.The following example would return data sources with an
animalsattribute that is a list containing acatmember (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
keyand whose value is a list that contains thevalueas one of its members.The following example would return data sources with an
animalsattribute that is a list containing acatmember (for example["dog", "cat"])."listContains": { "key": "animals", "value": "cat" }
-
notEquals
Knowledge base data sources are returned when:
-
It contains a metadata attribute whose name matches the
keyand whose value doesn't match thevaluein this object. -
The key is not present in the document.
The following example would return data sources that don't contain an
animalattribute whose value iscat."notEquals": { "key": "animal", "value": "cat" }- Returns:
- Knowledge base data sources are returned when:
-
It contains a metadata attribute whose name matches the
keyand whose value doesn't match thevaluein this object. -
The key is not present in the document.
The following example would return data sources that don't contain an
animalattribute whose value iscat."notEquals": { "key": "animal", "value": "cat" } -
-
-
notIn
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value isn't in the list specified in thevaluein this object.The following example would return data sources whose
animalattribute is neithercatnordog."notIn": { "key": "animal", "value": ["cat", "dog"] }- Returns:
- Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value isn't in the list specified in thevaluein this object.The following example would return data sources whose
animalattribute is neithercatnordog."notIn": { "key": "animal", "value": ["cat", "dog"] }
-
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
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.
-
startsWith
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value starts with thevaluein this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.The following example would return data sources with an
animalattribute starts withca(for example,catorcamel)."startsWith": { "key": "animal", "value": "ca" }- Returns:
- Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value starts with thevaluein this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.The following example would return data sources with an
animalattribute starts withca(for example,catorcamel)."startsWith": { "key": "animal", "value": "ca" }
-
stringContains
Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
keyand whose value is one of the following:-
A string that contains the
valueas a substring. The following example would return data sources with ananimalattribute that contains the substringat(for examplecat)."stringContains": { "key": "animal", "value": "at" } -
A list with a member that contains the
valueas a substring. The following example would return data sources with ananimalsattribute that is a list containing a member that contains the substringat(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
keyand whose value is one of the following:-
A string that contains the
valueas a substring. The following example would return data sources with ananimalattribute that contains the substringat(for examplecat)."stringContains": { "key": "animal", "value": "at" } -
A list with a member that contains the
valueas a substring. The following example would return data sources with ananimalsattribute that is a list containing a member that contains the substringat(for example["dog", "cat"])."stringContains": { "key": "animals", "value": "at" }
-
-
-
toBuilder
- Specified by:
toBuilderin interfaceToCopyableBuilder<RetrievalFilter.Builder,RetrievalFilter>
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
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. -
getValueForField
-
fromAndAll
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.
-
fromEqualsValue
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
keyand whose value matches thevaluein this object.The following example would return data sources with an
animalattribute whose value iscat:"equals": { "key": "animal", "value": "cat" }- Parameters:
equalsValue- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value matches thevaluein this object.The following example would return data sources with an
animalattribute whose value iscat:"equals": { "key": "animal", "value": "cat" }
-
fromEqualsValue
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
keyand whose value matches thevaluein this object.The following example would return data sources with an
animalattribute whose value iscat:"equals": { "key": "animal", "value": "cat" }- Parameters:
equalsValue- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value matches thevaluein this object.The following example would return data sources with an
animalattribute whose value iscat:"equals": { "key": "animal", "value": "cat" }
-
fromGreaterThan
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
keyand whose value is greater than thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than1989:"greaterThan": { "key": "year", "value": 1989 }- Parameters:
greaterThan- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is greater than thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than1989:"greaterThan": { "key": "year", "value": 1989 }
-
fromGreaterThan
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
keyand whose value is greater than thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than1989:"greaterThan": { "key": "year", "value": 1989 }- Parameters:
greaterThan- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is greater than thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than1989:"greaterThan": { "key": "year", "value": 1989 }
-
fromGreaterThanOrEquals
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
keyand whose value is greater than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than or equal to1989:"greaterThanOrEquals": { "key": "year", "value": 1989 }- Parameters:
greaterThanOrEquals- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is greater than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than or equal to1989:"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
keyand whose value is greater than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than or equal to1989:"greaterThanOrEquals": { "key": "year", "value": 1989 }- Parameters:
greaterThanOrEquals- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is greater than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is greater than or equal to1989:"greaterThanOrEquals": { "key": "year", "value": 1989 }
-
fromIn
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
keyand whose value is in the list specified in thevaluein this object.The following example would return data sources with an
animalattribute that is eithercatordog:"in": { "key": "animal", "value": ["cat", "dog"] }- Parameters:
in- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is in the list specified in thevaluein this object.The following example would return data sources with an
animalattribute that is eithercatordog:"in": { "key": "animal", "value": ["cat", "dog"] }
-
fromIn
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
keyand whose value is in the list specified in thevaluein this object.The following example would return data sources with an
animalattribute that is eithercatordog:"in": { "key": "animal", "value": ["cat", "dog"] }- Parameters:
in- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is in the list specified in thevaluein this object.The following example would return data sources with an
animalattribute that is eithercatordog:"in": { "key": "animal", "value": ["cat", "dog"] }
-
fromLessThan
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
keyand whose value is less than thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than to1989."lessThan": { "key": "year", "value": 1989 }- Parameters:
lessThan- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is less than thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than to1989."lessThan": { "key": "year", "value": 1989 }
-
fromLessThan
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
keyand whose value is less than thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than to1989."lessThan": { "key": "year", "value": 1989 }- Parameters:
lessThan- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is less than thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than to1989."lessThan": { "key": "year", "value": 1989 }
-
fromLessThanOrEquals
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
keyand whose value is less than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than or equal to1989."lessThanOrEquals": { "key": "year", "value": 1989 }- Parameters:
lessThanOrEquals- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is less than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than or equal to1989."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
keyand whose value is less than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than or equal to1989."lessThanOrEquals": { "key": "year", "value": 1989 }- Parameters:
lessThanOrEquals- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value is less than or equal to thevaluein this object.The following example would return data sources with an
yearattribute whose value is less than or equal to1989."lessThanOrEquals": { "key": "year", "value": 1989 }
-
fromListContains
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
keyand whose value is a list that contains thevalueas one of its members.The following example would return data sources with an
animalsattribute that is a list containing acatmember (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 thekeyand whose value is a list that contains thevalueas one of its members.The following example would return data sources with an
animalsattribute that is a list containing acatmember (for example["dog", "cat"])."listContains": { "key": "animals", "value": "cat" }
-
fromListContains
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
keyand whose value is a list that contains thevalueas one of its members.The following example would return data sources with an
animalsattribute that is a list containing acatmember (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 thekeyand whose value is a list that contains thevalueas one of its members.The following example would return data sources with an
animalsattribute that is a list containing acatmember (for example["dog", "cat"])."listContains": { "key": "animals", "value": "cat" }
-
fromNotEquals
Create an instance of this class withnotEquals()initialized to the given value.Knowledge base data sources are returned when:
-
It contains a metadata attribute whose name matches the
keyand whose value doesn't match thevaluein this object. -
The key is not present in the document.
The following example would return data sources that don't contain an
animalattribute whose value iscat."notEquals": { "key": "animal", "value": "cat" }- Parameters:
notEquals- Knowledge base data sources are returned when:-
It contains a metadata attribute whose name matches the
keyand whose value doesn't match thevaluein this object. -
The key is not present in the document.
The following example would return data sources that don't contain an
animalattribute whose value iscat."notEquals": { "key": "animal", "value": "cat" }-
-
-
fromNotEquals
Create an instance of this class withnotEquals()initialized to the given value.Knowledge base data sources are returned when:
-
It contains a metadata attribute whose name matches the
keyand whose value doesn't match thevaluein this object. -
The key is not present in the document.
The following example would return data sources that don't contain an
animalattribute whose value iscat."notEquals": { "key": "animal", "value": "cat" }- Parameters:
notEquals- Knowledge base data sources are returned when:-
It contains a metadata attribute whose name matches the
keyand whose value doesn't match thevaluein this object. -
The key is not present in the document.
The following example would return data sources that don't contain an
animalattribute whose value iscat."notEquals": { "key": "animal", "value": "cat" }-
-
-
fromNotIn
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
keyand whose value isn't in the list specified in thevaluein this object.The following example would return data sources whose
animalattribute is neithercatnordog."notIn": { "key": "animal", "value": ["cat", "dog"] }- Parameters:
notIn- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value isn't in the list specified in thevaluein this object.The following example would return data sources whose
animalattribute is neithercatnordog."notIn": { "key": "animal", "value": ["cat", "dog"] }
-
fromNotIn
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
keyand whose value isn't in the list specified in thevaluein this object.The following example would return data sources whose
animalattribute is neithercatnordog."notIn": { "key": "animal", "value": ["cat", "dog"] }- Parameters:
notIn- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value isn't in the list specified in thevaluein this object.The following example would return data sources whose
animalattribute is neithercatnordog."notIn": { "key": "animal", "value": ["cat", "dog"] }
-
fromOrAll
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.
-
fromStartsWith
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
keyand whose value starts with thevaluein this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.The following example would return data sources with an
animalattribute starts withca(for example,catorcamel)."startsWith": { "key": "animal", "value": "ca" }- Parameters:
startsWith- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value starts with thevaluein this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.The following example would return data sources with an
animalattribute starts withca(for example,catorcamel)."startsWith": { "key": "animal", "value": "ca" }
-
fromStartsWith
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
keyand whose value starts with thevaluein this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.The following example would return data sources with an
animalattribute starts withca(for example,catorcamel)."startsWith": { "key": "animal", "value": "ca" }- Parameters:
startsWith- Knowledge base data sources are returned if they contain a metadata attribute whose name matches thekeyand whose value starts with thevaluein this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.The following example would return data sources with an
animalattribute starts withca(for example,catorcamel)."startsWith": { "key": "animal", "value": "ca" }
-
fromStringContains
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
keyand whose value is one of the following:-
A string that contains the
valueas a substring. The following example would return data sources with ananimalattribute that contains the substringat(for examplecat)."stringContains": { "key": "animal", "value": "at" } -
A list with a member that contains the
valueas a substring. The following example would return data sources with ananimalsattribute that is a list containing a member that contains the substringat(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 thekeyand whose value is one of the following:-
A string that contains the
valueas a substring. The following example would return data sources with ananimalattribute that contains the substringat(for examplecat)."stringContains": { "key": "animal", "value": "at" } -
A list with a member that contains the
valueas a substring. The following example would return data sources with ananimalsattribute that is a list containing a member that contains the substringat(for example["dog", "cat"])."stringContains": { "key": "animals", "value": "at" }
-
-
-
fromStringContains
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
keyand whose value is one of the following:-
A string that contains the
valueas a substring. The following example would return data sources with ananimalattribute that contains the substringat(for examplecat)."stringContains": { "key": "animal", "value": "at" } -
A list with a member that contains the
valueas a substring. The following example would return data sources with ananimalsattribute that is a list containing a member that contains the substringat(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 thekeyand whose value is one of the following:-
A string that contains the
valueas a substring. The following example would return data sources with ananimalattribute that contains the substringat(for examplecat)."stringContains": { "key": "animal", "value": "at" } -
A list with a member that contains the
valueas a substring. The following example would return data sources with ananimalsattribute that is a list containing a member that contains the substringat(for example["dog", "cat"])."stringContains": { "key": "animals", "value": "at" }
-
-
-
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. -
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-