Pergunta

We have uploaded tons of files via FTP to a Plone intranet we're deploying. This step does not set the titles of the files; so searching for a file called: "invoice_policy.odt" it won't show up in a search by "invoice policy" (two words); cause the index for id's is a field index.

Moreover, the default plone lexicon does not split words by underscores, so setting the title to be just the id won't help either.

So, in order to improve our search recall, we have scripted (taken from several sources including some answers in StackOverflow) a quite simple normalization script: https://gist.github.com/3701401

However, after applying it to near 8000 files I see that the titles have changed, but the files still appear in the navigation with the id "invoice_policy.odt"; I have to edit the file and then save it in order for it to appear with its title in the navigation.

I have uploaded three images to flickr to show the process:

  • Image 1. The (last) file in its folder.
  • Image 2. When I click the file you may see it has a title (normalized with our script)
  • Image 3. I just clicked the title and the click the Save and went back to its containing folder. Now it's been shown properly.

Do I need to do (or undo) something in my script for it to work properly. Furthermore, although I (think I) enclosed each rename in its own transaction, I don't see any transaction in the Undo tab of the ZMI. I guess it's because it's not associate to a real request, is that so? Can I fix it?

Best regards,

Manuel.

Foi útil?

Solução

You need to reindex the items, either one by one in your script, or in batch at the end. http://collective-docs.readthedocs.org/en/latest/searching_and_indexing/indexing.html will probably help.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top