valueCollector

Collects a list of values from a single document. Value collectors provide values in query​Builder​Variable specifications.

The following value​Collector:​* stage types are available for use in analysis request JSONs:

value​Collector:​concat

Concatenates values from another collector into a single value.

value​Collector:​direct​String

Collects constant string values for each document.

value​Collector:​direct​Strings

Collects a constant list of string values for each document.

value​Collector:​from​Content​Field

Collects the value of the document content field you provide.

value​Collector:​from​Context

Collects a query builder variable created by the parent query builder.

value​Collector:​from​Document​Neighbors

Fetches the input document's neighbor documents, invokes the value collector you provide on each neighbor document.

value​Collector:​max

Collects the maximum of values from another collector.

value​Collector:​min

Collects the minimum of values from another collector.

value​Collector:​concat

Concatenates values from another collector into a single value.

{
  "type": "valueCollector:concat",
  "delimiter": " ",
  "valueCollector": null
}

delimiter

Type
string
Default
" "
Required
no

The delimiter to use to join the values.

value​Collector

Type
valueCollector
Default
null
Required
yes

The value collector to provide the values to concatenate.

value​Collector:​direct​String

Collects constant string values for each document.

{
  "type": "valueCollector:directString",
  "value": null
}

value

Type
string
Default
null
Required
yes

The value to collect.

You can use request variables to customize the value.

value​Collector:​direct​Strings

Collects constant list of string values for each document.

{
  "type": "valueCollector:directStrings",
  "values": null
}

values

Type
array of string
Default
null
Required
yes

The list of values to collect.

You can use request variables to customize the value.

value​Collector:​from​Content​Field

Collects the value of the document content field you provide.

{
  "type": "valueCollector:fromContentField",
  "fieldName": null,
  "labelFilter": {
    "type": "labelFilter:acceptAll"
  }
}

From each input document, collects all the values of the document's content field you configure.

field​Name

Type
string
Default
null
Required
yes

The name of the content field from which to collect the values.

label​Filter

Type
labelFilter
Default
{
  "type": "labelFilter:acceptAll"
}
Required
no

The label filter that determines which field values to collect.

This collector collects only the field values accepted by the filter you provide in this property.

value​Collector:​from​Context

Collects a query builder variable created by the parent query builder.

{
  "type": "valueCollector:fromContext",
  "variable": null
}

This collector is useful for retrieving query builder variables passed by the query​Builder:​aligned query builder its child query builders.

variable

Type
string
Default
null
Required
yes

The name of the variable whose value to collect.

value​Collector:​from​Document​Neighbors

Fetches the input document's neighbor documents, invokes the value collector you provide on each neighbor document.

{
  "type": "valueCollector:fromDocumentNeighbors",
  "documentNeighbors": {
    "type": "documentNeighbors:reference",
    "auto": true
  },
  "valueCollector": null
}

For each input document this collector performs the following actions:

  1. Invoke the document​Neighbors component you provide to fetch the list of neighbor documents.

  2. From each neighbor document, invoke the value​Collector, collect all values returned by the collector.

document​Neighbors

Type
documentNeighbors
Default
{
  "type": "documentNeighbors:reference",
  "auto": true
}
Required
no

Provides the input document's neighbor documents from which to collect values.

value​Collector

Type
valueCollector
Default
null
Required
yes

The collector to use to collect values from all neighbor documents.

value​Collector:​max

Collects the maximum of values from another collector.

{
  "type": "valueCollector:max",
  "valueCollector": null
}

value​Collector

Type
valueCollector
Default
null
Required
yes

The collector providing values from which this component chooses the maximum value. The collector must provide comparable values, such as numbers or strings.

value​Collector:​min

Collects the minimum of values from another collector.

{
  "type": "valueCollector:min",
  "valueCollector": null
}

value​Collector

Type
valueCollector
Default
null
Required
yes

The collector providing values from which this component chooses the minium value. The collector must provide comparable values, such as numbers or strings.

Consumers of value​Collector:​*

The following stages and components take value​Collector:​* as input:

Stage or component Property
document​Scorer:​by​Values
  • value​Collector
  • value​Collector:​concat
  • value​Collector
  • value​Collector:​from​Document​Neighbors
  • value​Collector
  • value​Collector:​max
  • value​Collector
  • value​Collector:​min
  • value​Collector
  • values:​from​Documents
  • value​Collector