JSON Parser Stage

JSON parser stage

JSON parsing converts JSON content from a single document field into one or more new documents. This parser uses Solr’s JsonRecordReader to split JSON into sub-documents.

Tip
When entering configuration values in the UI, use unescaped characters, such as \t for the tab character. When entering configuration values in the API, use escaped characters, such as \\t for the tab character.

JSON stage-specific properties

Property Description, Type
enabled

Enable this Parser Stage

type: boolean

default value: 'true'

errorHandling

Error Handling

type: string

default value: 'mark'

enum: { ignore log fail mark }

id

Parser ID

type: string

default value: 'b7b96a3b-81f6-4b44-aa16-15cbe8a9f075'

includePath

Include root path

Include parent element names when using a root path.

type: boolean

default value: 'false'

inheritMediaTypes

use default media types for this Parser Stage

Indicates if parser stage should use the default media types. Unchecking this box means that ONLY the manually configured media types will be parsed by the parser and you then MUST provide at least one media type.

type: boolean

default value: 'true'

listHandling

JSON List handling

Create a single multivalued field containing all items, or a separate index-numbered field per list item?

type: string

default value: 'multivalued'

enum: { multivalued index_numbered }

mappings

Mapping rules

Extract parts of the document into specified fields

type: array of object

object attributes: {
  path  (required) : {
    display name: JSONPath expression
    type: string
    }
  target  (required) : {
    display name: Target field
    type: string
    }
  }

mediaTypes

Media Types for this Parser Stage

type: array of string

outputFieldPrefix

Prefix parsed fields with

Fields extracted by this parser will be prefixed with this string. The remainder of the field name will be as detected in the stream

type: string

maxLength: 20

pattern: ^$|^[A-Za-z_][A-Za-z0-9_\-\.]+$

pathPatterns

File names to parse

Specify a file name or pattern that must be matched for this parser stage to run. Forward slashes ("/") are used to join names of files inside archives with the archive name.

type: array of object

object attributes: {
  pattern : {
    display name: File name or pattern
    type: string
    description : e.g.: "z.txt" or "*.md" or "/a/*/b/f.txt" for glob; "z.txt$" or ".*\.txt$" or "^/a/[^\/]*/b/f.txt$" for regex
    }
  syntax : {
    display name: Pattern type
    type: string
    default value: 'glob'
    description : glob uses bash shell-style wildcards; regex uses Java (PCRE-style) regex
    enum: { glob regex     }

    }
  }
rootPath

Root path

Use only children of this JSON pointer.

type: string

splitArrays

Split arrays

First split top-level arrays into multiple documents, and then apply other rules.

type: boolean

default value: 'true'

type

required

type: string

default value: 'json'

enum: { json }