Skip to main content

xlucene-translator / query-access/source-fields

query-access/source-fields

Functions​

getProjectablePaths()​

getProjectablePaths(typeConfig): string[]

Defined in: xlucene-translator/src/query-access/source-fields.ts:29

The field paths a projection can name.

A path is projectable when nothing is declared beneath it: a leaf, or an object whose shape the type config does not describe. The parent nested of a declared nested.name is not projectable; it is rebuilt from its readable children.

Parameters​

ParameterType
typeConfigxLuceneTypeConfig

Returns​

string[]


getReadableFields()​

getReadableFields(typeConfig, includes?, excludes?): string[]

Defined in: xlucene-translator/src/query-access/source-fields.ts:46

The paths that may be returned, given the _source include and exclude lists.

As in Elasticsearch, a field is readable when an include covers it (or there are no includes) and no exclude covers it.

An exclude list containing '*' means nothing may be returned. restrictSourceFields returns it when a caller asks only for fields they may not read.

Parameters​

ParameterTypeDefault value
typeConfigxLuceneTypeConfigundefined
includesreadonly string[][]
excludesreadonly string[][]

Returns​

string[]


restrictionCovers()​

restrictionCovers(restriction, path): boolean

Defined in: xlucene-translator/src/query-access/source-fields.ts:18

Whether a restriction entry covers a field path.

The match is by dotted segment, not string prefix: nested covers nested.name, but nest does not. matchTypeField uses the same rule, so a field is readable exactly when it is queryable.

Parameters​

ParameterType
restrictionstring
pathstring

Returns​

boolean