[FEATURE] Allow custom serialization and deserialization for custom TopDocs implementation #9697
Labels
enhancement
Enhancement or improvement to existing feature or request
Search
Search query, autocomplete ...etc
Problem definition
It's not possible to use custom TopDocs implementation for scenarios when there and multiple nodes in cluster and query results need to be serialized for sending from data node and deserialized on coordinator node. Current logic supports three types of TopDocs with certain limits on information in those objects.
Code refs for serialization logic and deserialization logic.
It may be required for scenarios when standard TopDocs format needs to be extended. In general any type of info retrieval where processing is required at coordinator level. For example, in case of Hybrid Query we need to send collection of results from multiple queries to coordinator node, where scores are processed by search pipeline processor.
Describe the solution you'd like
A way for developer to provide serialization and serialization logic of their implementation of TopDocs. Existing logic with case/switch on predefined types can be a fallback mechanism in case object doesn't have any specific implementation.
Describe alternatives you've considered
Make new TopDocs implementation part of core (similar to CollapseTopFieldDocs) along with a new case in switch clause specifically for that new type.
That is not very flexible and also custom TopDocs implementation may be not very generic to make it part of core OpenSearch.
The text was updated successfully, but these errors were encountered: