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

Rename fields_frequency into fields_distribution (and fieldsFrequency into fieldsDistribution) #719

Merged
merged 2 commits into from
May 27, 2020
Merged

Rename fields_frequency into fields_distribution (and fieldsFrequency into fieldsDistribution) #719

merged 2 commits into from
May 27, 2020

Conversation

eskombro
Copy link
Member

@eskombro eskombro commented May 26, 2020

The field returned in the /stats and /indexes/:index_uid/stats routes have been renamed to fieldsDistribution, instead of fieldsFrequency, as discussed with the core team (and the integrations team). This term was chosen for consistency with other naming in MeiliSearch, specially those chosen for the faceted filtering search (cf #716).

All the corresponding references to fields frequency have been updated in the code for consistency and coherence

Closes #713

@eskombro eskombro marked this pull request as draft May 26, 2020 18:45
@eskombro eskombro marked this pull request as ready for review May 26, 2020 19:22
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

Thank you very much for this PR, merging now!

@Kerollmops Kerollmops merged commit c1a2c7b into meilisearch:master May 27, 2020
bors bot added a commit that referenced this pull request Jan 16, 2023
719: Add more members of `filter_parser` to `milli::` & `From<&str>` implementation for `Token` r=Kerollmops a=GregoryConrad

## What does this PR do?
The current `milli::Filter` and `milli::FilterCondition` APIs require working with some members of `filter_parser` directly that `milli::` does *not* re-export to its users (at least when not parsing input using `parse`). Also, using `filter_parser` does not make sense when using milli from an embedded context where there is no query to parse.

Instead of reworking `milli::Filter` and `milli::FilterCondition`, this PR adds two non-breaking changes that ease the use of milli:
- Re-exports more members of the dependent version of `filter_parser` in `milli`
- Implements `From<&str>` for `filter_parser::Token`
  - This will also allow some basic tests that need to create a `Token` from a string to avoid some boilerplate.

In conjunction, both of these will allow milli users to easily create a `Token` from a `&str` without needing to add `filter_parser` as an extra dependency.

Note: I wanted to use `FromStr` for the `From` implementation; however, it requires returning a `Result` which is not needed for the conversion. Thus, I just left it as `From<&str>`.

Co-authored-by: Gregory Conrad <gregorysconrad@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change FieldFrequency to FieldDistribution
2 participants