Setting up full-text search inside eFront

search_inside_pdfWith version 3.6.12 users of the eFront Enterprise Edition have a very powerful tool in their hands – a Xapian-based file indexer that allows for searching through files’ contents.

However, setting up the file indexer to work is a little tricky. In this short guide we present the steps needed to enable Xapian on a Centos-6.3 machine. Similar steps can be taken for other Linux flavors. Unfortunately windows are not supported for the time being.

In the following we assume that an eFront instance is already up and running on the server. In addition, all commands should be run with root privileges.


[1] PHP bindings are not available on Ubuntu from the official repository due to some license restrictions. There are various sites discussing workarounds for this.


 

We now need to install unoconv which is dependent on OpenOffice or LibreOffice.
For the sake of this tutorial, we’ll be using OpenOffice libraries:

After this, you should have a Xapian installation, ready to work with php. Initialize it by running: /usr/bin/php /var/www/efront/libraries/external/xapian_cron.php (assuming that the php cli is in /usr/bin/php and eFront is located in /var/www/efront/)

After making sure that Xapian is installed successfully, you can setup a cron job to periodically index new files, say every 10 minutes:

*/10 * * * * php /var/www/xapian/libraries/external/xapian_cron.php

From now on, every time you upload a pdf, doc, docx, xls, xlsx or txt file, it will be indexed and a full-text search will be performed on its contents when you search for a string in eFront.

Additional resources and troubleshooting:

  • Anonymous

    Hello,
    Cannot install openoffice.org packages anymore as its not available. Tried libreoffice, but when installing unoconv, gets an dependency error

    Error: Package: unoconv-0.5-1.el6.rf.noarch (rpmforge)Requires: openoffice.org-pyuno >= 2.0

    I think you should update this procedure.
    Thank You

    • Anonymous

      Btw..the OS is CentOS 6.5, but in RHEL 6.5 it works fine

      • https://twitter.com/rgogos Roberta Gogos

        I understand the IT team is currently dealing with the ticket you opened. Please let us know if you need anything else.