Skip to content

Comments

Migrate content from v5#2043

Open
boss6825 wants to merge 2 commits intoplone:6.0from
boss6825:Migrate-content-from-v5
Open

Migrate content from v5#2043
boss6825 wants to merge 2 commits intoplone:6.0from
boss6825:Migrate-content-from-v5

Conversation

@boss6825
Copy link
Member

@boss6825 boss6825 commented Jan 29, 2026

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/

Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to keep this section about external search integrations.


### Performing queries

There are several ways to query the catalog:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-project-automation github-project-automation bot moved this from New to In Progress in Plone Documentation Feb 18, 2026
@boss6825
Copy link
Member Author

Thank you @davisagli for reviewing this.
I will work upon these suggestions in upcoming weeks as i am out of station for some time ......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Migrate content from v5 "Queries, Search And Indexing"

2 participants