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
I'm writing a plugin that uses data from some embedded database. The plugin implements its own
MappedFieldTypeandIndexFieldDataso 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 getshardIdwhen creatingIndexFieldData.I propose to modify IndexFieldData.Builder.build method. All its arguments can be joined into some
IndexFieldDataContextthat will havegetShardIdmethod. As I can see when fielddata is created inside QueryShardContext.getForField it is possible to pass currentshardId.The only place I cannot get
shardIdfor fielddata is IndexSortConfig.buildIndexSort