Description
Also, if you are a maintainer, please add any clarification and instructions about this issue.
Sorry if this is already wholly/partially implemented. Feel free to let me know about the state of this issue in the repo.
Related to meilisearch/integration-guides#280
This issue is divided into two sections, first, you need to make the implementation, and second, you must update the code-samples (no one likes outdated docs, right?).
New implementation
Related to:
- issue: Sort facets value by alphanumerical or count order meilisearch#3612
- discussion: Retrieve facet values sorted by the number of corresponding documents product#519 (comment)
- spec: Faceting Setting API - sortFacetValuesBy specifications#247
Adds the ability to sort facets by their value which could be by using alpha
or count
.
Ensure the SDKs can handle the new index faceting configuration attribute sortFacetValuesBy
. This enum could only take count
or alpha
.
The faceting configuration now have two attributes:
maxValuesPerFacet: integer
sortFacetValuesBy: object
index_name: alpha|count
*: alpha|count // when should be applied to all indexes
Code samples
Inside of this file: .code-samples.meilisearch.yml
:
-
Create a new entry with this key
facet_search_2
containing a call to theupdateFaceting
settings method.
Refer to this curl example and translate it by using the Rust methods: https://github.com/meilisearch/documentation/blob/e4fdc3d485c22e31a045b8a71bacf18b6a7d50e0/.code-samples.meilisearch.yaml#L1078 -
Update
getting_started_faceting
key to contain the new behaviorsortFacetValuesBy
Refer to this curl example and translate it by using the Rust methods: https://github.com/meilisearch/documentation/blob/e4fdc3d485c22e31a045b8a71bacf18b6a7d50e0/.code-samples.meilisearch.yaml#L875 -
Update
update_faceting_settings_1
key to contain the new behaviorsortFacetValuesBy
Refer to this curl example and translate it by using the Rust methods: https://github.com/meilisearch/documentation/blob/e4fdc3d485c22e31a045b8a71bacf18b6a7d50e0/.code-samples.meilisearch.yaml#L854
TODO:
- Add the ability receive a new param in the
updateFaceting
settings method calledsortFacetValuesBy
. - Update the code-samples accordingly
- Add integration tests