QueryLargePassages
public struct QueryLargePassages : Codable, Equatable
Configuration for passage retrieval.
-
A passages query that returns the most relevant passages from the results.
Declaration
Swift
public var enabled: Bool? -
If
true, ranks the documents by document quality, and then returns the highest-ranked passages per document in adocument_passagesfield for each document entry in the results list of the response. Iffalse, ranks the passages from all of the documents by passage quality regardless of the document quality and returns them in a separatepassagesfield in the response.Declaration
Swift
public var perDocument: Bool? -
Maximum number of passages to return per document in the result. Ignored if
passages.per_documentisfalse.Declaration
Swift
public var maxPerDocument: Int? -
A list of fields to extract passages from. If this parameter is an empty list, then all root-level fields are included.
Declaration
Swift
public var fields: [String]? -
The maximum number of passages to return. Ignored if
passages.per_documentistrue.Declaration
Swift
public var count: Int? -
The approximate number of characters that any one passage will have.
Declaration
Swift
public var characters: Int? -
When true,
answerobjects are returned as part of each passage in the query results. The primary difference between ananswerand apassageis that the length of a passage is defined by the query, where the length of anansweris calculated by Discovery based on how much text is needed to answer the question. This parameter is ignored if passages are not enabled for the query, or no natural_language_query is specified. If the find_answers parameter is set totrueand per_document parameter is also set totrue, then the document search results and the passage search results within each document are reordered using the answer confidences. The goal of this reordering is to place the best answer as the first answer of the first passage of the first document. Similarly, if the find_answers parameter is set totrueand per_document parameter is set tofalse, then the passage search results are reordered in decreasing order of the highest confidence answer for each document and passage. The find_answers parameter is available only on managed instances of Discovery.Declaration
Swift
public var findAnswers: Bool? -
The number of
answerobjects to return per passage if the find_answers parmeter is specified astrue.Declaration
Swift
public var maxAnswersPerPassage: Int? -
Initialize a
QueryLargePassageswith member variables.Declaration
Swift
public init( enabled: Bool? = nil, perDocument: Bool? = nil, maxPerDocument: Int? = nil, fields: [String]? = nil, count: Int? = nil, characters: Int? = nil, findAnswers: Bool? = nil, maxAnswersPerPassage: Int? = nil )Parameters
enabledA passages query that returns the most relevant passages from the results.
perDocumentIf
true, ranks the documents by document quality, and then returns the highest-ranked passages per document in adocument_passagesfield for each document entry in the results list of the response. Iffalse, ranks the passages from all of the documents by passage quality regardless of the document quality and returns them in a separatepassagesfield in the response.maxPerDocumentMaximum number of passages to return per document in the result. Ignored if
passages.per_documentisfalse.fieldsA list of fields to extract passages from. If this parameter is an empty list, then all root-level fields are included.
countThe maximum number of passages to return. Ignored if
passages.per_documentistrue.charactersThe approximate number of characters that any one passage will have.
findAnswersWhen true,
answerobjects are returned as part of each passage in the query results. The primary difference between ananswerand apassageis that the length of a passage is defined by the query, where the length of anansweris calculated by Discovery based on how much text is needed to answer the question. This parameter is ignored if passages are not enabled for the query, or no natural_language_query is specified. If the find_answers parameter is set totrueand per_document parameter is also set totrue, then the document search results and the passage search results within each document are reordered using the answer confidences. The goal of this reordering is to place the best answer as the first answer of the first passage of the first document. Similarly, if the find_answers parameter is set totrueand per_document parameter is set tofalse, then the passage search results are reordered in decreasing order of the highest confidence answer for each document and passage. The find_answers parameter is available only on managed instances of Discovery.maxAnswersPerPassageThe number of
answerobjects to return per passage if the find_answers parmeter is specified astrue.Return Value
An initialized
QueryLargePassages.
View on GitHub
QueryLargePassages Structure Reference