plone.api.content.find index validation is not appropriate in some implementations
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 101
- Forks
- 62
- Avg merge
- 15h 15m
- Merged PRs (30d)
- 1
Description
https://github.com/plone/plone.api/blob/2.5.1/src/plone/api/content.py#L706 This section attempts to validate the query by making sure at least one ZCatalog index is present. However, some implementations remove the ZCatalog index in cases where querying on that index is only meant to be sent to a third party service like Elasticsearch. For example, wildcard.hps sends portal.portal_catalog(SearchableText="foo") to ES and encourages you to remove the SearchableText index from the ZCatalog as it would only take up space and increase index time.
But if that index is removed, api.content.find(SearchableText="foo") always returns an empty list.
What is the best solution here? Maybe an environment variable that can be set to skip the validate indexes step? Personally I do not see the benefit in the validation here in any case. If I call api.content.find() I would expect to get all content on the site, just as if I called portal.portal_catalog().
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/plone/api/content.py#L706 and trace the index validation used by api.content.find(). Compare its behavior with portal.portal_catalog() when an index such as SearchableText is absent but queries may be handled by Elasticsearch. Done means agreeing on and documenting a solution that preserves valid third-party-backed queries without breaking catalog validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, python
- Domain
- api, backend-api-design, search
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100