plone / plone.restapi

RESTful API for Plone.
http://plonerestapi.readthedocs.org/
84 stars 75 forks source link

Add facet count endpoint #1637

Open razvanMiu opened 1 year ago

mister-roboto commented 1 year ago

@razvanMiu thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

netlify[bot] commented 1 year ago

Deploy Preview for plone-restapi canceled.

Name Link
Latest commit d0f6481458dface0c492f68cf962008d2fc273a0
Latest deploy log https://app.netlify.com/sites/plone-restapi/deploys/646c82bf8f94810008b7a434
razvanMiu commented 1 year ago

@davisagli I made the @querystring-search endpoint to also look for parameters and now the @querystring-search/{facet} will return the count of the facet. I will clean up the code in restapi/utils.py, its purpose is only to return the search results directly as rids so maybe we should add a function in Catalog that only returns the rids, so I'll wait for suggestions on this.

tisto commented 1 year ago

@razvanMiu @davisagli I am wondering if there is any performance impact of this feature. The querystring-search endpoint is THE endpoint that is used a lot and that requires caching. Facetting is something that has lots of possible different parameters that would fill the cache quickly. Plone/ZCatalog is not Solr/ES that is optimized for such use case. Just sharing my thoughts from the top of my head here...

davisagli commented 1 year ago

@tisto I also think that we should improve the API in ZCatalog and plone.app.querystring so that it's possible to get counts without full results, rather than copying so much code here for that purpose.

netlify[bot] commented 7 months ago

Deploy Preview for plone-restapi canceled.

Name Link
Latest commit 4fb6df2bb9e9706601055d4977aee1784f87c46a
Latest deploy log https://app.netlify.com/sites/plone-restapi/deploys/65f9874acef39000082d4cff
razvanMiu commented 7 months ago

Requires https://github.com/zopefoundation/Products.ZCatalog/pull/149 and https://github.com/plone/plone.app.querystring/pull/145

davisagli commented 7 months ago

@razvanMiu Did you see the comment on https://github.com/zopefoundation/Products.ZCatalog/pull/149 that you need to sign the Zope contributor agreement? The Zope community won't review the PR until that is done.

razvanMiu commented 7 months ago

@razvanMiu Did you see the comment on zopefoundation/Products.ZCatalog#149 that you need to sign the Zope contributor agreement? The Zope community won't review the PR until that is done.

Yes, I will do that soon.