Conversation
davisagli
left a comment
There was a problem hiding this comment.
I made some suggestions for corrections, but in general this is accurate and a big improvement over the current empty page.
| 2. They don't load the actual content objects from the database. | ||
|
|
||
| This lazy behavior provides significant performance benefits. | ||
| You can iterate through thousands of search results without loading any objects into memory. |
There was a problem hiding this comment.
| You can iterate through thousands of search results without loading any objects into memory. | |
| You can iterate through thousands of search results without loading full objects into memory. |
| : Tracks inter-object references by UID. | ||
| Used internally by relation fields. | ||
|
|
||
| Add-on products may install their own catalogs optimized for specific purposes. |
There was a problem hiding this comment.
These catalogs were used in Archetypes which is obsolete in Plone 5.2. Remove this section please.
| catalog = api.portal.get_tool('portal_catalog') | ||
| ``` | ||
|
|
||
| You can also use the traditional `getToolByName` helper: |
There was a problem hiding this comment.
| You can also use the traditional `getToolByName` helper: | |
| Code in Plone core which cannot use `plone.api` should use the `getToolByName` helper instead: |
| Multiple criteria are combined with logical AND. | ||
| The query above finds items that are both a News Item AND in the published state. | ||
|
|
||
| Calling the catalog without arguments returns all indexed content: |
There was a problem hiding this comment.
This is out of date. In current versions of Plone it returns no results. To get all brains, use catalog.getAllBrains()
|
|
||
| ```{warning} | ||
| Calling `getObject()` on many brains can significantly impact performance. | ||
| Each call requires a separate database query. |
There was a problem hiding this comment.
This is misleading. Loading catalog brains also queries the database. But catalog brains are smaller and are loaded in batches.
| Equivalent to `'/'.join(obj.getPhysicalPath())`. | ||
|
|
||
| `brain.getRID()` | ||
| : Returns the internal result ID used by the catalog. |
There was a problem hiding this comment.
| : Returns the internal result ID used by the catalog. | |
| : Returns the internal record ID used by the catalog. |
| - [`collective.elasticsearch`](https://github.com/collective/collective.elasticsearch) | ||
| - [`collective.elastic.plone`](https://github.com/collective/collective.elastic.plone) | ||
|
|
||
| You can find a comprehensive list of search options in [Awesome Plone - Searching and Categorizing](https://github.com/collective/awesome-plone?tab=readme-ov-file#searching-and-categorizing) |
There was a problem hiding this comment.
It would be good to keep this section about external search integrations.
|
|
||
| ### Performing queries | ||
|
|
||
| There are several ways to query the catalog: |
There was a problem hiding this comment.
We should have a section that explains the difference between restricted and unrestricted queries. (Restricted queries automatically filter for content that can be viewed by the current user and is within its effective date range. Unrestricted queries don't include those filters.)
|
Thank you @davisagli for reviewing this. |
Issue number - 1730
Description
Write a description of the fixes or improvements.
This is 1st PR for this issue , it was getting huge so i have split it up into multiple PRs , I would put 1 or 2 more PRs for this same issue, to fully complete it.
📚 Documentation preview 📚: https://plone6--2043.org.readthedocs.build/