3.5. Multiple databases

Multiple Recoll databases or indexes can be created by using several configuration directories which are usually set to index different areas of the file system. A specific index can be selected for updating or searching, using the RECOLL_CONFDIR environment variable or the -c option to recoll and recollindex.

A recollindex program instance can only update one specific index.

A recoll program instance is also associated with a specific index, which is the one to be updated by its indexing thread, but it can use any number of Recoll indexes for searching. The external indexes can be selected through the external indexes tab in the preferences dialog.

Index selection is performed in two phases. A set of all usable indexes must first be defined, and then the subset of indexes to be used for searching. Of course, these parameters are retained across program executions (there are kept separately for each Recoll configuration). The set of all indexes is usually quite stable, while the active ones might typically be adjusted quite frequently.

The main index (defined by RECOLL_CONFDIR) is always active. If this is undesirable, you can set up your base configuration to index an empty directory.

As building the set of all indexes can be a little tedious when done through the user interface, you can use the RECOLL_EXTRA_DBS environment variable to provide an initial set. This might typically be set up by a system administrator so that every user does not have to do it. The variable should define a colon-separated list of index directories, ie:

export RECOLL_EXTRA_DBS=/some/place/xapiandb:/some/other/db

A typical usage scenario for the multiple index feature would be for a system administrator to set up a central index for shared data, that you may choose to search, or not, in addition to your personal data. Of course, there are other possibilities. There are many cases where you know the subset of files that you want to be searched for a given query, and where restricting the query will much improve the precision of the results. This can also be performed with the directory filter in advanced search, but multiple indexes will have much better performance and may be worth the trouble.