Parent: [821fb7] (diff)

Download this file

MultipleIndexes.txt    98 lines (83 with data), 3.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
== Creating and using multiple indexes
=== Why would you want to do this ?
- Easy adjustment of search areas: you can filter results by using the
directory filter in the advanced search panel, but, if you have
separate well defined places where you store different kind of data,
it is easier to maintain separate index and use the External indexes
dialog to switch them on or off, and it will also yield much better
search performance.
- Shared indexes: it may be useful to maintain one or several indexes
for shared data, and separate personal indexes for each user. Indexes
can be shared over the network.
- Creating separate indexes for removable volumes.
=== How to do it
As an example we'll suppose that you have Recoll installed and indexing
your home directory, and that you would like to have a separate index for
'/usr/share/doc'.
You need to create a separate configuration for the new index, then add it
to the external indexes list in the user interface, and activate it as
needed.
. Create a directory for the new index, and create an empty configuration
file
+
----
cd
mkdir .recoll-sharedoc
touch .recoll-sharedoc/recoll.conf
----
. Either edit the new configuration by hand or start recoll to use the GUI
configuration editor.
+
----
cd .recoll-sharedoc
echo "topdirs = /usr/share/doc" > recoll.conf
# OR
recoll -c ~/.recoll-sharedoc
----
+
If using the GUI, click _Cancel_ when asked, to start the configuration
editor.
. Perform initial indexing. If you chose the GUI route, indexing will
start as soon as you leave the configuration editor. Else, on the
command line:
+
----
recollindex -c ~/.recoll-sharedoc
----
. Optionally set up *cron* to perform nightly indexing, use +crontab -e+
and insert a line like the following:
+
----
45 20 * * * recollindex -c ~/.recoll-sharedoc
----
+
This would start the indexing at 20:45. `crontab -e` will use the *vi*
editor by default, you can change this by using the EDITOR
environment variable. Exemple: `EDITOR=kate crontab -e`
Your favorite desktop may also have a dedicated tool to add crontab entries.
. Start recoll and choose the _Preferences->External_ index dialog menu
entry, then click the Browse button (near the bottom), and select the
new index Xapian database directory '~/.recoll-sharedoc/xapiandb'
Then click _Add index_.
. You can then activate or deactivate the new index by clicking the box
in front of the directory name in the list.
When adding an index shared by multiple users, it may be helpful to use the
RECOLL_EXTRA_DBS environment variable instead of editing individual
configurations, see the manual for more details.
=== Paths adjustments
When sharing indexes over a network, in most cases, the indexed data will
be accessible through different paths on the different hosts. This will
prevent the Preview and Open functions to work because the paths they get
from the index do not match the ones which are usable from the local
host.
For example my home directory is accessed as '/home/me' on my home
machine, and as '/net/myhost/home/me' on other hosts. By default, trying
to access a result from a remote host would use the first path, when the
second is the one that would work.
As of release 1.19 **Recoll** has a facility to perform index-dependant
path translations. This facility is accessible from the _external index
dialog_ in the GUI preferences. Paths translations can be set for the main
index if no index is selected (rarely useful), or for the selected
additional index.
link:../usermanual/webhelp/docs/RCL.SEARCH.PTRANS.html[See
the manual] for more detail.