[ aws . kendra ]

query

Description

Searches an active index. Use this API to search your documents using query. The Query operation enables to do faceted search and to filter results based on document attributes.

It also enables you to provide user context that Amazon Kendra uses to enforce document access control in the search results.

Amazon Kendra searches your index for text content and question and answer (FAQ) content. By default the response contains three types of results.

  • Relevant passages

  • Matching FAQs

  • Relevant documents

You can specify that the query return only one type of result using the QueryResultTypeConfig parameter.

Each query returns the 100 most relevant results.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

Synopsis

  query
--index-id <value>
--query-text <value>
[--attribute-filter <value>]
[--facets <value>]
[--requested-document-attributes <value>]
[--query-result-type-filter <value>]
[--document-relevance-override-configurations <value>]
[--page-number <value>]
[--page-size <value>]
[--sorting-configuration <value>]
[--user-context <value>]
[--visitor-id <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]

Options

--index-id (string)

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

--query-text (string)

The text to search for.

--attribute-filter (structure)

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.

AndAllFilters -> (list)

Performs a logical AND operation on all supplied filters.

(structure)

Provides filtering the query results based on document attributes.

When you use the AndAllFilters or OrAllFilters , filters you can use 2 layers under the first attribute filter. For example, you can use:

<AndAllFilters>

  • <OrAllFilters>

  • <EqualTo>

If you use more than 2 layers, you receive a ValidationException exception with the message “AttributeFilter cannot have a depth of more than 2.”

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”.

AndAllFilters -> (list)

Performs a logical AND operation on all supplied filters.

( … recursive … )

OrAllFilters -> (list)

Performs a logical OR operation on all supplied filters.

( … recursive … )

( … recursive … )EqualsTo -> (structure)

Performs an equals operation on two document attributes.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

ContainsAll -> (structure)

Returns true when a document contains all of the specified document attributes. This filter is only applicable to StringListValue metadata.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

ContainsAny -> (structure)

Returns true when a document contains any of the specified document attributes. This filter is only applicable to StringListValue metadata.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

GreaterThan -> (structure)

Performs a greater than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

GreaterThanOrEquals -> (structure)

Performs a greater or equals than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

LessThan -> (structure)

Performs a less than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

LessThanOrEquals -> (structure)

Performs a less than or equals operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

OrAllFilters -> (list)

Performs a logical OR operation on all supplied filters.

(structure)

Provides filtering the query results based on document attributes.

When you use the AndAllFilters or OrAllFilters , filters you can use 2 layers under the first attribute filter. For example, you can use:

<AndAllFilters>

  • <OrAllFilters>

  • <EqualTo>

If you use more than 2 layers, you receive a ValidationException exception with the message “AttributeFilter cannot have a depth of more than 2.”

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”.

AndAllFilters -> (list)

Performs a logical AND operation on all supplied filters.

( … recursive … )

OrAllFilters -> (list)

Performs a logical OR operation on all supplied filters.

( … recursive … )

( … recursive … )EqualsTo -> (structure)

Performs an equals operation on two document attributes.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

ContainsAll -> (structure)

Returns true when a document contains all of the specified document attributes. This filter is only applicable to StringListValue metadata.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

ContainsAny -> (structure)

Returns true when a document contains any of the specified document attributes. This filter is only applicable to StringListValue metadata.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

GreaterThan -> (structure)

Performs a greater than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

GreaterThanOrEquals -> (structure)

Performs a greater or equals than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

LessThan -> (structure)

Performs a less than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

LessThanOrEquals -> (structure)

Performs a less than or equals operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

NotFilter -> (structure)

Performs a logical NOT operation on all supplied filters.

AndAllFilters -> (list)

Performs a logical AND operation on all supplied filters.

( … recursive … )

OrAllFilters -> (list)

Performs a logical OR operation on all supplied filters.

( … recursive … )

( … recursive … )EqualsTo -> (structure)

Performs an equals operation on two document attributes.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

ContainsAll -> (structure)

Returns true when a document contains all of the specified document attributes. This filter is only applicable to StringListValue metadata.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

ContainsAny -> (structure)

Returns true when a document contains any of the specified document attributes. This filter is only applicable to StringListValue metadata.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

GreaterThan -> (structure)

Performs a greater than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

GreaterThanOrEquals -> (structure)

Performs a greater or equals than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

LessThan -> (structure)

Performs a less than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

LessThanOrEquals -> (structure)

Performs a less than or equals operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

EqualsTo -> (structure)

Performs an equals operation on two document attributes.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

ContainsAll -> (structure)

Returns true when a document contains all of the specified document attributes. This filter is only applicable to StringListValue metadata.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

ContainsAny -> (structure)

Returns true when a document contains any of the specified document attributes. This filter is only applicable to StringListValue metadata.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

GreaterThan -> (structure)

Performs a greater than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

GreaterThanOrEquals -> (structure)

Performs a greater or equals than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

LessThan -> (structure)

Performs a less than operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

LessThanOrEquals -> (structure)

Performs a less than or equals operation on two document attributes. Use with a document attribute of type Date or Long .

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

JSON Syntax:

{
  "AndAllFilters": [
    {
      "AndAllFilters": [
        { ... recursive ... }
        ...
      ],
      "OrAllFilters": [
        { ... recursive ... }
        ...
      ],
      "NotFilter": { ... recursive ... },
      "EqualsTo": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "ContainsAll": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "ContainsAny": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "GreaterThan": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "GreaterThanOrEquals": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "LessThan": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "LessThanOrEquals": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      }
    }
    ...
  ],
  "OrAllFilters": [
    {
      "AndAllFilters": [
        { ... recursive ... }
        ...
      ],
      "OrAllFilters": [
        { ... recursive ... }
        ...
      ],
      "NotFilter": { ... recursive ... },
      "EqualsTo": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "ContainsAll": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "ContainsAny": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "GreaterThan": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "GreaterThanOrEquals": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "LessThan": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      },
      "LessThanOrEquals": {
        "Key": "string",
        "Value": {
          "StringValue": "string",
          "StringListValue": ["string", ...],
          "LongValue": long,
          "DateValue": timestamp
        }
      }
    }
    ...
  ],
  "NotFilter": {
    "AndAllFilters": [
      { ... recursive ... }
      ...
    ],
    "OrAllFilters": [
      { ... recursive ... }
      ...
    ],
    "NotFilter": { ... recursive ... },
    "EqualsTo": {
      "Key": "string",
      "Value": {
        "StringValue": "string",
        "StringListValue": ["string", ...],
        "LongValue": long,
        "DateValue": timestamp
      }
    },
    "ContainsAll": {
      "Key": "string",
      "Value": {
        "StringValue": "string",
        "StringListValue": ["string", ...],
        "LongValue": long,
        "DateValue": timestamp
      }
    },
    "ContainsAny": {
      "Key": "string",
      "Value": {
        "StringValue": "string",
        "StringListValue": ["string", ...],
        "LongValue": long,
        "DateValue": timestamp
      }
    },
    "GreaterThan": {
      "Key": "string",
      "Value": {
        "StringValue": "string",
        "StringListValue": ["string", ...],
        "LongValue": long,
        "DateValue": timestamp
      }
    },
    "GreaterThanOrEquals": {
      "Key": "string",
      "Value": {
        "StringValue": "string",
        "StringListValue": ["string", ...],
        "LongValue": long,
        "DateValue": timestamp
      }
    },
    "LessThan": {
      "Key": "string",
      "Value": {
        "StringValue": "string",
        "StringListValue": ["string", ...],
        "LongValue": long,
        "DateValue": timestamp
      }
    },
    "LessThanOrEquals": {
      "Key": "string",
      "Value": {
        "StringValue": "string",
        "StringListValue": ["string", ...],
        "LongValue": long,
        "DateValue": timestamp
      }
    }
  },
  "EqualsTo": {
    "Key": "string",
    "Value": {
      "StringValue": "string",
      "StringListValue": ["string", ...],
      "LongValue": long,
      "DateValue": timestamp
    }
  },
  "ContainsAll": {
    "Key": "string",
    "Value": {
      "StringValue": "string",
      "StringListValue": ["string", ...],
      "LongValue": long,
      "DateValue": timestamp
    }
  },
  "ContainsAny": {
    "Key": "string",
    "Value": {
      "StringValue": "string",
      "StringListValue": ["string", ...],
      "LongValue": long,
      "DateValue": timestamp
    }
  },
  "GreaterThan": {
    "Key": "string",
    "Value": {
      "StringValue": "string",
      "StringListValue": ["string", ...],
      "LongValue": long,
      "DateValue": timestamp
    }
  },
  "GreaterThanOrEquals": {
    "Key": "string",
    "Value": {
      "StringValue": "string",
      "StringListValue": ["string", ...],
      "LongValue": long,
      "DateValue": timestamp
    }
  },
  "LessThan": {
    "Key": "string",
    "Value": {
      "StringValue": "string",
      "StringListValue": ["string", ...],
      "LongValue": long,
      "DateValue": timestamp
    }
  },
  "LessThanOrEquals": {
    "Key": "string",
    "Value": {
      "StringValue": "string",
      "StringListValue": ["string", ...],
      "LongValue": long,
      "DateValue": timestamp
    }
  }
}

--facets (list)

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.

(structure)

Information about a document attribute

DocumentAttributeKey -> (string)

The unique key for the document attribute.

Shorthand Syntax:

DocumentAttributeKey=string ...

JSON Syntax:

[
  {
    "DocumentAttributeKey": "string"
  }
  ...
]

--requested-document-attributes (list)

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.

(string)

Syntax:

"string" "string" ...

--query-result-type-filter (string)

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

Possible values:

  • DOCUMENT

  • QUESTION_ANSWER

  • ANSWER

--document-relevance-override-configurations (list)

Overrides relevance tuning configurations of fields or attributes set at the index level.

If you use this API to override the relevance tuning configured at the index level, but there is no relevance tuning configured at the index level, then Amazon Kendra does not apply any relevance tuning.

If there is relevance tuning configured at the index level, but you do not use this API to override any relevance tuning in the index, then Amazon Kendra uses the relevance tuning that is configured at the index level.

If there is relevance tuning configured for fields at the index level, but you use this API to override only some of these fields, then for the fields you did not override, the importance is set to 1.

(structure)

Overrides the document relevance properties of a custom index field.

Name -> (string)

The name of the tuning configuration to override document relevance at the index level.

Relevance -> (structure)

Provides information for manually tuning the relevance of a field in a search. When a query includes terms that match the field, the results are given a boost in the response based on these tuning parameters.

Freshness -> (boolean)

Indicates that this field determines how “fresh” a document is. For example, if document 1 was created on November 5, and document 2 was created on October 31, document 1 is “fresher” than document 2. You can only set the Freshness field on one DATE type field. Only applies to DATE fields.

Importance -> (integer)

The relative importance of the field in the search. Larger numbers provide more of a boost than smaller numbers.

Duration -> (string)

Specifies the time period that the boost applies to. For example, to make the boost apply to documents with the field value within the last month, you would use “2628000s”. Once the field value is beyond the specified range, the effect of the boost drops off. The higher the importance, the faster the effect drops off. If you don’t specify a value, the default is 3 months. The value of the field is a numeric string followed by the character “s”, for example “86400s” for one day, or “604800s” for one week.

Only applies to DATE fields.

RankOrder -> (string)

Determines how values should be interpreted.

When the RankOrder field is ASCENDING , higher numbers are better. For example, a document with a rating score of 10 is higher ranking than a document with a rating score of 1.

When the RankOrder field is DESCENDING , lower numbers are better. For example, in a task tracking application, a priority 1 task is more important than a priority 5 task.

Only applies to LONG and DOUBLE fields.

ValueImportanceMap -> (map)

A list of values that should be given a different boost when they appear in the result list. For example, if you are boosting a field called “department,” query terms that match the department field are boosted in the result. However, you can add entries from the department field to boost documents with those values higher.

For example, you can add entries to the map with names of departments. If you add “HR”,5 and “Legal”,3 those departments are given special attention when they appear in the metadata of a document. When those terms appear they are given the specified importance instead of the regular importance for the boost.

key -> (string)

value -> (integer)

Shorthand Syntax:

Name=string,Relevance={Freshness=boolean,Importance=integer,Duration=string,RankOrder=string,ValueImportanceMap={KeyName1=integer,KeyName2=integer}} ...

JSON Syntax:

[
  {
    "Name": "string",
    "Relevance": {
      "Freshness": true|false,
      "Importance": integer,
      "Duration": "string",
      "RankOrder": "ASCENDING"|"DESCENDING",
      "ValueImportanceMap": {"string": integer
        ...}
    }
  }
  ...
]

--page-number (integer)

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.

--page-size (integer)

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.

--sorting-configuration (structure)

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.

DocumentAttributeKey -> (string)

The name of the document attribute used to sort the response. You can use any field that has the Sortable flag set to true.

You can also sort by any of the following built-in attributes:

  • _category

  • _created_at

  • _last_updated_at

  • _version

  • _view_count

SortOrder -> (string)

The order that the results should be returned in. In case of ties, the relevance assigned to the result by Amazon Kendra is used as the tie-breaker.

Shorthand Syntax:

DocumentAttributeKey=string,SortOrder=string

JSON Syntax:

{
  "DocumentAttributeKey": "string",
  "SortOrder": "DESC"|"ASC"
}

--user-context (structure)

The user context token or user and group information.

Token -> (string)

The user context token for filtering search results for a user. It must be a JWT or a JSON token.

UserId -> (string)

The identifier of the user you want to filter search results based on their access to documents.

Groups -> (list)

The list of groups you want to filter search results based on the groups’ access to documents.

(string)

DataSourceGroups -> (list)

The list of data source groups you want to filter search results based on groups’ access to documents in that data source.

(structure)

Data source information for user context filtering.

GroupId -> (string)

The identifier of the group you want to add to your list of groups. This is for filtering search results based on the groups’ access to documents.

DataSourceId -> (string)

The identifier of the data source group you want to add to your list of data source groups. This is for filtering search results based on the groups’ access to documents in that data source.

Shorthand Syntax:

Token=string,UserId=string,Groups=string,string,DataSourceGroups=[{GroupId=string,DataSourceId=string},{GroupId=string,DataSourceId=string}]

JSON Syntax:

{
  "Token": "string",
  "UserId": "string",
  "Groups": ["string", ...],
  "DataSourceGroups": [
    {
      "GroupId": "string",
      "DataSourceId": "string"
    }
    ...
  ]
}

--visitor-id (string)

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 .

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.

Output

QueryId -> (string)

The unique identifier for the search. You use QueryId to identify the search when using the feedback API.

ResultItems -> (list)

The results of the search.

(structure)

A single query result.

A query result contains information about a document returned by the query. This includes the original location of the document, a list of attributes assigned to the document, and relevant text from the document that satisfies the query.

Id -> (string)

The unique identifier for the query result.

Type -> (string)

The type of document.

AdditionalAttributes -> (list)

One or more additional attributes associated with the query result.

(structure)

An attribute returned from an index query.

Key -> (string)

The key that identifies the attribute.

ValueType -> (string)

The data type of the Value property.

Value -> (structure)

An object that contains the attribute value.

TextWithHighlightsValue -> (structure)

The text associated with the attribute and information about the highlight to apply to the text.

Text -> (string)

The text to display to the user.

Highlights -> (list)

The beginning and end of the text that should be highlighted.

(structure)

Provides information that you can use to highlight a search result so that your users can quickly identify terms in the response.

BeginOffset -> (integer)

The zero-based location in the response string where the highlight starts.

EndOffset -> (integer)

The zero-based location in the response string where the highlight ends.

TopAnswer -> (boolean)

Indicates whether the response is the best response. True if this is the best response; otherwise, false.

Type -> (string)

The highlight type.

DocumentId -> (string)

The unique identifier for the document.

DocumentTitle -> (structure)

The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.

Text -> (string)

The text to display to the user.

Highlights -> (list)

The beginning and end of the text that should be highlighted.

(structure)

Provides information that you can use to highlight a search result so that your users can quickly identify terms in the response.

BeginOffset -> (integer)

The zero-based location in the response string where the highlight starts.

EndOffset -> (integer)

The zero-based location in the response string where the highlight ends.

TopAnswer -> (boolean)

Indicates whether the response is the best response. True if this is the best response; otherwise, false.

Type -> (string)

The highlight type.

DocumentExcerpt -> (structure)

An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.

Text -> (string)

The text to display to the user.

Highlights -> (list)

The beginning and end of the text that should be highlighted.

(structure)

Provides information that you can use to highlight a search result so that your users can quickly identify terms in the response.

BeginOffset -> (integer)

The zero-based location in the response string where the highlight starts.

EndOffset -> (integer)

The zero-based location in the response string where the highlight ends.

TopAnswer -> (boolean)

Indicates whether the response is the best response. True if this is the best response; otherwise, false.

Type -> (string)

The highlight type.

DocumentURI -> (string)

The URI of the original location of the document.

DocumentAttributes -> (list)

An array of document attributes for the document that the query result maps to. For example, the document author (Author) or the source URI (SourceUri) of the document.

(structure)

A custom attribute value assigned to a document.

Key -> (string)

The identifier for the attribute.

Value -> (structure)

The value of the attribute.

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

ScoreAttributes -> (structure)

Indicates the confidence that Amazon Kendra has that a result matches the query that you provided. Each result is placed into a bin that indicates the confidence, VERY_HIGH , HIGH , MEDIUM and LOW . You can use the score to determine if a response meets the confidence needed for your application.

The field is only set to LOW when the Type field is set to DOCUMENT and Amazon Kendra is not confident that the result matches the query.

ScoreConfidence -> (string)

A relative ranking for how well the response matches the query.

FeedbackToken -> (string)

A token that identifies a particular result from a particular query. Use this token to provide click-through feedback for the result. For more information, see Submitting feedback .

FacetResults -> (list)

Contains the facet results. A FacetResult contains the counts for each attribute key that was specified in the Facets input parameter.

(structure)

The facet values for the documents in the response.

DocumentAttributeKey -> (string)

The key for the facet values. This is the same as the DocumentAttributeKey provided in the query.

DocumentAttributeValueType -> (string)

The data type of the facet value. This is the same as the type defined for the index field when it was created.

DocumentAttributeValueCountPairs -> (list)

An array of key/value pairs, where the key is the value of the attribute and the count is the number of documents that share the key value.

(structure)

Provides the count of documents that match a particular attribute when doing a faceted search.

DocumentAttributeValue -> (structure)

The value of the attribute. For example, “HR.”

StringValue -> (string)

A string, such as “department”.

StringListValue -> (list)

A list of strings.

(string)

LongValue -> (long)

A long integer value.

DateValue -> (timestamp)

A date expressed as an ISO 8601 string.

It is important for the time zone to be included in the ISO 8601 date-time format. For example, 20120325T123010+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

Count -> (integer)

The number of documents in the response that have the attribute value for the key.

TotalNumberOfResults -> (integer)

The total number of items found by the search; however, you can only retrieve up to 100 items. For example, if the search found 192 items, you can only retrieve the first 100 of the items.