Skip to content

v0.21: update .code-samples.meilisearch.yaml #1025

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

Merged
merged 7 commits into from
Jul 20, 2021

Conversation

dichotommy
Copy link
Contributor

@dichotommy dichotommy commented Jul 5, 2021

In this PR

The following changes from v0.21 are reflected here:

In addition, several samples have had their ID updated:

  • get_attributes_for_faceting_1 -> get_filterable_attributes_1
  • update_attributes_for_faceting_1 -> update_filterable_attributes_1
  • reset_attributes_for_faceting_1 -> reset_filterable_attributes_1
  • faceted_search_walkthrough_attributes_for_faceting_1 -> faceted_search_walkthrough_filterable_attributes_1
  • faceted_search_facet_filters_1 -> faceted_search_filter_1
  • faceted_search_walkthrough_facet_filters_1 -> faceted_search_walkthrough_filter_1

search_parameter_guide_matches_1 and search_parameter_guide_highlight_1 have been altered: the query has been changed from shifu to winter feast and highlighting has been removed from the former. The former is because the terms occur earlier in the value, making it a better demonstration of matches and highlighting, and the latter is because we don't want to encourage using both matches and attributesToHighlight at the same time—one is sufficient for most use-cases.

Finally, a brand new sample has been added to demonstrate the use of Phrase Search: phrase_search_1.

For @meilisearch/integration-team

In addition to making the equivalent changes in each of the SDKs, please make sure to:

  • Add add_movies_json_1 sample to Rust
  • Pay special attention to the search_parameter_guide_matches_1. There should be no filter nor attributesToHighlight present here.

For @guimachiavelli

  • Please add an example, using <CodeSamples id="phrase_search_1" />, into your phrase search PR
  • Please update the JSON response in the Highlighting and Matches section of your search parameters PR.

update curl examples, update names, change search parameter Matches example
@netlify
Copy link

netlify bot commented Jul 5, 2021

✔️ Deploy Preview for distracted-wiles-3edfc5 ready!

🔨 Explore the source changes: 06b6f25

🔍 Inspect the deploy log: https://app.netlify.com/sites/distracted-wiles-3edfc5/deploys/60ed44dbb2d1a500070cfde5

😎 Browse the preview: https://deploy-preview-1025--distracted-wiles-3edfc5.netlify.app

Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

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

Faceted search guide

If the guide on faceted search should have a name change before the release, ID's should be updated accordingly.

For example this ID:

faceted_search_facet_filters_1

Highlight and matches shifu examples

Finally, search_parameter_guide_matches_1 has been altered

Highlight example should also be updated, because of this:

highlight

sample update:

search_parameter_guide_highlight_1: |-
  curl 'http://localhost:7700/indexes/movies/search' \
    --data '{ "q": "winter feast", "attributesToHighlight": ["overview"] }'

@dichotommy
Copy link
Contributor Author

dichotommy commented Jul 5, 2021

Yes good point, thank you @bidoubiwa ! I will update search_parameter_guide_highlight_1 and add a new sample for phrase search right now.

If the guide on faceted search should have a name change before the release, ID's should be updated accordingly. For example this ID: faceted_search_facet_filters_1

This ID has already been changed to faceted_search_filter_1 🙂

@guimachiavelli , please use the two responses Charlotte wrote out to update your Search Parameters PR.

Add new sample for phrase search and update highlighting sample so that highlighting occurs closer to the start of the value (more clear)
@dichotommy dichotommy requested a review from bidoubiwa July 5, 2021 16:31
Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

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

Could you change the response bodies of both highlight and matches because it seems to be the appropriated PR to do so.

This is the file:
https://github.com/meilisearch/documentation/blob/master/reference/features/search_parameters.md

See my previous comment for the body to use.

@dichotommy
Copy link
Contributor Author

Could you change the response bodies of both highlight and matches because it seems to be the appropriated PR to do so.

Think it might be easier if @guimachiavelli reopens his PR #1016 in a new branch based off of the prepare-docs-v0.21 branch, and we make the changes you described there. That way we don't have to deal w/ messy merge conflicts later.

@bidoubiwa
Copy link
Contributor

Examples previously using facetFilters should have their filter changed like this:

genres:comedy => genres=comedy

@bidoubiwa
Copy link
Contributor

bidoubiwa commented Jul 7, 2021

facetsDistribution becomes facetDistribution

Mistaken for fieldsDistribution my bad

@dichotommy
Copy link
Contributor Author

dichotommy commented Jul 7, 2021

@meilisearch/integration-team , you can use this PR as a model for updating the .code-samples in the SDKs.

Please also:

  • Remove filters and attributesToHighlight from search_parameter_guide_matches_1 (matches should be the only parameter besides the query itself)
  • Add add_movies_json_1 to Rust .code-samples

@alallema
Copy link
Contributor

alallema commented Jul 8, 2021

Hello !
Oopsy I click on approve instead ...
It's not related but there is a typo in line 4
list_all_indexes_1: |1-
should be:
list_all_indexes_1: |-

@guimachiavelli guimachiavelli merged commit b58d038 into prepare-docs-v0.21 Jul 20, 2021
@guimachiavelli guimachiavelli deleted the v0.21-update-code-samples-1 branch July 20, 2021 10:08
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.

4 participants