JavaScript Index Stage Global Variables
JavaScript is a lightweight scripting language. In a JavaScript stage, Fusion uses the Nashorn engine, which implements ECMAScript version 5.1. What a JavaScript program can do depends on the container in which it runs. For a JavaScript Index stage, the container is a Fusion index pipeline. The following global pipeline variables are available:Syntax Variants
JavaScript stages can be written using function syntax. With function syntax, global variables are passed as function parameters.Support for legacy syntax was removed in Fusion 5.8.
Function Syntax
Function syntax is used for moderately complex tasks.Advanced Syntax
Advanced syntax is used for complex tasks and when multiple functions are needed.JavaScript Use
The JavaScript in a JavaScript Index stage must return either a single document or an array of documents. This can be accomplished by either:- a series of statements where the final statement evaluates to a document or array of documents
- a function that returns a document or an array of documents
Global variable logger
The logs are output to the indexing service logs for custom index stages. Access the Log Viewer and filter on this service to view the information.
JavaScript Query Stage Global Variables
JavaScript is a lightweight scripting language. In a JavaScript stage, Fusion uses the Nashorn engine, which implements ECMAScript version 5.1. What a JavaScript program can do depends on the container in which it runs. For a JavaScript Query stage, the container is a Fusion query pipeline. The following global pipeline variables are available:See Custom JavaScript Query Stage Examples for more information.
Syntax Variants
JavaScript stages can be written using function syntax. With function syntax, global variables are passed as function parameters.Support for legacy syntax was removed in Fusion 5.8.