Skip to content

plone.api.content.find index validation is not appropriate in some implementations #584

@ewohnlich

Description

@ewohnlich

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions