Skip to content
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

added proper types for facetStats, facetDistributions and matchesPosition #296

Merged
merged 4 commits into from
Apr 29, 2023

Conversation

ahmednfwela
Copy link
Collaborator

@ahmednfwela ahmednfwela commented Apr 27, 2023

Pull Request

Related issue

Fixes #294

What does this PR do?

  • Introduces new classes
    1. FacetStat
    2. MatchPosition
  • [Breaking] change Searchable<T> to have proper types:
    - final Object? facetDistribution;
    + final Map<String, Map<String, int>>? facetDistribution;
    - final Object? matchesPosition;    
    + final Map<String, List<MatchPosition>>? matchesPosition;
    + final Map<String, FacetStat>? facetStats;
  • Internal refactoring to not repeat any deserialization logic between Searchable<T> and its subclasses SearchResult<T> and PaginatedSearchResult<T>

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

cc @brunoocasali

Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the detailed PR description. It is extremely useful to me! 🥇

I left some comments. If you agree with them we can apply them to the entire repo.

lib/src/searchable_helpers.dart Show resolved Hide resolved
lib/src/searchable_helpers.dart Outdated Show resolved Hide resolved
lib/src/searchable_helpers.dart Outdated Show resolved Hide resolved
test/search_test.dart Outdated Show resolved Hide resolved
test/search_test.dart Outdated Show resolved Hide resolved
test/search_test.dart Outdated Show resolved Hide resolved
test/search_test.dart Outdated Show resolved Hide resolved
@brunoocasali brunoocasali added the enhancement New feature or request label Apr 28, 2023
Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ahmednfwela 🥇

bors merge

@bors
Copy link
Contributor

bors bot commented Apr 29, 2023

@bors bors bot merged commit c9fcdfc into meilisearch:main Apr 29, 2023
@ahmednfwela ahmednfwela deleted the facet_stats branch April 29, 2023 16:49
@brunoocasali brunoocasali added the breaking-change The related changes are breaking for the users label May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change The related changes are breaking for the users enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for the new stats from numerical facets like min, max
2 participants