Class: Aws::Kendra::Types::QueryRequest

Inherits:
Struct
  • Object
show all
Includes:
Structure
Defined in:
lib/aws-sdk-kendra/types.rb

Overview

Note:

When making an API call, you may pass QueryRequest data as a hash:

{
  index_id: "IndexId", # required
  query_text: "QueryText", # required
  attribute_filter: {
    and_all_filters: [
      {
        # recursive AttributeFilter
      },
    ],
    or_all_filters: [
      {
        # recursive AttributeFilter
      },
    ],
    not_filter: {
      # recursive AttributeFilter
    },
    equals_to: {
      key: "DocumentAttributeKey", # required
      value: { # required
        string_value: "DocumentAttributeStringValue",
        string_list_value: ["String"],
        long_value: 1,
        date_value: Time.now,
      },
    },
    contains_all: {
      key: "DocumentAttributeKey", # required
      value: { # required
        string_value: "DocumentAttributeStringValue",
        string_list_value: ["String"],
        long_value: 1,
        date_value: Time.now,
      },
    },
    contains_any: {
      key: "DocumentAttributeKey", # required
      value: { # required
        string_value: "DocumentAttributeStringValue",
        string_list_value: ["String"],
        long_value: 1,
        date_value: Time.now,
      },
    },
    greater_than: {
      key: "DocumentAttributeKey", # required
      value: { # required
        string_value: "DocumentAttributeStringValue",
        string_list_value: ["String"],
        long_value: 1,
        date_value: Time.now,
      },
    },
    greater_than_or_equals: {
      key: "DocumentAttributeKey", # required
      value: { # required
        string_value: "DocumentAttributeStringValue",
        string_list_value: ["String"],
        long_value: 1,
        date_value: Time.now,
      },
    },
    less_than: {
      key: "DocumentAttributeKey", # required
      value: { # required
        string_value: "DocumentAttributeStringValue",
        string_list_value: ["String"],
        long_value: 1,
        date_value: Time.now,
      },
    },
    less_than_or_equals: {
      key: "DocumentAttributeKey", # required
      value: { # required
        string_value: "DocumentAttributeStringValue",
        string_list_value: ["String"],
        long_value: 1,
        date_value: Time.now,
      },
    },
  },
  facets: [
    {
      document_attribute_key: "DocumentAttributeKey",
    },
  ],
  requested_document_attributes: ["DocumentAttributeKey"],
  query_result_type_filter: "DOCUMENT", # accepts DOCUMENT, QUESTION_ANSWER, ANSWER
  page_number: 1,
  page_size: 1,
  sorting_configuration: {
    document_attribute_key: "DocumentAttributeKey", # required
    sort_order: "DESC", # required, accepts DESC, ASC
  },
  user_context: {
    token: "Token",
  },
  visitor_id: "VisitorId",
}

Constant Summary collapse

SENSITIVE =
[]

Instance Attribute Summary collapse

Instance Attribute Details

#attribute_filterTypes::AttributeFilter

Enables filtered searches based on document attributes. You can only provide one attribute filter; however, the `AndAllFilters`, `NotFilter`, and `OrAllFilters` parameters contain a list of other filters.

The `AttributeFilter` parameter enables you to create a set of filtering rules that a document must satisfy to be included in the query results.


4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#facetsArray<Types::Facet>

An array of documents attributes. Amazon Kendra returns a count for each attribute key specified. You can use this information to help narrow the search for your user.

Returns:


4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#index_idString

The unique identifier of the index to search. The identifier is returned in the response from the operation.

Returns:

  • (String)

4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#page_numberInteger

Query results are returned in pages the size of the `PageSize` parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.

Returns:

  • (Integer)

4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#page_sizeInteger

Sets the number of results that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.

Returns:

  • (Integer)

4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#query_result_type_filterString

Sets the type of query. Only results for the specified query type are returned.

Returns:

  • (String)

4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#query_textString

The text to search for.

Returns:

  • (String)

4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#requested_document_attributesArray<String>

An array of document attributes to include in the response. No other document attributes are included in the response. By default all document attributes are included in the response.

Returns:

  • (Array<String>)

4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#sorting_configurationTypes::SortingConfiguration

Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance.

If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.


4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#user_contextTypes::UserContext

The user context token.

Returns:


4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end

#visitor_idString

Provides an identifier for a specific user. The `VisitorId` should be a unique identifier, such as a GUID. Don't use personally identifiable information, such as the user's email address, as the `VisitorId`.

Returns:

  • (String)

4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
# File 'lib/aws-sdk-kendra/types.rb', line 4516

class QueryRequest < Struct.new(
  :index_id,
  :query_text,
  :attribute_filter,
  :facets,
  :requested_document_attributes,
  :query_result_type_filter,
  :page_number,
  :page_size,
  :sorting_configuration,
  :user_context,
  :visitor_id)
  SENSITIVE = []
  include Aws::Structure
end