Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Errors - Add variant for invalid_filter/invalid_sort when related settings are empty #125

Merged

Conversation

gmourier
Copy link
Member

@gmourier gmourier commented Mar 9, 2022

Summary

Add a variant for invalid_filter and invalid_sort errors when filterablesAttributes / sortablesAttributes are empty.

@gmourier gmourier self-assigned this Mar 9, 2022
@gmourier gmourier requested a review from brunoocasali March 9, 2022 15:38
@gmourier gmourier added Ready For Review Feature specification must be reviewed. Patch This PR patch a feature specification Q2:2022 v0.27 labels Mar 9, 2022
@gmourier gmourier requested a review from irevoire March 9, 2022 15:45
"message": "Attribute `:attribute` is not filterable. This index does not have configured filterable attributes.",
"code": "invalid_filter",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_filter"
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why, but this works: https://docs.meilisearch.com/reference/api/error_codes.html#invalid-filter not https://docs.meilisearch.com/reference/api/error_codes.html#invalid_filter.

Any thoughts @guimachiavelli @bidoubiwa ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good spot @brunoocasali! May need to update the whole specification then 🥷 At least the link leads to the errors page.

Copy link
Contributor

Choose a reason for hiding this comment

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

The errors page story is an old one built on an ancient and questionable script. See meilisearch/documentation#1299
But good new, it is being updated by @maryamsulemani97 meilisearch/documentation#1503

Once that PR is merged there shouldn't be any anchor problems and we'll be able to search for error codes in the search bar of the documentation

Copy link
Member Author

Choose a reason for hiding this comment

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

As long as the anchors work and the routes returned by the binary do not fall on a 404, it is all good on our side.

Please, let us know if we need to make a change on our end. On the other side, it could be managed with redirections on the documentation site 😇

Copy link
Member

@guimachiavelli guimachiavelli Mar 15, 2022

Choose a reason for hiding this comment

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

The Errors page was until recently completely separate from the regular docs website. While all our docs are written in markdown, that specific page was generated from a yaml file as described by @bidoubiwa. We scrapped that a few weeks ago and moved the Errors page completely inside vuepress. The transition was a glorified copypaste of yaml content into an md file; it also moved docs.meilisearch.com/errors into docs.meilisearch.com/api/error_codes.html. meilisearch/documentation#1503 will further improve the page (and possibly move it again).

The anchor link formatting is related to this transition. Vuepress automatically turns spaces into -, not _. docs.meilisearch.com/errors#invalid_filter only worked because the Errors page was outside vuepress. Now that the Errors page is being parsed as markdown, all anchor links will use -.

