plone.restapi icon indicating copy to clipboard operation
plone.restapi copied to clipboard

Add facet count endpoint

Open razvanMiu opened this issue 2 years ago • 9 comments

razvanMiu avatar May 17 '23 14:05 razvanMiu

@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!

mister-roboto avatar May 17 '23 14:05 mister-roboto

Deploy Preview for plone-restapi canceled.

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

netlify[bot] avatar May 17 '23 14:05 netlify[bot]

@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.

razvanMiu avatar May 19 '23 07:05 razvanMiu

@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...

tisto avatar Aug 23 '23 08:08 tisto

@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.

davisagli avatar Aug 23 '23 15:08 davisagli

Deploy Preview for plone-restapi canceled.

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

netlify[bot] avatar Feb 27 '24 15:02 netlify[bot]

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

razvanMiu avatar Feb 29 '24 16:02 razvanMiu

@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.

davisagli avatar Mar 06 '24 16:03 davisagli

@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.

razvanMiu avatar Mar 06 '24 17:03 razvanMiu