Skip to content

Pass current shard id into IndexFieldData.Builder.builder #57231

@anti-social

Description

@anti-social

I'm writing a plugin that uses data from some embedded database. The plugin implements its own MappedFieldType and IndexFieldData so it is possible to access that data inside Elasticsearch queries. The idea was stolen from Solr's external file field. And now I want to split the database on shards to make queries faster. But it is not possible to get shardId when creating IndexFieldData.

I propose to modify IndexFieldData.Builder.build method. All its arguments can be joined into some IndexFieldDataContext that will have getShardId method. As I can see when fielddata is created inside QueryShardContext.getForField it is possible to pass current shardId.

The only place I cannot get shardId for fielddata is IndexSortConfig.buildIndexSort

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions