[Search Block] do not send sorting information by default
Fixes #5338
Deploy Preview for volto canceled.
| Name | Link |
|---|---|
| Latest commit | 4eb698abfd31f0a4e6847ddadb142ba91ff25abb |
| Latest deploy log | https://app.netlify.com/sites/volto/deploys/65eeb28e04abf00008873df8 |
I have a deja-vu on this one... didn't we have to setup the defaults for the p.a.q. to behave like it's intended? (eg. what show in the default controls). Didn't Plone classic also sets it in the collections by default?
This is a search block which is not feature-paired with a Collection.
When having a full text search you don't want to sort by effective date by default, it goes against the meaning of 'fulltext' which is sorted by relevance.
If you want to set a default sorting criteria you can do it: set it in the configuration of the block, if I don't set anything don't think replacing me.
This happens, and I know it is not a restapi or Volto problem, because we don't have a key in ZCatalog to 'soft by relevance'.
@erral I just dig into it and my concerns are gone now... somehow I remembered that defaults were in there for a reason. Could you please go ahead with David's suggestions? Thanks!
Oh, and this is a change of behavior that could potentially affect existing projects so it must be a breaking change...
Well, I have no problem on adding the behavior that @davisagli suggests, but I think that's wrong. We already have a setting in the search block to let the user select the sorting of the results, if the user hasn't selected anything, I think that we are not entitled to decide which is the correct sorting. If so we would have implemented it in ZCatalog right?
And breaking... well it breaks the current way of working, which is wrong :)
It makes sense to me to remove the default sort_on by effective IF the block has no configured sort AND the user has entered a SearchableText query.
Yes, this should be the default behavior. Relevance based search when there's searchable text, all the time.
I have updated the PR with the SearchableText query test and rebased it on main
Deploy Preview for plone-components canceled.
| Name | Link |
|---|---|
| Latest commit | 6e12b6da47a29c630acc5fbcef4643a857d3cb94 |
| Latest deploy log | https://app.netlify.com/sites/plone-components/deploys/669cdb920044a90008aecba3 |
@davisagli @sneridagh this looks like something that is ready to merge and could make it in 18, are there any further blockers from merging this given that 18 is, either way, a breaking change release?