Class: Aws::Kendra::Types::AttributeFilter
- Inherits:
-
Struct
- Object
- Struct
- Aws::Kendra::Types::AttributeFilter
- Includes:
- Structure
- Defined in:
- lib/aws-sdk-kendra/types.rb
Overview
Filters the search results based on document attributes or fields.
You can filter results using attributes for your particular documents. The attributes must exist in your index. For example, if your documents include the custom attribute “Department”, you can filter documents that belong to the “HR” department. You would use the ‘EqualsTo` operation to filter results or documents with “Department” equals to “HR”.
You can use ‘AndAllFilters` and `AndOrFilters` in combination with each other or with other operations such as `EqualsTo`. For example:
‘AndAllFilters`
-
‘EqualsTo`: “Department”, “HR”
-
‘AndOrFilters`
-
‘ContainsAny`: “Project Name”, [“new hires”, “new hiring”]
^
-
This example filters results or documents that belong to the HR department and belong to projects that contain “new hires” or “new hiring” in the project name (must use ‘ContainAny` with `StringListValue`). This example is filtering with a depth of 2.
You cannot filter more than a depth of 2, otherwise you receive a ‘ValidationException` exception with the message “AttributeFilter cannot have a depth of more than 2.” Also, if you use more than 10 attribute filters in a given list for `AndAllFilters` or `OrAllFilters`, you receive a `ValidationException` with the message “AttributeFilter cannot have a length of more than 10”.
For examples of using ‘AttributeFilter`, see [Using document attributes to filter search results].
[1]: docs.aws.amazon.com/kendra/latest/dg/filtering.html#search-filtering
Constant Summary collapse
- SENSITIVE =
[]
Instance Attribute Summary collapse
-
#and_all_filters ⇒ Array<Types::AttributeFilter>
Performs a logical ‘AND` operation on all filters that you specify.
-
#contains_all ⇒ Types::DocumentAttribute
Returns true when a document contains all of the specified document attributes/fields.
-
#contains_any ⇒ Types::DocumentAttribute
Returns true when a document contains any of the specified document attributes/fields.
-
#equals_to ⇒ Types::DocumentAttribute
Performs an equals operation on document attributes/fields and their values.
-
#greater_than ⇒ Types::DocumentAttribute
Performs a greater than operation on document attributes/fields and their values.
-
#greater_than_or_equals ⇒ Types::DocumentAttribute
Performs a greater or equals than operation on document attributes/fields and their values.
-
#less_than ⇒ Types::DocumentAttribute
Performs a less than operation on document attributes/fields and their values.
-
#less_than_or_equals ⇒ Types::DocumentAttribute
Performs a less than or equals operation on document attributes/fields and their values.
-
#not_filter ⇒ Types::AttributeFilter
Performs a logical ‘NOT` operation on all filters that you specify.
-
#or_all_filters ⇒ Array<Types::AttributeFilter>
Performs a logical ‘OR` operation on all filters that you specify.
Instance Attribute Details
#and_all_filters ⇒ Array<Types::AttributeFilter>
Performs a logical ‘AND` operation on all filters that you specify.
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |
#contains_all ⇒ Types::DocumentAttribute
Returns true when a document contains all of the specified document attributes/fields. This filter is only applicable to [StringListValue].
[1]: docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |
#contains_any ⇒ Types::DocumentAttribute
Returns true when a document contains any of the specified document attributes/fields. This filter is only applicable to [StringListValue].
[1]: docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |
#equals_to ⇒ Types::DocumentAttribute
Performs an equals operation on document attributes/fields and their values.
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |
#greater_than ⇒ Types::DocumentAttribute
Performs a greater than operation on document attributes/fields and their values. Use with the [document attribute type] ‘Date` or `Long`.
[1]: docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |
#greater_than_or_equals ⇒ Types::DocumentAttribute
Performs a greater or equals than operation on document attributes/fields and their values. Use with the [document attribute type] ‘Date` or `Long`.
[1]: docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |
#less_than ⇒ Types::DocumentAttribute
Performs a less than operation on document attributes/fields and their values. Use with the [document attribute type] ‘Date` or `Long`.
[1]: docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |
#less_than_or_equals ⇒ Types::DocumentAttribute
Performs a less than or equals operation on document attributes/fields and their values. Use with the [document attribute type] ‘Date` or `Long`.
[1]: docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |
#not_filter ⇒ Types::AttributeFilter
Performs a logical ‘NOT` operation on all filters that you specify.
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |
#or_all_filters ⇒ Array<Types::AttributeFilter>
Performs a logical ‘OR` operation on all filters that you specify.
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/aws-sdk-kendra/types.rb', line 464 class AttributeFilter < Struct.new( :and_all_filters, :or_all_filters, :not_filter, :equals_to, :contains_all, :contains_any, :greater_than, :greater_than_or_equals, :less_than, :less_than_or_equals) SENSITIVE = [] include Aws::Structure end |