CMFCore.exportimport.content doesn't index results of .properties

Bug #254576 reported by Ross Patterson
2
Affects Status Importance Assigned to Milestone
Zope CMF buildout
Confirmed
Undecided
Unassigned

Bug Description

In CMFCore/exportimport/content.py:201, the title and description for the newly created content are set but nothing is done to reindex the objects so that the catalog will reflect the new values. It seems that the solution might be as simple as adding "content.reindexObject()" after "content.setDescription(description)".

Tags: bug cmfcore
Revision history for this message
Tres Seaver (tseaver) wrote : Re: [Bug 254576] [NEW] CMFCore.exportimport.content doesn't index results of .properties

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ross Patterson wrote:
> Public bug reported:
>
> In CMFCore/exportimport/content.py:201, the title and description for
> the newly created content are set but nothing is done to reindex the
> objects so that the catalog will reflect the new values. It seems that
> the solution might be as simple as adding "content.reindexObject()"
> after "content.setDescription(description)".

- -1. Generally speaking, doing incremental indexing during bulk
operations is a lose: I would rather disable even the minimal "after
add" indexing than add more of it.

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIlzUl+gerLs4ltQ4RAlwtAKC32nb7kMdVuZk5e0bUrciaCW2fLACgvdsq
75I/QR/hxyYsjMYHEtsHSys=
=+f4N
-----END PGP SIGNATURE-----

Revision history for this message
Ross Patterson (rossp) wrote :

Tres Seaver <email address hidden> writes:

> Ross Patterson wrote:
>> Public bug reported:
>>
>> In CMFCore/exportimport/content.py:201, the title and description for
>> the newly created content are set but nothing is done to reindex the
>> objects so that the catalog will reflect the new values. It seems that
>> the solution might be as simple as adding "content.reindexObject()"
>> after "content.setDescription(description)".
>
> -1. Generally speaking, doing incremental indexing during bulk
> operations is a lose: I would rather disable even the minimal "after
> add" indexing than add more of it.

But then how can I write a profile that will make some small content
changes to a large sire that won't require a lengthy catalog reindex?

Ross

Revision history for this message
Ross Patterson (rossp) wrote :

Ross Patterson <email address hidden> writes:

> Tres Seaver <email address hidden> writes:
>
>> Ross Patterson wrote:
>>> Public bug reported:
>>>
>>> In CMFCore/exportimport/content.py:201, the title and description for
>>> the newly created content are set but nothing is done to reindex the
>>> objects so that the catalog will reflect the new values. It seems that
>>> the solution might be as simple as adding "content.reindexObject()"
>>> after "content.setDescription(description)".
>>
>> -1. Generally speaking, doing incremental indexing during bulk
>> operations is a lose: I would rather disable even the minimal "after
>> add" indexing than add more of it.
>
> But then how can I write a profile that will make some small content
> changes to a large sire that won't require a lengthy catalog reindex?

For example, I ran into this problem making a simple profile for a
customer that setup the portal tabs/global sections. Without the
reindexing, running the profile means the global sections display with
the object ids instead of titles. I assume this would also affect the
navigation portlet.

Ross

Revision history for this message
Tres Seaver (tseaver) wrote :

Content import is a hairy problem, so much so that I would rather move it
out of the "setup profile" world altogether.

I tend to write export / import scripts which use the underlying GS machinery
(the export / import contexts, and the adapters), but which drive the process
outside the scope of the tool. In these cases, I often "scribble" on the context
to record information in one phase which I will need later (e.g., references which
need fixing up, etc.).

Perhaps we could "bless" this scribbling with an API, and
solve your use case by having the import adapters record the created content
paths via that API: you could then run the reindexing in bulk at the end of the
import, where you could control the batch size, etc.

Changed in zope-cmf:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.