Adding an order-by-relevance
What needs to be done?
Another good improvement in the scope of the search and filtering refactoring would be to add a specific post-processor based on a matching library like fuse.js or an equivalent to allow for both ordering and filtering of the resources list at the same time, triggered by the presence of an additional attribute.
If this order-by-relevance
attribute is applied to a sib-display which has an associated solid-search-form it should bypass the other ordering or filtering post-processors and use exclusively the "relevance" criteria. Additional relevance parameters could apply depending on the library we decide to use
Technical details
It could look like that:
<sib-display
data-src="https://api.community.startinblox.com/users/"
fields="first_name, infos(email, name)"
search-fields="infos"
order-by-relevance
></sib-display>
Similar to the order-by-random which already exists.
How to complete
- How to complete a Feature
- Ask any question you have in the issue comments before starting
- Create a new branch named ${ISSUE_NUMBER}-issue-name
- Implement a simple test to illustrate the desired functionality
- Write some code to complete this task
- Write some additional tests to cover edge cases and some possible errors
- Write documentation about what have you done and why you have done it this way
- Submit a merge request