Extend SearchResult and MemoryResult objects #879
marcominerva
started this conversation in
2. Feature requests
Replies: 1 comment 3 replies
-
|
How about extending the classes? public class MySearchResult : SearchResult
{
public Dictionary<string, object?>? Metadata { get; set; }
}public class MySearchClient : ISearchClient
{
public async Task<SearchResult> SearchAsync(...)
{
var result = new MySearchResult();
// ....
return result
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We can easily provide a custom implementation of
ISearchClientif we want to define our custom search logic. However, we are tied to useSearchResultandMemoryAnswerreturn type, so we cannot add custom information.My suggestion is to add a property like "Metadata" to both
SearchResultandMemoryAnswer:In this way, new implementations of
SearchClientcan use this property to customize the response.Beta Was this translation helpful? Give feedback.
All reactions