AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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:

Inheritance Hierarchy

System.Object
  Amazon.BedrockAgentRuntime.Model.RetrievalFilter

Namespace: Amazon.BedrockAgentRuntime.Model
Assembly: AWSSDK.BedrockAgentRuntime.dll
Version: 3.x.y.z

Syntax

C#
public class RetrievalFilter

The RetrievalFilter type exposes the following members

Constructors

NameDescription
Public Method RetrievalFilter()

Properties

NameTypeDescription
Public Property AndAll System.Collections.Generic.List<Amazon.BedrockAgentRuntime.Model.RetrievalFilter>

Gets and sets the property AndAll.

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

Public Property Equals Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property Equals.

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" }

Public Property GreaterThan Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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 }

Public Property GreaterThanOrEquals Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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 }

Public Property In Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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"] }

Public Property LessThan Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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 }

Public Property LessThanOrEquals Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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 }

Public Property ListContains Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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" }

Public Property NotEquals Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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" }

Public Property NotIn Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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"] }

Public Property OrAll System.Collections.Generic.List<Amazon.BedrockAgentRuntime.Model.RetrievalFilter>

Gets and sets the property OrAll.

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

Public Property StartsWith Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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" }

Public Property StringContains Amazon.BedrockAgentRuntime.Model.FilterAttribute

Gets and sets the property 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" }

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5