volto icon indicating copy to clipboard operation
volto copied to clipboard

Search Block: count results per facet

Open avoinea opened this issue 2 years ago • 7 comments

In eea.facetednavigation we had a feature that would allow one to enable/disable result count per facet. This is also a major feature of modern search solutions like ElasticSearch or Solr.

Would be great to be able to enable counting per facet within Volto Search Block.

For this we will need:

  • New RestAPI endpoint for counting
    • [ ] RestAPI endpoint draft: https://github.com/plone/plone.restapi/pull/1637
  • Volto integration:
  • Enable/Disable counting per facet
  • RestAPI calls
  • Facet view update to include counts

SOLR API: https://solr.apache.org/guide/8_1/json-facet-api.html#bucketing-facet-example ES API: https://www.elastic.co/guide/en/app-search/current/facets.html

Plone Classic Faceted Navigation counter implementation:

  • https://github.com/eea/eea.facetednavigation/blob/develop/eea/facetednavigation/widgets/widget.py#L345

Faceted navigation example from Plone Classic:

Screenshot 2023-05-15 at 11 21 22

avoinea avatar May 15 '23 09:05 avoinea

cc: @ionlizarazu

erral avatar May 15 '23 10:05 erral

@avoinea what's the status for this one? It's ok to slate it for 18?

sneridagh avatar Sep 14 '23 10:09 sneridagh

@sneridagh AFAIK there is no progress on it lately. Thus, I think it's safer to move it to 18.x. cc @razvanMiu

avoinea avatar Sep 14 '23 10:09 avoinea

@sneridagh This is currently more of a proof-of-concept. It should wait for 18. Ideally, we should improve the API in ZCatalog/plone.app.querystring so that we don't have to duplicate code from them.

davisagli avatar Sep 14 '23 15:09 davisagli

Any updates on this feature? Any advice of how to temporality support it?

FarooqAlaulddin avatar Nov 15 '23 01:11 FarooqAlaulddin

@FarooqAlaulddin There is an open PR on plone.restapi https://github.com/plone/plone.restapi/pull/1637 that has to be refactored and move code upstream directly in ZCatalog and plone.app.querystring as @davisagli suggested :wink:

avoinea avatar Nov 17 '23 08:11 avoinea

For anyone looking to add this feature prior to the official releases, you need:

Backend Support:

  • https://github.com/plone/plone.restapi/pull/1637
  • https://github.com/zopefoundation/Products.ZCatalog/pull/149
  • https://github.com/plone/plone.app.querystring/pull/145

Volto:

  • https://github.com/plone/volto/pull/5812

FarooqAlaulddin avatar May 01 '24 03:05 FarooqAlaulddin