We are already redirecting regular links (https://docs.meilisearch.com/errors) to the new page (https://docs.meilisearch.com/reference/api/errors), but I'm unsure our redirects allow us to do the same for anchor links. Even if it is possible, it would probably require a lot of effort for relatively little gain (as @gmourier says, users are still brought to the correct page).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, @guimachiavelli for the information! It should be easy to change the links on the core side if it's not possible to have a redirection on the documentation side that would lead to the right anchor.

The advantage of redirection is that we are all more independent.

It's not a big problem, just let me know if the redirection is possible when we have time to explore this topic. Then we'll see. 🚀

text/0061-error-format-and-definitions.md Show resolved Hide resolved
@gmourier gmourier force-pushed the patch-sort-and-filter-add-variant-for-empty-settings branch from d3d10ee to cf8b6dc Compare March 14, 2022 17:07
@gmourier gmourier mentioned this pull request Mar 15, 2022
1 task
brunoocasali
brunoocasali previously approved these changes Mar 15, 2022
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.

🔥 🚒

guimachiavelli
guimachiavelli previously approved these changes Mar 30, 2022
Copy link
Member

@guimachiavelli guimachiavelli left a comment

Choose a reason for hiding this comment

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

Variant error messages in line with our other warnings. LGTM! 🍰

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>
@gmourier gmourier dismissed stale reviews from guimachiavelli and brunoocasali via 9f902f5 March 31, 2022 08:53
@gmourier gmourier merged commit 5fc0015 into develop Mar 31, 2022
@gmourier gmourier deleted the patch-sort-and-filter-add-variant-for-empty-settings branch March 31, 2022 08:59
@gmourier
Copy link
Member Author

gmourier commented Mar 31, 2022

Merging it since the last commit was a minor change and the spec has been approved just before. Thanks, team!

gmourier added a commit that referenced this pull request Mar 31, 2022
… settings are empty (#125)

* Add variant for invalid_sort and invalid_filter errors when settings are empty

* Update text/0061-error-format-and-definitions.md

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>
@gmourier gmourier added Implemented Feature specification has been implemented. and removed Ready For Review Feature specification must be reviewed. labels Apr 26, 2022
gmourier added a commit that referenced this pull request May 16, 2022
* Instance Options (#119)

* Add instance options spec

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Numeric title + add dump options

* Add link to dump spec

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Add title numerotations

* Add telemetry for new options

* Apply changes after the review

* Update text/0119-instance-options.md

* Update text/0119-instance-options.md

Co-authored-by: Many <legendre.maxime.isn@gmail.com>

* Update text/0119-instance-options.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Update text/0119-instance-options.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Change naming after the review

* Update text/0034-telemetry-policies.md

* Update text/0034-telemetry-policies.md

* Update text/0034-telemetry-policies.md

* Update text/0034-telemetry-policies.md

* Apply suggestions from code review

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Update text/0119-instance-options.md

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>

* Update text/0119-instance-options.md

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>
Co-authored-by: Many <legendre.maxime.isn@gmail.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Settings API - v0.26.0 state (#123)

* Add a Settings API specification file

* Add distinct-attribute-setting-api.md

* Add displayed-attributes and searchable-attributes specification file

* Add stop-words setting api

* Add synonyms setting api

* Rename spec files and fix some typos

* Add ranking rules setting api

* Add filterable-attributes and sortable-attributes settings API

* Add a Triggering Documents Re-Indexing technical section

* Rephrase 202 Accepted Response for POST Methods

* Apply Triggering Documents Re-Indexing Technical part on related sub settings

* Update synonyms setting api file

* Precise and rephrase some sentences

* Remove bullet point title

* Add limitation about manually specifying searchableAttributes

* Update spec template according to our current usage (#127)

* Update spec template according to our current usage

* Update text/0000-specification-template.md

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Remove bullet point dedicated to title

* Rename Technical Aspects to Technical Details

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Documents API (#133)

* Catch-up documents api specification

* Add precisions and examples

* Apply suggestions from code review

Co-authored-by: Many <legendre.maxime.isn@gmail.com>

Co-authored-by: Many <legendre.maxime.isn@gmail.com>

* Stats API (#134)

* Add Stats API specification

* Rename spec file with pr number

* Clean typo, add precisions and fix inner linking

* Apply suggestions from code review

Co-authored-by: maryamsulemani97 <90181761+maryamsulemani97@users.noreply.github.com>

* Change order of API endpoints

Co-authored-by: maryamsulemani97 <90181761+maryamsulemani97@users.noreply.github.com>

* Errors - Add variant for `invalid_filter`/`invalid_sort` when related settings are empty (#125)

* Add variant for invalid_sort and invalid_filter errors when settings are empty

* Update text/0061-error-format-and-definitions.md

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>

* Add missing "v" in the user-agent data (#136)

Following the issue meilisearch/integration-guides#150 there is a "v" before the version of the package.

* Indexes API (#132)

* Catch-up Indexes API

* Add details by field for an Index API Resource

* fix typo

* Add future possibilities

* Apply suggestions from code review

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Add precisions from review

* lowercase type

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Remove never-implemented and deprecated 0042-paginated-search.md (#147)

* Settings API - Typo Tolerance (#117)

* Draft file for Typo Tolerance specification

* rename spec file

* Rename specification

* draft

* Add open-api.yaml prototype

* Add typoTolerance component on POST search

* Add typoTolerance object into search api parameters

* fix typos

* remove the past tense

* Add typoTolerance GET query parameters

* Fix description

* Add explanations for disableOnWords property

* Update spec href

* Describe indexes/:index_uid/settings/typo-tolerance endpoint

* Explain why it is useful to expose typo tolerance settings at search time

* Remove typoTolerance properties at search time

* Add a future possiblity to change POST verb to PATCH to edit a settings partially

* Sync spec with telemetry

* Mark TODO on technical details and rework structure of specification

* Specify properties required to false to allow partial updates

* Add error definitions for typoTolerance API resource properties

* Rename spec file

* Restore deleted metric

* Update text/0117-typo-tolerance-settings-api.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Update text/0117-typo-tolerance-settings-api.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Bruno Casali <brunoocasali@gmail.com>

* Replace W to w in telemtry

* Apply consistency on new errors message

* fix typo

* Add Async Errors and Lazy Index Creation

* Rename telemetry nodes

* Mention case insensivity of disableOnWords parameter

* Describes synchronous (type-checking)  and asynchronous (business logic) errors

* Add examples for minWordSizeFor1Typo and minWordSizeFor2Typos

* Elaborate on examples

* Remove title bullet point

* Apply naming suggestions

* Apply naming changes on telemetry and miss on OpenAPI

* Branch typo sub-ressource to settings-api specification

* Fix typo (lul)

* Add Technical Details

* Apply suggestions from code review

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Replace minWordSizeForXTypos fields by a minWordSizeForTypos object

* Update text/0034-telemetry-policies.md

Co-authored-by: ad hoc <postma.marin@protonmail.com>

* Apply suggestions from code review

Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Remove dedicated error for type checking

* Update text/0034-telemetry-policies.md

Co-authored-by: Bruno Casali <brunoocasali@gmail.com>

* Bring naming changes

* Fix metrics name for typo_tolerance

* Update text/0034-telemetry-policies.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
Co-authored-by: ad hoc <postma.marin@protonmail.com>
Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Data Types - Add Nested Fields Support (#121)

* Add a draft spec with nested fields flattening examples

* Consitent phrasing

* Fix markdown syntax

* Add null section

* Add Object example section

* Apply suggestions from code review

Co-authored-by: Clément Renault <renault.cle@gmail.com>

* Rename spec file to PR id

* Add special searchableAttributes default case with flattening alg

* Rephrase document structure representation

* Add a dotnotation section

* Add dot-notation section

* Update text/0121-data-types.md

Co-authored-by: Quentin de Quelen <quentin@meilisearch.com>

* Add Future Possibilities

* Rework nested notation sections

* Fix TODO and mention the . notation and all properties notation

* Add a edge case section

* Fix missing block code marker

* Update text/0123-ranking-rules-setting-api.md

Co-authored-by: Clément Renault <renault.cle@gmail.com>

* Apply suggestions from code review

Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>
Co-authored-by: Clément Renault <renault.cle@gmail.com>

* Fix section number

* Remove unclear sentence

* Remove dedicated object section

Co-authored-by: Clément Renault <renault.cle@gmail.com>
Co-authored-by: Quentin de Quelen <quentin@meilisearch.com>
Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Search API - Formatting Search Results (#120)

* Draft a revamp of the formatting search results spec

* Removes formatting-search-results specification

* wip

* Fix links

* Add precision

* Update OpenAPI

* Fix sentences

* Add consistency

* Add details and fix sentences

* Fix default value in OpenAPI spec

* Add Future Possibilities for _matchesInfo

* Remove bullet point title

* Add wip examples

* Add _formatted behavior regarding attributesToRetrieve, attributesToCrop and attributesToHighlight

* Apply suggestions from code review

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Fix typo

* Mention no effect case of  cropMarker / cropLength / highlightPostTag / highlightPreTag  on attributesToCrop  & attributesToHighlight

* Re-explain _formatted in details

* Mention Synonyms

* Add precision after team feedback

* Apply suggestions from code review

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>

* Add precisions

* Add boolean analytics for fields dedicated to customize formatting of search results behaviors

* Precise behavior for _formatted

* Add clearer explanations for the cropping algorithm and the fact that it keep the phrase context when extending around

* Apply suggestions from code review

Co-authored-by: Many <legendre.maxime.isn@gmail.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Precise highlighting around every matched query term

* Apply suggestions from code review

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Precise cropLength behavior when 0 is specified

* Remove filter-and-facet-behavior spec to merge it into search-api, and correct some types description

* Improve formatted spec (#146)

* Improve formatted spec

* Update text/0118-search-api.md

Co-authored-by: Tamo <irevoire@protonmail.ch>

* Update text/0118-search-api.md

Co-authored-by: Tamo <irevoire@protonmail.ch>

* Update text/0118-search-api.md

Co-authored-by: Tamo <irevoire@protonmail.ch>

* Update text/0118-search-api.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Update text/0118-search-api.md

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Improve according to reviews

Co-authored-by: Tamo <irevoire@protonmail.ch>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Add missing precision for highlightPostTag

* fix broken links

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
Co-authored-by: gui machiavelli <hey@guimachiavelli.com>
Co-authored-by: Many <legendre.maxime.isn@gmail.com>
Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>
Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>
Co-authored-by: Tamo <irevoire@protonmail.ch>

* Bump API to v0.27.0 version

Co-authored-by: Clémentine Urquizar - curqui <clementine@meilisearch.com>
Co-authored-by: Many <legendre.maxime.isn@gmail.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
Co-authored-by: maryamsulemani97 <90181761+maryamsulemani97@users.noreply.github.com>
Co-authored-by: gui machiavelli <hey@guimachiavelli.com>
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
Co-authored-by: ad hoc <postma.marin@protonmail.com>
Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>
Co-authored-by: Clément Renault <renault.cle@gmail.com>
Co-authored-by: Quentin de Quelen <quentin@meilisearch.com>
Co-authored-by: Tamo <irevoire@protonmail.ch>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Implemented Feature specification has been implemented. Patch This PR patch a feature specification Q2:2022 v0.27
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants