values
The values:*
stages return string values, typically document field values.
You can use the following values stages in your analysis requests:
-
values:fromDocumentField
-
For each document, retrieves one or more values of the document field of your choice.
values:reference
-
References the results of another
values:*
stage defined in the request.
values:fromDocumentField
Returns one or more field values for each document in the referenced documents
set. The default
structure of this stage is shown in the figure below.
{
"type": "values:fromDocumentField",
"documents": {
"type": "documents:reference",
"auto": true
},
"fieldName": null,
"multipleValues": "REQUIRE_EXACTLY_ONE",
"threads": "auto"
}
The output of this request contains a list of string values (or arrays of string values). The putput array's entries are index-aligned with the list of input documents.
For example, the following request provides a list of values from the (required) title
field for
documents matching the photon query.
The result of the above request, on the reference Arxiv index:
Note that for multi-valued fields, the response will contain a list of values for each document. Here is a similar
request, collecting all values of the category
field (which is multi-valued):
The result of the above request, on the reference Arxiv index:
documents
The source list of
documents:*
from which field values should be retrieved.
fieldName
The field name whose values should be retrieved.
multipleValues
Provides additional information on the number of expected values retrieved from each document.
The multipleValues
property supports the following values:
COLLECT_FIRST
-
Retrieve and return only the first value of a field. This option can be applied to single and multivalued fields that always have at least one value. The response will contain an array of strings.
REQUIRE_EXACTLY_ONE
-
Retrieve and return the value of a single-valued field. This option can be applied to fields that always have exactly one value. The response will contain an array of strings.
COLLECT_ALL
-
Retrieve and return all values of a field. This option can be applied to all fields. The response will contain an array of arrays of values. An empty array of values is returned for documents which have no associated value for the requested field.
threads
The number of CPU threads used for computing aggregations. Leave at the default value.
values:*
Consumers of
The following stages and components take values:*
as
input:
Stage or component | Property |
---|---|
clusters:byValues | values |
documents:contrastScore | documentTimestamps contextTimestamps |