Skip to content

[Feature Request] The source in script is not available #18985

@qianheng-aws

Description

@qianheng-aws

Is your feature request related to a problem? Please describe

When developing my own script engine, I want to retrieve value from the source for field of text type. However, the super class like FilterScript only has doc value related API exposed:

/** The doc lookup for the Lucene segment this script was created for. */
public final Map<String, ScriptDocValues<?>> getDoc() {
return leafLookup.doc();
}

although the leafLookup already has source related API exposed:
public SourceLookup source() {
return this.sourceLookup;
}

Describe the solution you'd like

Add a new method in FilterScript, AggregationScript and etc. to expose the SourceLookup of LeafSearchLookup:

    public final SourceLookup getSource() {
        return leafLookup.source();
    }

Related component

Plugins

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    PluginsenhancementEnhancement or improvement to existing feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions