-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing GROUP_BY support in Multisearch requests #247
Comments
I was also trying to get grouped results. You can do something like this: var query = new GroupedSearchParameters("search term", "query_field", "GROUP_BY_FIELD"); # GROUP_BY_FIELD must be a facet field
var searchResult = await client.SearchGrouped<Product>("collection_name", query);
foreach (var result in searchResult.GroupedHits)
{
foreach (var resultHit in result.Hits)
{
Console.WriteLine(resultHit.Document.Id + ": " + resultHit.Document.Title);
}
} |
Just for clarification: ideally it should be flexible to support making both - regular and grouped requests in the same scope of multisearch. Thanks! |
@Spaggel I need not only grouped results, but also make a couple of other ones in the scope of a single multisearch request. See: https://typesense.org/docs/27.0/api/federated-multi-search.html |
@jarto666 is this what you're looking for? https://github.com/DAXGRID/typesense-dotnet#multi-search-documents |
@Spaggel Yes, but current MultiSearchParameters implementation does not support GroupBy |
@runeanielsen please give your thoughts on implementation. So, we could add those to MultiSearchParameters or try to inherit those 3 from GroupedSearchParameters (notice group_missing_values which is also missing from current codebase). Though, inheritance would also require revision of GroupedSearchParameters constructors, since groupBy in this case would become optional. [JsonPropertyName("group_by")] [JsonPropertyName("group_limit")] [JsonPropertyName("group_missing_values")] And this would allow us to simply extend MultiSearchResult with GroupedHits: public record MultiSearchResult Not the cleanest solution architecturally, the main issue with those parameters duplication, but up for you to consider it. Tested and it's working. Thanks! |
Hi @jarto666, I'll take a look as soon as possible, I am a bit busy right now. |
@jarto666 I've released a new version (7.19.0). Thank you for you contribution. :) // Rune |
Can support for group_by parameter in multisearch requests be implemented?
The text was updated successfully, but these errors were encountered: