#[non_exhaustive]pub struct QueryResultItem {Show 13 fields
pub id: Option<String>,
pub type: Option<QueryResultType>,
pub format: Option<QueryResultFormat>,
pub additional_attributes: Option<Vec<AdditionalResultAttribute>>,
pub document_id: Option<String>,
pub document_title: Option<TextWithHighlights>,
pub document_excerpt: Option<TextWithHighlights>,
pub document_uri: Option<String>,
pub document_attributes: Option<Vec<DocumentAttribute>>,
pub score_attributes: Option<ScoreAttributes>,
pub feedback_token: Option<String>,
pub table_excerpt: Option<TableExcerpt>,
pub collapsed_result_detail: Option<CollapsedResultDetail>,
}
Expand description
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.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: Option<String>
The unique identifier for the query result item id (Id
) and the query result item document id (DocumentId
) combined. The value of this field changes with every request, even when you have the same documents.
type: Option<QueryResultType>
The type of document within the response. For example, a response could include a question-answer that's relevant to the query.
format: Option<QueryResultFormat>
If the Type
of document within the response is ANSWER
, then it is either a TABLE
answer or TEXT
answer. If it's a table answer, a table excerpt is returned in TableExcerpt
. If it's a text answer, a text excerpt is returned in DocumentExcerpt
.
additional_attributes: Option<Vec<AdditionalResultAttribute>>
One or more additional fields/attributes associated with the query result.
document_id: Option<String>
The identifier for the document.
document_title: Option<TextWithHighlights>
The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.
document_excerpt: Option<TextWithHighlights>
An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.
document_uri: Option<String>
The URI of the original location of the document.
document_attributes: Option<Vec<DocumentAttribute>>
An array of document fields/attributes assigned to a document in the search results. For example, the document author (_author
) or the source URI (_source_uri
) of the document.
score_attributes: Option<ScoreAttributes>
Indicates the confidence level of Amazon Kendra providing a relevant result for the query. 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 is relevant to the query.
feedback_token: Option<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.
table_excerpt: Option<TableExcerpt>
An excerpt from a table within a document.
collapsed_result_detail: Option<CollapsedResultDetail>
Provides details about a collapsed group of search results.
Implementations§
Source§impl QueryResultItem
impl QueryResultItem
Sourcepub fn id(&self) -> Option<&str>
pub fn id(&self) -> Option<&str>
The unique identifier for the query result item id (Id
) and the query result item document id (DocumentId
) combined. The value of this field changes with every request, even when you have the same documents.
Sourcepub fn type(&self) -> Option<&QueryResultType>
pub fn type(&self) -> Option<&QueryResultType>
The type of document within the response. For example, a response could include a question-answer that's relevant to the query.
Sourcepub fn format(&self) -> Option<&QueryResultFormat>
pub fn format(&self) -> Option<&QueryResultFormat>
If the Type
of document within the response is ANSWER
, then it is either a TABLE
answer or TEXT
answer. If it's a table answer, a table excerpt is returned in TableExcerpt
. If it's a text answer, a text excerpt is returned in DocumentExcerpt
.
Sourcepub fn additional_attributes(&self) -> &[AdditionalResultAttribute]
pub fn additional_attributes(&self) -> &[AdditionalResultAttribute]
One or more additional fields/attributes associated with the query result.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .additional_attributes.is_none()
.
Sourcepub fn document_id(&self) -> Option<&str>
pub fn document_id(&self) -> Option<&str>
The identifier for the document.
Sourcepub fn document_title(&self) -> Option<&TextWithHighlights>
pub fn document_title(&self) -> Option<&TextWithHighlights>
The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.
Sourcepub fn document_excerpt(&self) -> Option<&TextWithHighlights>
pub fn document_excerpt(&self) -> Option<&TextWithHighlights>
An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.
Sourcepub fn document_uri(&self) -> Option<&str>
pub fn document_uri(&self) -> Option<&str>
The URI of the original location of the document.
Sourcepub fn document_attributes(&self) -> &[DocumentAttribute]
pub fn document_attributes(&self) -> &[DocumentAttribute]
An array of document fields/attributes assigned to a document in the search results. For example, the document author (_author
) or the source URI (_source_uri
) of the document.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .document_attributes.is_none()
.
Sourcepub fn score_attributes(&self) -> Option<&ScoreAttributes>
pub fn score_attributes(&self) -> Option<&ScoreAttributes>
Indicates the confidence level of Amazon Kendra providing a relevant result for the query. 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 is relevant to the query.
Sourcepub fn feedback_token(&self) -> Option<&str>
pub fn feedback_token(&self) -> Option<&str>
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.
Sourcepub fn table_excerpt(&self) -> Option<&TableExcerpt>
pub fn table_excerpt(&self) -> Option<&TableExcerpt>
An excerpt from a table within a document.
Sourcepub fn collapsed_result_detail(&self) -> Option<&CollapsedResultDetail>
pub fn collapsed_result_detail(&self) -> Option<&CollapsedResultDetail>
Provides details about a collapsed group of search results.
Source§impl QueryResultItem
impl QueryResultItem
Sourcepub fn builder() -> QueryResultItemBuilder
pub fn builder() -> QueryResultItemBuilder
Creates a new builder-style object to manufacture QueryResultItem
.
Trait Implementations§
Source§impl Clone for QueryResultItem
impl Clone for QueryResultItem
Source§fn clone(&self) -> QueryResultItem
fn clone(&self) -> QueryResultItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for QueryResultItem
impl Debug for QueryResultItem
Source§impl PartialEq for QueryResultItem
impl PartialEq for QueryResultItem
impl StructuralPartialEq for QueryResultItem
Auto Trait Implementations§
impl Freeze for QueryResultItem
impl RefUnwindSafe for QueryResultItem
impl Send for QueryResultItem
impl Sync for QueryResultItem
impl Unpin for QueryResultItem
impl UnwindSafe for QueryResultItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);