Tuesday, June 24, 2008

How to search in files (doc, pdf, etc.) in Plone 2.5

Plone 3 will index uploaded files out of the box, even Word docs. In Plone 2.5, you have to go to some extra trouble if you want uploaded files to be searched (indexed).

The key here is the TextIndexNG product. Here are the steps to take (from doc/README):

Installation on Plone:
- follow the steps above
- uncommented all directives in TextIndex3/adapters/configure.zcml (by
removing the HTML comments ''
- go to "Plone setup" -> "Add/remove programs"
- choose TextIndexNG3 to be added as new product
- a new configlet for TextIndexNG3 will appear on the setup screen (left
side)
- click on the configlet and choose the only option to replace the
existing index setup with TextIndexNG3 indexes

edit 2008/09/23:
It's worth noting that you may replace the first two steps by:

- (possibly, first virtualenv your zope instance)
- easy_install "Products.TextIndexNG3<3.2"

About converters: on Ubuntu you might use wvWare (apt-get install wv) for MS-Word and xpdf for PDF. See http://www.zopyx.de/projects/TextIndexNG3/documentation/external-converters.

No comments: