Share » Learn » eZ Publish » Indexing Multiple Binary File Types

Indexing Multiple Binary File Types

Wednesday 20 September 2006 1:35:00 pm

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Identifying content as searchable

Remember that for a file to be indexed, its content class must be configured as "Searchable". The following steps show how to make the default eZ publish content class "File" searchable. In the Administration Interface:

  1. Click the Setup button in the top navigation bar.
  2. Click the Classes link in the left navigation panel.
  3. Click the Media link in the Class groups section of the page.
  4. Click the File link under Classes Inside [Media].
  5. Click Edit to modify the content class.
  6. In the File attribute section, make sure that Searchable is enabled. This will tell eZ publish to index the contents of objects that belong to the "File" class.
  7. Click OK to save.
  8. Clear the cache.

Manually indexing the site

Depending on the size of your site and the debug flags you pass to the indexing command, the indexing can take anywhere from a few minutes to several hours. We recommend performing the manual re-indexing during off-hours and warning your clients / users that site search (and any template {fetch/search} calls) will not be fully functional during the re-indexing process.

To manually index your site, first clear out your old index so that eZ publish knows it has to start indexing all your existing content. To delete old indexes, run these SQL commands:

DELETE FROM ezsearch_word;

DELETE FROM ezsearch_object_word_link;

Next, on the command line in your site's root folder, run the index command as shown below. This example assumes that your PHP CLI binary is located in /usr/local/bin/php - adjust as necessary. You may also need to adjust the memory limit, depending on your server. (For more information about site reindexing, see the forum topic "I need to reindex my site for search".)

# /usr/local/bin/php -d memory_limit=256M -C \update/common/scripts/updatesearchindex.php --db-user=[your_db_user] \--db-database=[your_database] -s [your_site_access] --clean \--db-password=[your_db_password] -c

That's it. Once the indexing finishes, your site should now properly index binary files whether you are using a cron-based index or the "index on upload" method.

Please feel free to add your own tips and experiences as comments to this article.

36 542 Users on board!

Tutorial menu

Printable

Printer Friendly version of the full article on one page with plain styles

Author(s)