Parent: [ea3bd2] (diff)

Child: [8c8471] (diff)

Download this file

usermanual.html    9819 lines (9776 with data), 489.7 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
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.2.0">
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8">
<title>Recoll user manual</title>
<link rel="stylesheet" type="text/css" href="docbook-xsl.css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<meta name="description" content=
"Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license can be found at the following location: GNU web site. This document introduces full text search notions and describes the installation and use of the Recoll application. This version describes Recoll 1.23.">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084"
alink="#0000FF">
<div lang="en" class="book">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="idm1" id="idm1"></a>Recoll
user manual</h1>
</div>
<div>
<div class="author">
<h3 class="author"><span class=
"firstname">Jean-Francois</span> <span class=
"surname">Dockes</span></h3>
<div class="affiliation">
<div class="address">
<p><code class="email">&lt;<a class="email" href=
"mailto:jfd@recoll.org">jfd@recoll.org</a>&gt;</code></p>
</div>
</div>
</div>
</div>
<div>
<p class="copyright">Copyright �� 2005-2015 Jean-Francois
Dockes</p>
</div>
<div>
<div class="abstract">
<p><code class="literal">Permission is granted to copy,
distribute and/or modify this document under the terms
of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover
Texts, and no Back-Cover Texts. A copy of the license
can be found at the following location: <a class=
"ulink" href="http://www.gnu.org/licenses/fdl.html"
target="_top">GNU web site</a>.</code></p>
<p>This document introduces full text search notions
and describes the installation and use of the
<span class="application">Recoll</span> application.
This version describes <span class=
"application">Recoll</span> 1.23.</p>
</div>
</div>
</div>
<hr>
</div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="chapter">1. <a href=
"#RCL.INTRODUCTION">Introduction</a></span></dt>
<dd>
<dl>
<dt><span class="sect1">1.1. <a href=
"#RCL.INTRODUCTION.TRYIT">Giving it a
try</a></span></dt>
<dt><span class="sect1">1.2. <a href=
"#RCL.INTRODUCTION.SEARCH">Full text
search</a></span></dt>
<dt><span class="sect1">1.3. <a href=
"#RCL.INTRODUCTION.RECOLL">Recoll
overview</a></span></dt>
</dl>
</dd>
<dt><span class="chapter">2. <a href=
"#RCL.INDEXING">Indexing</a></span></dt>
<dd>
<dl>
<dt><span class="sect1">2.1. <a href=
"#RCL.INDEXING.INTRODUCTION">Introduction</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">2.1.1. <a href=
"#RCL.INDEXING.INTRODUCTION.MODES">Indexing
modes</a></span></dt>
<dt><span class="sect2">2.1.2. <a href=
"#RCL.INDEXING.INTRODUCTION.CONFIG">Configurations,
multiple indexes</a></span></dt>
<dt><span class="sect2">2.1.3. <a href=
"#idm223">Document types</a></span></dt>
<dt><span class="sect2">2.1.4. <a href=
"#idm264">Indexing failures</a></span></dt>
<dt><span class="sect2">2.1.5. <a href=
"#idm276">Recovery</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">2.2. <a href=
"#RCL.INDEXING.STORAGE">Index storage</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">2.2.1. <a href=
"#RCL.INDEXING.STORAGE.FORMAT"><span class=
"application">Xapian</span> index
formats</a></span></dt>
<dt><span class="sect2">2.2.2. <a href=
"#RCL.INDEXING.STORAGE.SECURITY">Security
aspects</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">2.3. <a href=
"#RCL.INDEXING.CONFIG">Index
configuration</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">2.3.1. <a href=
"#RCL.INDEXING.CONFIG.MULTIPLE">Multiple
indexes</a></span></dt>
<dt><span class="sect2">2.3.2. <a href=
"#RCL.INDEXING.CONFIG.SENS">Index case and
diacritics sensitivity</a></span></dt>
<dt><span class="sect2">2.3.3. <a href=
"#RCL.INDEXING.CONFIG.THREADS">Indexing threads
configuration</a></span></dt>
<dt><span class="sect2">2.3.4. <a href=
"#RCL.INDEXING.CONFIG.GUI">The index configuration
GUI</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">2.4. <a href=
"#RCL.INDEXING.WEBQUEUE">Indexing the WEB pages which
you wisit.</a></span></dt>
<dt><span class="sect1">2.5. <a href=
"#RCL.INDEXING.EXTATTR">Extended attributes
data</a></span></dt>
<dt><span class="sect1">2.6. <a href=
"#RCL.INDEXING.EXTTAGS">Importing external
tags</a></span></dt>
<dt><span class="sect1">2.7. <a href=
"#RCL.INDEXING.PDF">The PDF input
handler</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">2.7.1. <a href=
"#RCL.INDEXING.PDF.OCR">OCR with
Tesseract</a></span></dt>
<dt><span class="sect2">2.7.2. <a href=
"#RCL.INDEXING.PDF.XMP">XMP fields
extraction</a></span></dt>
<dt><span class="sect2">2.7.3. <a href=
"#RCL.INDEXING.PDF.ATTACH">PDF attachment
indexing</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">2.8. <a href=
"#RCL.INDEXING.PERIODIC">Periodic
indexing</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">2.8.1. <a href=
"#RCL.INDEXING.PERIODIC.EXEC">Running
indexing</a></span></dt>
<dt><span class="sect2">2.8.2. <a href=
"#RCL.INDEXING.PERIODIC.AUTOMAT">Using <span class=
"command"><strong>cron</strong></span> to automate
indexing</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">2.9. <a href=
"#RCL.INDEXING.MONITOR">Real time
indexing</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">2.9.1. <a href=
"#RCL.INDEXING.MONITOR.FASTFILES">Slowing down the
reindexing rate for fast changing
files</a></span></dt>
</dl>
</dd>
</dl>
</dd>
<dt><span class="chapter">3. <a href=
"#RCL.SEARCH">Searching</a></span></dt>
<dd>
<dl>
<dt><span class="sect1">3.1. <a href=
"#RCL.SEARCH.GUI">Searching with the Qt graphical user
interface</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">3.1.1. <a href=
"#RCL.SEARCH.GUI.SIMPLE">Simple
search</a></span></dt>
<dt><span class="sect2">3.1.2. <a href=
"#RCL.SEARCH.GUI.RESLIST">The default result
list</a></span></dt>
<dt><span class="sect2">3.1.3. <a href=
"#RCL.SEARCH.GUI.RESTABLE">The result
table</a></span></dt>
<dt><span class="sect2">3.1.4. <a href=
"#RCL.SEARCH.GUI.RUNSCRIPT">Running arbitrary
commands on result files (1.20 and
later)</a></span></dt>
<dt><span class="sect2">3.1.5. <a href=
"#RCL.SEARCH.GUI.THUMBNAILS">Displaying
thumbnails</a></span></dt>
<dt><span class="sect2">3.1.6. <a href=
"#RCL.SEARCH.GUI.PREVIEW">The preview
window</a></span></dt>
<dt><span class="sect2">3.1.7. <a href=
"#RCL.SEARCH.GUI.FRAGBUTS">The Query Fragments
window</a></span></dt>
<dt><span class="sect2">3.1.8. <a href=
"#RCL.SEARCH.GUI.COMPLEX">Complex/advanced
search</a></span></dt>
<dt><span class="sect2">3.1.9. <a href=
"#RCL.SEARCH.GUI.TERMEXPLORER">The term explorer
tool</a></span></dt>
<dt><span class="sect2">3.1.10. <a href=
"#RCL.SEARCH.GUI.MULTIDB">Multiple
indexes</a></span></dt>
<dt><span class="sect2">3.1.11. <a href=
"#RCL.SEARCH.GUI.HISTORY">Document
history</a></span></dt>
<dt><span class="sect2">3.1.12. <a href=
"#RCL.SEARCH.GUI.SORT">Sorting search results and
collapsing duplicates</a></span></dt>
<dt><span class="sect2">3.1.13. <a href=
"#RCL.SEARCH.GUI.TIPS">Search tips,
shortcuts</a></span></dt>
<dt><span class="sect2">3.1.14. <a href=
"#RCL.SEARCH.SAVING">Saving and restoring queries
(1.21 and later)</a></span></dt>
<dt><span class="sect2">3.1.15. <a href=
"#RCL.SEARCH.GUI.CUSTOM">Customizing the search
interface</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">3.2. <a href=
"#RCL.SEARCH.KIO">Searching with the KDE KIO
slave</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">3.2.1. <a href=
"#RCL.SEARCH.KIO.INTRO">What's this</a></span></dt>
<dt><span class="sect2">3.2.2. <a href=
"#RCL.SEARCH.KIO.SEARCHABLEDOCS">Searchable
documents</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">3.3. <a href=
"#RCL.SEARCH.COMMANDLINE">Searching on the command
line</a></span></dt>
<dt><span class="sect1">3.4. <a href=
"#RCL.SEARCH.SYNONYMS">Using Synonyms
(1.22)</a></span></dt>
<dt><span class="sect1">3.5. <a href=
"#RCL.SEARCH.PTRANS">Path translations</a></span></dt>
<dt><span class="sect1">3.6. <a href=
"#RCL.SEARCH.LANG">The query language</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">3.6.1. <a href=
"#RCL.SEARCH.LANG.RANGES">Range
clauses</a></span></dt>
<dt><span class="sect2">3.6.2. <a href=
"#RCL.SEARCH.LANG.MODIFIERS">Modifiers</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">3.7. <a href=
"#RCL.SEARCH.CASEDIAC">Search case and diacritics
sensitivity</a></span></dt>
<dt><span class="sect1">3.8. <a href=
"#RCL.SEARCH.ANCHORWILD">Anchored searches and
wildcards</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">3.8.1. <a href=
"#RCL.SEARCH.WILDCARDS">More about
wildcards</a></span></dt>
<dt><span class="sect2">3.8.2. <a href=
"#RCL.SEARCH.ANCHOR">Anchored
searches</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">3.9. <a href=
"#RCL.SEARCH.DESKTOP">Desktop
integration</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">3.9.1. <a href=
"#RCL.SEARCH.SHORTCUT">Hotkeying
recoll</a></span></dt>
<dt><span class="sect2">3.9.2. <a href=
"#RCL.KICKER-APPLET">The KDE Kicker Recoll
applet</a></span></dt>
</dl>
</dd>
</dl>
</dd>
<dt><span class="chapter">4. <a href="#RCL.MOVABLE">Movable
datasets</a></span></dt>
<dt><span class="chapter">5. <a href=
"#RCL.PROGRAM">Programming interface</a></span></dt>
<dd>
<dl>
<dt><span class="sect1">5.1. <a href=
"#RCL.PROGRAM.FILTERS">Writing a document input
handler</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">5.1.1. <a href=
"#RCL.PROGRAM.FILTERS.SIMPLE">Simple input
handlers</a></span></dt>
<dt><span class="sect2">5.1.2. <a href=
"#RCL.PROGRAM.FILTERS.MULTIPLE">"Multiple"
handlers</a></span></dt>
<dt><span class="sect2">5.1.3. <a href=
"#RCL.PROGRAM.FILTERS.ASSOCIATION">Telling
<span class="application">Recoll</span> about the
handler</a></span></dt>
<dt><span class="sect2">5.1.4. <a href=
"#RCL.PROGRAM.FILTERS.HTML">Input handler
output</a></span></dt>
<dt><span class="sect2">5.1.5. <a href=
"#RCL.PROGRAM.FILTERS.PAGES">Page
numbers</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">5.2. <a href=
"#RCL.PROGRAM.FIELDS">Field data
processing</a></span></dt>
<dt><span class="sect1">5.3. <a href=
"#RCL.PROGRAM.PYTHONAPI">Python API</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">5.3.1. <a href=
"#RCL.PROGRAM.PYTHONAPI.INTRO">Introduction</a></span></dt>
<dt><span class="sect2">5.3.2. <a href=
"#RCL.PROGRAM.PYTHONAPI.ELEMENTS">Interface
elements</a></span></dt>
<dt><span class="sect2">5.3.3. <a href=
"#RCL.PROGRAM.PYTHONAPI.SEARCH">Python search
interface</a></span></dt>
<dt><span class="sect2">5.3.4. <a href=
"#RCL.PROGRAM.PYTHONAPI.UPDATE">Creating Python
external indexers</a></span></dt>
<dt><span class="sect2">5.3.5. <a href=
"#RCL.PROGRAM.PYTHONAPI.COMPAT">Package
compatibility with the previous
version</a></span></dt>
</dl>
</dd>
</dl>
</dd>
<dt><span class="chapter">6. <a href=
"#RCL.INSTALL">Installation and
configuration</a></span></dt>
<dd>
<dl>
<dt><span class="sect1">6.1. <a href=
"#RCL.INSTALL.BINARY">Installing a binary
copy</a></span></dt>
<dt><span class="sect1">6.2. <a href=
"#RCL.INSTALL.EXTERNAL">Supporting
packages</a></span></dt>
<dt><span class="sect1">6.3. <a href=
"#RCL.INSTALL.BUILDING">Building from
source</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">6.3.1. <a href=
"#RCL.INSTALL.BUILDING.PREREQS">Prerequisites</a></span></dt>
<dt><span class="sect2">6.3.2. <a href=
"#RCL.INSTALL.BUILDING.BUILDING">Building</a></span></dt>
<dt><span class="sect2">6.3.3. <a href=
"#RCL.INSTALL.BUILDING.INSTALL">Installing</a></span></dt>
<dt><span class="sect2">6.3.4. <a href=
"#RCL.INSTALL.BUILDING.PYTHON">Python API
package</a></span></dt>
<dt><span class="sect2">6.3.5. <a href=
"#RCL.INSTALL.BUILDING.SOLARIS">Building on
Solaris</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">6.4. <a href=
"#RCL.INSTALL.CONFIG">Configuration
overview</a></span></dt>
<dd>
<dl>
<dt><span class="sect2">6.4.1. <a href=
"#RCL.INSTALL.CONFIG.ENVIR">Environment
variables</a></span></dt>
<dt><span class="sect2">6.4.2. <a href=
"#RCL.INSTALL.CONFIG.RECOLLCONF">Recoll main
configuration file, recoll.conf</a></span></dt>
<dt><span class="sect2">6.4.3. <a href=
"#RCL.INSTALL.CONFIG.FIELDS">The fields
file</a></span></dt>
<dt><span class="sect2">6.4.4. <a href=
"#RCL.INSTALL.CONFIG.MIMEMAP">The mimemap
file</a></span></dt>
<dt><span class="sect2">6.4.5. <a href=
"#RCL.INSTALL.CONFIG.MIMECONF">The mimeconf
file</a></span></dt>
<dt><span class="sect2">6.4.6. <a href=
"#RCL.INSTALL.CONFIG.MIMEVIEW">The mimeview
file</a></span></dt>
<dt><span class="sect2">6.4.7. <a href=
"#RCL.INSTALL.CONFIG.PTRANS">The <code class=
"filename">ptrans</code> file</a></span></dt>
<dt><span class="sect2">6.4.8. <a href=
"#RCL.INSTALL.CONFIG.EXAMPLES">Examples of
configuration adjustments</a></span></dt>
</dl>
</dd>
</dl>
</dd>
</dl>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="RCL.INTRODUCTION" id=
"RCL.INTRODUCTION"></a>Chapter&nbsp;1.&nbsp;Introduction</h1>
</div>
</div>
</div>
<p>This document introduces full text search notions and
describes the installation and use of the <span class=
"application">Recoll</span> application. It is updated for
<span class="application">Recoll</span> 1.23.</p>
<p><span class="application">Recoll</span> was for a long
time dedicated to Unix-like systems. It was only lately
(2015) ported to <span class="application">MS-Windows</span>.
Many references in this manual, especially file locations,
are specific to Unix, and not valid on <span class=
"application">Windows</span>, where some described features
are also not available. The manual will be progressively
updated. Until this happens, on <span class=
"application">Windows</span>, most references to shared files
can be translated by looking under the Recoll installation
directory (esp. the <code class="filename">Share</code>
subdirectory). The user configuration is stored by default
under <code class="filename">AppData/Local/Recoll</code>
inside the user directory, along with the index itself.</p>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INTRODUCTION.TRYIT" id=
"RCL.INTRODUCTION.TRYIT"></a>1.1.&nbsp;Giving it a
try</h2>
</div>
</div>
</div>
<p>If you do not like reading manuals (who does?) but wish
to give <span class="application">Recoll</span> a try, just
<a class="link" href="#RCL.INSTALL.BINARY" title=
"6.1.&nbsp;Installing a binary copy">install</a> the
application and start the <span class=
"command"><strong>recoll</strong></span> graphical user
interface (GUI), which will ask permission to index your
home directory by default, allowing you to search
immediately after indexing completes.</p>
<p>Do not do this if your home directory contains a huge
number of documents and you do not want to wait or are very
short on disk space. In this case, you may first want to
customize the <a class="link" href="#RCL.INDEXING.CONFIG"
title="2.3.&nbsp;Index configuration">configuration</a> to
restrict the indexed area (for the very impatient with a
completed package install, from the <span class=
"command"><strong>recoll</strong></span> GUI: <span class=
"guimenu">Preferences</span> ��� <span class=
"guimenuitem">Indexing configuration</span>, then adjust
the <span class="guilabel">Top directories</span>
section).</p>
<p>Also be aware that, on Unix/Linux, you may need to
install the appropriate <a class="link" href=
"#RCL.INSTALL.EXTERNAL" title=
"6.2.&nbsp;Supporting packages">supporting applications</a>
for document types that need them (for example <span class=
"application">antiword</span> for <span class=
"application">Microsoft Word</span> files).</p>
<p>The <span class="application">Recoll</span> for
<span class="application">Windows</span> package is
self-contained and includes most useful auxiliary programs.
You will just need to install <span class=
"application">Python</span> 2.7.</p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INTRODUCTION.SEARCH" id=
"RCL.INTRODUCTION.SEARCH"></a>1.2.&nbsp;Full text
search</h2>
</div>
</div>
</div>
<p><span class="application">Recoll</span> is a full text
search application, which means that it finds your data by
content rather than by external attributes (like the file
name). You specify words (terms) which should or should not
appear in the text you are looking for, and receive in
return a list of matching documents, ordered so that the
most <span class="emphasis"><em>relevant</em></span>
documents will appear first.</p>
<p>You do not need to remember in what file or email
message you stored a given piece of information. You just
ask for related terms, and the tool will return a list of
documents where these terms are prominent, in a similar way
to Internet search engines.</p>
<p>Full text search applications try to determine which
documents are most relevant to the search terms you
provide. Computer algorithms for determining relevance can
be very complex, and in general are inferior to the power
of the human mind to rapidly determine relevance. The
quality of relevance guessing is probably the most
important aspect when evaluating a search application.
<span class="application">Recoll</span> relies on the
<span class="application">Xapian</span> probabilistic
information retrieval library to determine relevance.</p>
<p>In many cases, you are looking for all the forms of a
word, including plurals, different tenses for a verb, or
terms derived from the same root or <span class=
"emphasis"><em>stem</em></span> (example: <em class=
"replaceable"><code>floor, floors, floored,
flooring...</code></em>). Queries are usually automatically
expanded to all such related terms (words that reduce to
the same stem). This can be prevented for searching for a
specific form.</p>
<p>Stemming, by itself, does not accommodate for
misspellings or phonetic searches. A full text search
application may also support this form of approximation.
For example, a search for <em class=
"replaceable"><code>aliterattion</code></em> returning no
result might propose <em class=
"replaceable"><code>alliteration, alteration, alterations,
or altercation</code></em> as possible replacement terms.
<span class="application">Recoll</span> bases its
suggestions on the actual index contents, so that
suggestions may be made for words which would not appear in
a standard dictionary.</p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INTRODUCTION.RECOLL" id=
"RCL.INTRODUCTION.RECOLL"></a>1.3.&nbsp;Recoll
overview</h2>
</div>
</div>
</div>
<p><span class="application">Recoll</span> uses the
<a class="ulink" href="http://www.xapian.org" target=
"_top"><span class="application">Xapian</span></a>
information retrieval library as its storage and retrieval
engine. <span class="application">Xapian</span> is a very
mature package using <a class="ulink" href=
"http://www.xapian.org/docs/intro_ir.html" target="_top">a
sophisticated probabilistic ranking model</a>.</p>
<p>The <span class="application">Xapian</span> library
manages an index database which describes where terms
appear in your document files. It efficiently processes the
complex queries which are produced by the <span class=
"application">Recoll</span> query expansion mechanism, and
is in charge of the all-important relevance computation
task.</p>
<p><span class="application">Recoll</span> provides the
mechanisms and interface to get data into and out of the
index. This includes translating the many possible document
formats into pure text, handling term variations (using
<span class="application">Xapian</span> stemmers), and
spelling approximations (using the <span class=
"application">aspell</span> speller), interpreting user
queries and presenting results.</p>
<p>In a shorter way, <span class=
"application">Recoll</span> does the dirty footwork,
<span class="application">Xapian</span> deals with the
intelligent parts of the process.</p>
<p>The <span class="application">Xapian</span> index can be
big (roughly the size of the original document set), but it
is not a document archive. <span class=
"application">Recoll</span> can only display documents that
still exist at the place from which they were indexed.
(Actually, there is a way to reconstruct a document from
the information in the index, but the result is not nice,
as all formatting, punctuation and capitalization are
lost).</p>
<p><span class="application">Recoll</span> stores all
internal data in <span class="application">Unicode
UTF-8</span> format, and it can index files of many types
with different character sets, encodings, and languages
into the same index. It can process documents embedded
inside other documents (for example a pdf document stored
inside a Zip archive sent as an email attachment...), down
to an arbitrary depth.</p>
<p>Stemming is the process by which <span class=
"application">Recoll</span> reduces words to their radicals
so that searching does not depend, for example, on a word
being singular or plural (floor, floors), or on a verb
tense (flooring, floored). Because the mechanisms used for
stemming depend on the specific grammatical rules for each
language, there is a separate <span class=
"application">Xapian</span> stemmer module for most common
languages where stemming makes sense.</p>
<p><span class="application">Recoll</span> stores the
unstemmed versions of terms in the main index and uses
auxiliary databases for term expansion (one for each
stemming language), which means that you can switch
stemming languages between searches, or add a language
without needing a full reindex.</p>
<p>Storing documents written in different languages in the
same index is possible, and commonly done. In this
situation, you can specify several stemming languages for
the index.</p>
<p><span class="application">Recoll</span> currently makes
no attempt at automatic language recognition, which means
that the stemmer will sometimes be applied to terms from
other languages with potentially strange results. In
practise, even if this introduces possibilities of
confusion, this approach has been proven quite useful, and
it is much less cumbersome than separating your documents
according to what language they are written in.</p>
<p>By default, <span class="application">Recoll</span>
strips most accents and diacritics from terms, and converts
them to lower case before either storing them in the index
or searching for them. As a consequence, it is impossible
to search for a particular capitalization of a term
(<code class="literal">US</code> / <code class=
"literal">us</code>), or to discriminate two terms based on
diacritics (<code class="literal">sake</code> /
<code class="literal">sak��</code>, <code class=
"literal">mate</code> / <code class=
"literal">mat��</code>).</p>
<p><span class="application">Recoll</span> can optionally
store the raw terms, without accent stripping or case
conversion. In this configuration, default searches will
behave as before, but it is possible to perform searches
sensitive to case and diacritics. This is described in more
detail in the <a class="link" href=
"#RCL.INDEXING.CONFIG.SENS" title=
"2.3.2.&nbsp;Index case and diacritics sensitivity">section
about index case and diacritics sensitivity</a>.</p>
<p><span class="application">Recoll</span> has many
parameters which define exactly what to index, and how to
classify and decode the source documents. These are kept in
<a class="link" href="#RCL.INDEXING.CONFIG" title=
"2.3.&nbsp;Index configuration">configuration files</a>. A
default configuration is copied into a standard location
(usually something like <code class=
"filename">/usr/share/recoll/examples</code>) during
installation. The default values set by the configuration
files in this directory may be overridden by values set
inside your personal configuration, found by default in the
<code class="filename">.recoll</code> sub-directory of your
home directory. The default configuration will index your
home directory with default parameters and should be
sufficient for giving <span class=
"application">Recoll</span> a try, but you may want to
adjust it later, which can be done either by editing the
text files or by using configuration menus in the
<span class="command"><strong>recoll</strong></span> GUI.
Some other parameters affecting only the <span class=
"command"><strong>recoll</strong></span> GUI are stored in
the standard location defined by <span class=
"application">Qt</span>.</p>
<p>The <a class="link" href="#RCL.INDEXING.PERIODIC.EXEC"
title="2.8.1.&nbsp;Running indexing">indexing process</a>
is started automatically (after asking permission), the
first time you execute the <span class=
"command"><strong>recoll</strong></span> GUI. Indexing can
also be performed by executing the <span class=
"command"><strong>recollindex</strong></span> command.
<span class="application">Recoll</span> indexing is
multithreaded by default when appropriate hardware
resources are available, and can perform in parallel
multiple tasks for text extraction, segmentation and index
updates.</p>
<p><a class="link" href="#RCL.SEARCH" title=
"Chapter&nbsp;3.&nbsp;Searching">Searches</a> are usually
performed inside the <span class=
"command"><strong>recoll</strong></span> GUI, which has
many options to help you find what you are looking for.
However, there are other ways to perform <span class=
"application">Recoll</span> searches:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>A <a class="link" href="#RCL.SEARCH.COMMANDLINE"
title=
"3.3.&nbsp;Searching on the command line">command
line interface</a>.</p>
</li>
<li class="listitem">
<p>A <a class="link" href="#RCL.PROGRAM.PYTHONAPI"
title="5.3.&nbsp;Python API"><span class=
"application">Python</span> programming
interface</a></p>
</li>
<li class="listitem">
<p>A <a class="link" href="#RCL.SEARCH.KIO" title=
"3.2.&nbsp;Searching with the KDE KIO slave"><span class="application">
KDE</span> KIO slave module</a>.</p>
</li>
<li class="listitem">
<p>A Ubuntu Unity <a class="ulink" href=
"https://bitbucket.org/medoc/unity-scope-recoll"
target="_top">Scope</a> module.</p>
</li>
<li class="listitem">
<p>A <a class="ulink" href=
"https://github.com/koniu/recoll-webui" target=
"_top">WEB interface</a>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="RCL.INDEXING" id=
"RCL.INDEXING"></a>Chapter&nbsp;2.&nbsp;Indexing</h1>
</div>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INDEXING.INTRODUCTION" id=
"RCL.INDEXING.INTRODUCTION"></a>2.1.&nbsp;Introduction</h2>
</div>
</div>
</div>
<p>Indexing is the process by which the set of documents is
analyzed and the data entered into the database.
<span class="application">Recoll</span> indexing is
normally incremental: documents will only be processed if
they have been modified since the last run. On the first
execution, all documents will need processing. A full index
build can be forced later by specifying an option to the
indexing command (<span class=
"command"><strong>recollindex</strong></span> <code class=
"option">-z</code> or <code class="option">-Z</code>).</p>
<p><span class=
"command"><strong>recollindex</strong></span> skips files
which caused an error during a previous pass. This is a
performance optimization, and a new behaviour in version
1.21 (failed files were always retried by previous
versions). The command line option <code class=
"option">-k</code> can be set to retry failed files, for
example after updating an input handler.</p>
<p>The following sections give an overview of different
aspects of the indexing processes and configuration, with
links to detailed sections.</p>
<p>Depending on your data, temporary files may be needed
during indexing, some of them possibly quite big. You can
use the <code class="envar">RECOLL_TMPDIR</code> or
<code class="envar">TMPDIR</code> environment variables to
determine where they are created (the default is to use
<code class="filename">/tmp</code>). Using <code class=
"envar">TMPDIR</code> has the nice property that it may
also be taken into account by auxiliary commands executed
by <span class=
"command"><strong>recollindex</strong></span>.</p>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.INTRODUCTION.MODES" id=
"RCL.INDEXING.INTRODUCTION.MODES"></a>2.1.1.&nbsp;Indexing
modes</h3>
</div>
</div>
</div>
<p><span class="application">Recoll</span> indexing can
be performed along two main modes:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><b><a class="link" href="#RCL.INDEXING.PERIODIC"
title="2.8.&nbsp;Periodic indexing">Periodic (or
batch) indexing:</a>&nbsp;</b>indexing takes place
at discrete times, by executing the <span class=
"command"><strong>recollindex</strong></span>
command. The typical usage is to have a nightly
indexing run <a class="link" href=
"#RCL.INDEXING.PERIODIC.AUTOMAT" title=
"2.8.2.&nbsp;Using cron to automate indexing">programmed</a>
into your <span class=
"command"><strong>cron</strong></span> file.</p>
</li>
<li class="listitem">
<p><b><a class="link" href="#RCL.INDEXING.MONITOR"
title="2.9.&nbsp;Real time indexing">Real time
indexing:</a>&nbsp;</b>indexing takes place as soon
as a file is created or changed. <span class=
"command"><strong>recollindex</strong></span> runs
as a daemon and uses a file system alteration
monitor (e.g. <span class=
"application">inotify</span>) to detect file
changes.</p>
</li>
</ul>
</div>
<p>The choice between the two methods is mostly a matter
of preference, and they can be combined by setting up
multiple indexes (ie: use periodic indexing on a big
documentation directory, and real time indexing on a
small home directory). Monitoring a big file system tree
can consume significant system resources.</p>
<p>With <span class="application">Recoll</span> 1.25 and
newer, it is also possible to set up an index so that
only a subset of the tree will be monitored and the rest
will be covered by batch/incremental indexing. (See the
details in the <a class="link" href=
"#RCL.INDEXING.MONITOR" title=
"2.9.&nbsp;Real time indexing">Real time indexing</a>
section.</p>
<p>The choice of method and the parameters used can be
configured from the <span class=
"command"><strong>recoll</strong></span> GUI:
<span class="guimenu">Preferences</span> ��� <span class=
"guimenuitem">Indexing schedule</span></p>
<p>The <span class="guimenu">File</span> menu also has
entries to start or stop the current indexing operation.
Stopping indexing is performed by killing the
<span class="command"><strong>recollindex</strong></span>
process, which will checkpoint its state and exit. A
later restart of indexing will mostly resume from where
things stopped (the file tree walk has to be restarted
from the beginning).</p>
<p>When the real time indexer is running, two operations
are available from the menu: 'Stop' and 'Trigger
incremental pass'. When no indexing is running, you have
a choice of updating the index or rebuilding it (the
first choice only processes changed files, the second one
zeroes the index before starting so that all files are
processed).</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.INTRODUCTION.CONFIG" id=
"RCL.INDEXING.INTRODUCTION.CONFIG"></a>2.1.2.&nbsp;Configurations,
multiple indexes</h3>
</div>
</div>
</div>
<p><span class="application">Recoll</span> supports
defining multiple indexes.</p>
<p>Each index is defined by its own <a class="link" href=
"#RCL.INDEXING.CONFIG" title=
"2.3.&nbsp;Index configuration">configuration
directory</a>, in which several configuration files
describe what should be indexed and how.</p>
<p>A default personal configuration directory
(<code class="filename">$HOME/.recoll/</code>) is created
when a <span class="application">Recoll</span> program is
first executed. This configuration is the one used for
indexing and querying when no specific configuration is
specified.</p>
<p>All configuration parameters have defaults, defined in
system-wide files. Without further customisation, the
default configuration will process your complete home
directory, with a reasonable set of defaults. It can be
changed to process a different area of the file system,
select files in different ways, and many other
things.</p>
<p>In some cases, it may be interesting, for example, to
index different areas of the file system into separate
indexes, or use different options. You can do this by
creating additional configuration directories.</p>
<p>Examples of usage would be to separate personal and
shared indexes, or to take advantage of the organization
of your data to improve search precision.</p>
<p>A specific configuration can be selected by setting
the <code class="envar">RECOLL_CONFDIR</code> environment
variable, or giving the <code class="option">-c</code>
option to any of the <span class=
"application">Recoll</span> commands.</p>
<p>When generating indexes, the different configurations
are entirely independant (no parameters are ever shared
between configurations when indexing).</p>
<p>Multiple indexes can queryied concurrently, either
from the GUI or the command line. When doing this, there
is always a main configuration, from which both
configuration and index data are used. Only the index
data from the additional indexes is used (their
configuration parameters are ignored).</p>
<p>This is important and sometimes confusing, so it will
be rephrased here: for index generation, multiple
configurations are totally independant from each other.
When querying, configuration and data are used from the
main index (the one designated by <code class=
"literal">-c</code> or <code class=
"envar">RECOLL_CONFDIR</code>), and only the data from
the additional indexes is used. This also implies that
<a class="link" href="#RCL.INDEXING.CONFIG.MULTIPLE"
title="2.3.1.&nbsp;Multiple indexes">some parameters
should be consistent among the configurations</a> for
indexes which are to be used together.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="idm223" id=
"idm223"></a>2.1.3.&nbsp;Document types</h3>
</div>
</div>
</div>
<p><span class="application">Recoll</span> knows about
quite a few different document types. The parameters for
document types recognition and processing are set in
<a class="link" href="#RCL.INDEXING.CONFIG" title=
"2.3.&nbsp;Index configuration">configuration
files</a>.</p>
<p>Most file types, like HTML or word processing files,
only hold one document. Some file types, like email
folders or zip archives, can hold many individually
indexed documents, which may themselves be compound ones.
Such hierarchies can go quite deep, and <span class=
"application">Recoll</span> can process, for example, a
<span class="application">LibreOffice</span> document
stored as an attachment to an email message inside an
email folder archived in a zip file...</p>
<p><span class="application">Recoll</span> indexing
processes plain text, HTML, OpenDocument
(Open/LibreOffice), email formats, and a few others
internally.</p>
<p>Other file types (ie: postscript, pdf, ms-word, rtf
...) need external applications for preprocessing. The
list is in the <a class="link" href=
"#RCL.INSTALL.EXTERNAL" title=
"6.2.&nbsp;Supporting packages">installation</a> section.
After every indexing operation, <span class=
"application">Recoll</span> updates a list of commands
that would be needed for indexing existing files types.
This list can be displayed by selecting the menu option
<span class="guimenu">File</span> ��� <span class=
"guimenuitem">Show Missing Helpers</span> in the
<span class="command"><strong>recoll</strong></span> GUI.
It is stored in the <code class="filename">missing</code>
text file inside the configuration directory.</p>
<p>By default, <span class="application">Recoll</span>
will try to index any file type that it has a way to
read. This is sometimes not desirable, and there are ways
to either exclude some types, or on the contrary define a
positive list of types to be indexed. In the latter case,
any type not in the list will be ignored.</p>
<p>Excluding file types can be done by adding wildcard
name patterns to the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDNAMES">skippedNames</a>
list, which can be done from the GUI Index configuration
menu. For versions 1.20 and later, you can alternatively
set the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.EXCLUDEDMIMETYPES">excludedmimetypes</a>
list in the configuration file. This can be redefined for
subdirectories.</p>
<p>You can also define an exclusive list of MIME types to
be indexed (no others will be indexed), by settting the
<a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.INDEXEDMIMETYPES">indexedmimetypes</a>
configuration variable. Example:</p>
<pre class="programlisting">
indexedmimetypes = text/html application/pdf
</pre>
<p>It is possible to redefine this parameter for
subdirectories. Example:</p>
<pre class="programlisting">
[/path/to/my/dir]
indexedmimetypes = application/pdf
</pre>
<p>(When using sections like this, don't forget that they
remain in effect until the end of the file or another
section indicator).</p>
<p><code class="literal">excludedmimetypes</code> or
<code class="literal">indexedmimetypes</code>, can be set
either by editing the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF" title=
"6.4.2.&nbsp;Recoll main configuration file, recoll.conf">
configuration file (<code class=
"filename">recoll.conf</code>)</a> for the index, or by
using the GUI index configuration tool.</p>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note about MIME types</h3>
<p>When editing the <code class=
"literal">indexedmimetypes</code> or <code class=
"literal">excludedmimetypes</code> lists, you should
use the MIME values listed in the <code class=
"filename">mimemap</code> file or in Recoll result
lists in preference to <code class="literal">file
-i</code> output: there are a number of differences.
The <code class="literal">file -i</code> output should
only be used for files without extensions, or for which
the extension is not listed in <code class=
"filename">mimemap</code></p>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="idm264" id=
"idm264"></a>2.1.4.&nbsp;Indexing failures</h3>
</div>
</div>
</div>
<p>Indexing may fail for some documents, for a number of
reasons: a helper program may be missing, the document
may be corrupt, we may fail to uncompress a file because
no file system space is available, etc.</p>
<p><span class="application">Recoll</span> versions prior
to 1.21 always retried to index files which had
previously caused an error. This guaranteed that anything
that may have become indexable (for example because a
helper had been installed) would be indexed. However this
was bad for performance because some indexing failures
may be quite costly (for example failing to uncompress a
big file because of insufficient disk space).</p>
<p>The indexer in <span class="application">Recoll</span>
versions 1.21 and later does not retry failed file by
default. Retrying will only occur if an explicit option
(<code class="option">-k</code>) is set on the
<span class="command"><strong>recollindex</strong></span>
command line, or if a script executed when <span class=
"command"><strong>recollindex</strong></span> starts up
says so. The script is defined by a configuration
variable (<code class=
"literal">checkneedretryindexscript</code>), and makes a
rather lame attempt at deciding if a helper command may
have been installed, by checking if any of the common
<code class="filename">bin</code> directories have
changed.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="idm276" id=
"idm276"></a>2.1.5.&nbsp;Recovery</h3>
</div>
</div>
</div>
<p>In the rare case where the index becomes corrupted
(which can signal itself by weird search results or
crashes), the index files need to be erased before
restarting a clean indexing pass. Just delete the
<code class="filename">xapiandb</code> directory (see
<a class="link" href="#RCL.INDEXING.STORAGE" title=
"2.2.&nbsp;Index storage">next section</a>), or,
alternatively, start the next <span class=
"command"><strong>recollindex</strong></span> with the
<code class="option">-z</code> option, which will reset
the database before indexing. The difference between the
two methods is that the second will not change the
current index format, which may be undesirable if a newer
format is supported by the <span class=
"application">Xapian</span> version.</p>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INDEXING.STORAGE" id=
"RCL.INDEXING.STORAGE"></a>2.2.&nbsp;Index
storage</h2>
</div>
</div>
</div>
<p>The default location for the index data is the
<code class="filename">xapiandb</code> subdirectory of the
<span class="application">Recoll</span> configuration
directory, typically <code class=
"filename">$HOME/.recoll/xapiandb/</code>. This can be
changed via two different methods (with different
purposes):</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>You can specify a different configuration
directory by setting the <code class=
"envar">RECOLL_CONFDIR</code> environment variable,
or using the <code class="option">-c</code> option to
the <span class="application">Recoll</span> commands.
This method would typically be used to index
different areas of the file system to different
indexes. For example, if you were to issue the
following command:</p>
<pre class="programlisting">
recoll -c ~/.indexes-email</pre>
<p>Then <span class="application">Recoll</span> would
use configuration files stored in <code class=
"filename">~/.indexes-email/</code> and, (unless
specified otherwise in <code class=
"filename">recoll.conf</code>) would look for the
index in <code class=
"filename">~/.indexes-email/xapiandb/</code>.</p>
<p>Using multiple configuration directories and
<a class="link" href="#RCL.INSTALL.CONFIG.RECOLLCONF"
title=
"6.4.2.&nbsp;Recoll main configuration file, recoll.conf">
configuration options</a> allows you to tailor
multiple configurations and indexes to handle
whatever subset of the available data you wish to
make searchable.</p>
</li>
<li class="listitem">
<p>For a given configuration directory, you can
specify a non-default storage location for the index
by setting the <code class="varname">dbdir</code>
parameter in the configuration file (see the
<a class="link" href="#RCL.INSTALL.CONFIG.RECOLLCONF"
title=
"6.4.2.&nbsp;Recoll main configuration file, recoll.conf">
configuration section</a>). This method would mainly
be of use if you wanted to keep the configuration
directory in its default location, but desired
another location for the index, typically out of disk
occupation concerns.</p>
</li>
</ul>
</div>
<p>The size of the index is determined by the size of the
set of documents, but the ratio can vary a lot. For a
typical mixed set of documents, the index size will often
be close to the data set size. In specific cases (a set of
compressed mbox files for example), the index can become
much bigger than the documents. It may also be much smaller
if the documents contain a lot of images or other
non-indexed data (an extreme example being a set of mp3
files where only the tags would be indexed).</p>
<p>Of course, images, sound and video do not increase the
index size, which means that nowadays, typically, even a
big index will be negligible against the total amount of
data on the computer.</p>
<p>The index data directory (<code class=
"filename">xapiandb</code>) only contains data that can be
completely rebuilt by an index run (as long as the original
documents exist), and it can always be destroyed
safely.</p>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.STORAGE.FORMAT" id=
"RCL.INDEXING.STORAGE.FORMAT"></a>2.2.1.&nbsp;<span class="application">Xapian</span>
index formats</h3>
</div>
</div>
</div>
<p><span class="application">Xapian</span> versions
usually support several formats for index storage. A
given major <span class="application">Xapian</span>
version will have a current format, used to create new
indexes, and will also support the format from the
previous major version.</p>
<p><span class="application">Xapian</span> will not
convert automatically an existing index from the older
format to the newer one. If you want to upgrade to the
new format, or if a very old index needs to be converted
because its format is not supported any more, you will
have to explicitly delete the old index (typically
<code class="filename">~/.recoll/xapiandb</code>), then
run a normal indexing command. Using option <code class=
"option">-z</code> would not work in this situation.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.STORAGE.SECURITY" id=
"RCL.INDEXING.STORAGE.SECURITY"></a>2.2.2.&nbsp;Security
aspects</h3>
</div>
</div>
</div>
<p>The <span class="application">Recoll</span> index does
not hold copies of the indexed documents. But it does
hold enough data to allow for an almost complete
reconstruction. If confidential data is indexed, access
to the database directory should be restricted.</p>
<p><span class="application">Recoll</span> will create
the configuration directory with a mode of 0700 (access
by owner only). As the index data directory is by default
a sub-directory of the configuration directory, this
should result in appropriate protection.</p>
<p>If you use another setup, you should think of the kind
of protection you need for your index, set the directory
and files access modes appropriately, and also maybe
adjust the <code class="literal">umask</code> used during
index updates.</p>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INDEXING.CONFIG" id=
"RCL.INDEXING.CONFIG"></a>2.3.&nbsp;Index
configuration</h2>
</div>
</div>
</div>
<p>Variables set inside the <a class="link" href=
"#RCL.INSTALL.CONFIG" title=
"6.4.&nbsp;Configuration overview"><span class=
"application">Recoll</span> configuration files</a> control
which areas of the file system are indexed, and how files
are processed. These variables can be set either by editing
the text files or by using the <a class="link" href=
"#RCL.INDEXING.CONFIG.GUI" title=
"2.3.4.&nbsp;The index configuration GUI">dialogs in the
<span class="command"><strong>recoll</strong></span>
GUI</a>.</p>
<p>The first time you start <span class=
"command"><strong>recoll</strong></span>, you will be asked
whether or not you would like it to build the index. If you
want to adjust the configuration before indexing, just
click <span class="guilabel">Cancel</span> at this point,
which will get you into the configuration interface. If you
exit at this point, <code class="filename">recoll</code>
will have created a <code class="filename">~/.recoll</code>
directory containing empty configuration files, which you
can edit by hand.</p>
<p>The configuration is documented inside the <a class=
"link" href="#RCL.INSTALL.CONFIG" title=
"6.4.&nbsp;Configuration overview">installation chapter</a>
of this document, or in the <span class=
"citerefentry"><span class=
"refentrytitle">recoll.conf</span>(5)</span> man page, but
the most current information will most likely be the
comments inside the sample file. The most immediately
useful variable you may interested in is probably <a class=
"link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.TOPDIRS"><code class=
"varname">topdirs</code></a>, which determines what
subtrees and files get indexed.</p>
<p>The applications needed to index file types other than
text, HTML or email (ie: pdf, postscript, ms-word...) are
described in the <a class="link" href=
"#RCL.INSTALL.EXTERNAL" title=
"6.2.&nbsp;Supporting packages">external packages
section.</a></p>
<p>As of Recoll 1.18 there are two incompatible types of
Recoll indexes, depending on the treatment of character
case and diacritics. A <a class="link" href=
"#RCL.INDEXING.CONFIG.SENS" title=
"2.3.2.&nbsp;Index case and diacritics sensitivity">a
further section</a> describes the two types in more
detail.</p>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.CONFIG.MULTIPLE" id=
"RCL.INDEXING.CONFIG.MULTIPLE"></a>2.3.1.&nbsp;Multiple
indexes</h3>
</div>
</div>
</div>
<p>Multiple <span class="application">Recoll</span>
indexes can be created by using several configuration
directories which are typically set to index different
areas of the file system. A specific index can be
selected for updating or searching, using the
<code class="envar">RECOLL_CONFDIR</code> environment
variable or the <code class="option">-c</code> option to
<span class="command"><strong>recoll</strong></span> and
<span class=
"command"><strong>recollindex</strong></span>.</p>
<p>When working with the <span class=
"command"><strong>recoll</strong></span> index
configuration GUI, the configuration directory for which
parameters are modified is the one which was selected by
<code class="envar">RECOLL_CONFDIR</code> or the
<code class="option">-c</code> parameter, and there is no
way to switch configurations within the GUI.</p>
<p>Additional configuration directories (beyond
<code class="filename">~/.recoll</code>) must be created
by hand (<span class=
"command"><strong>mkdir</strong></span> or such), the GUI
will not do it. This is to avoid mistakenly creating
additional directories when an argument is mistyped.</p>
<p>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 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 should be searched, and
where narrowing the search can improve the results. You
can achieve approximately the same effect with the
directory filter in advanced search, but multiple indexes
will have much better performance and may be worth the
trouble.</p>
<p>A <span class=
"command"><strong>recollindex</strong></span> program
instance can only update one specific index, and it will
only use parameters from a single configuration (no
parameters are ever shared between configurations when
indexing).</p>
<p>Multiple indexes can queryied concurrently, either
from the GUI or the command line. When doing this, there
is always a main configuration, from which both
configuration and index data are used. Only the index
data from the additional indexes is used (their
configuration parameters are ignored).</p>
<p>When searching, the current main index (defined by
<code class="envar">RECOLL_CONFDIR</code> or <code class=
"option">-c</code>) is always active. If this is
undesirable, you can set up your base configuration to
index an empty directory.</p>
<p>If a set of multiple indexes are to be used together
for searches, some configuration parameters must be
consistent among the set. These are parameters which need
to be the same when indexing and searching. As the
parameters come from the main configuration when
searching, they need to be compatible with what was set
when creating the other indexes (which came from their
respective configuration directories).</p>
<p>Most importantly, all indexes to be queried
concurrently must have the same option concerning
character case and diacritics stripping, but there are
other constraints. Most of the relevant parameters are
described in the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.TERMS" title=
"6.4.2.2.&nbsp;Parameters affecting how we generate terms and organize the index">
linked section</a>.</p>
<p>The different search interfaces (GUI, command line,
...) have different methods to define the set of indexes
to be used, see the appropriate section.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.CONFIG.SENS" id=
"RCL.INDEXING.CONFIG.SENS"></a>2.3.2.&nbsp;Index
case and diacritics sensitivity</h3>
</div>
</div>
</div>
<p>As of <span class="application">Recoll</span> version
1.18 you have a choice of building an index with terms
stripped of character case and diacritics, or one with
raw terms. For a source term of <code class=
"literal">R��sum��</code>, the former will store
<code class="literal">resume</code>, the latter
<code class="literal">R��sum��</code>.</p>
<p>Each type of index allows performing searches
insensitive to case and diacritics: with a raw index, the
user entry will be expanded to match all case and
diacritics variations present in the index. With a
stripped index, the search term will be stripped before
searching.</p>
<p>A raw index allows for another possibility which a
stripped index cannot offer: using case and diacritics to
discriminate between terms, returning different results
when searching for <code class="literal">US</code> and
<code class="literal">us</code> or <code class=
"literal">resume</code> and <code class=
"literal">r��sum��</code>. Read the <a class="link" href=
"#RCL.SEARCH.CASEDIAC" title=
"3.7.&nbsp;Search case and diacritics sensitivity">section
about search case and diacritics sensitivity</a> for more
details.</p>
<p>The type of index to be created is controlled by the
<code class="literal">indexStripChars</code>
configuration variable which can only be changed by
editing the configuration file. Any change implies an
index reset (not automated by <span class=
"application">Recoll</span>), and all indexes in a search
must be set in the same way (again, not checked by
<span class="application">Recoll</span>).</p>
<p>If the <code class="literal">indexStripChars</code> is
not set, <span class="application">Recoll</span> 1.18
creates a stripped index by default, for compatibility
with previous versions.</p>
<p>As a cost for added capability, a raw index will be
slightly bigger than a stripped one (around 10%). Also,
searches will be more complex, so probably slightly
slower, and the feature is still young, so that a certain
amount of weirdness cannot be excluded.</p>
<p>One of the most adverse consequence of using a raw
index is that some phrase and proximity searches may
become impossible: because each term needs to be
expanded, and all combinations searched for, the
multiplicative expansion may become unmanageable.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.CONFIG.THREADS" id=
"RCL.INDEXING.CONFIG.THREADS"></a>2.3.3.&nbsp;Indexing
threads configuration</h3>
</div>
</div>
</div>
<p>The <span class="application">Recoll</span> indexing
process <span class=
"command"><strong>recollindex</strong></span> can use
multiple threads to speed up indexing on multiprocessor
systems. The work done to index files is divided in
several stages and some of the stages can be executed by
multiple threads. The stages are:</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>File system walking: this is always performed by
the main thread.</p>
</li>
<li class="listitem">
<p>File conversion and data extraction.</p>
</li>
<li class="listitem">
<p>Text processing (splitting, stemming, etc.).</p>
</li>
<li class="listitem">
<p><span class="application">Xapian</span> index
update.</p>
</li>
</ol>
</div>
<p>You can also read a <a class="ulink" href=
"http://www.recoll.org/idxthreads/threadingRecoll.html"
target="_top">longer document</a> about the
transformation of <span class="application">Recoll</span>
indexing to multithreading.</p>
<p>The threads configuration is controlled by two
configuration file parameters.</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term"><code class=
"varname">thrQSizes</code></span></dt>
<dd>
<p>This variable defines the job input queues
configuration. There are three possible queues for
stages 2, 3 and 4, and this parameter should give
the queue depth for each stage (three integer
values). If a value of -1 is used for a given
stage, no queue is used, and the thread will go on
performing the next stage. In practise, deep queues
have not been shown to increase performance. A
value of 0 for the first queue tells <span class=
"application">Recoll</span> to perform
autoconfiguration (no need for anything else in
this case, thrTCounts is not used) - this is the
default configuration.</p>
</dd>
<dt><span class="term"><code class=
"varname">thrTCounts</code></span></dt>
<dd>
<p>This defines the number of threads used for each
stage. If a value of -1 is used for one of the
queue depths, the corresponding thread count is
ignored. It makes no sense to use a value other
than 1 for the last stage because updating the
<span class="application">Xapian</span> index is
necessarily single-threaded (and protected by a
mutex).</p>
</dd>
</dl>
</div>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>If the first value in <code class=
"varname">thrQSizes</code> is 0, <code class=
"varname">thrTCounts</code> is ignored.</p>
</div>
<p>The following example would use three queues (of depth
2), and 4 threads for converting source documents, 2 for
processing their text, and one to update the index. This
was tested to be the best configuration on the test
system (quadri-processor with multiple disks).</p>
<pre class="programlisting">
thrQSizes = 2 2 2
thrTCounts = 4 2 1
</pre>
<p>The following example would use a single queue, and
the complete processing for each document would be
performed by a single thread (several documents will
still be processed in parallel in most cases). The
threads will use mutual exclusion when entering the index
update stage. In practise the performance would be close
to the precedent case in general, but worse in certain
cases (e.g. a Zip archive would be performed purely
sequentially), so the previous approach is preferred.
YMMV... The 2 last values for thrTCounts are ignored.</p>
<pre class="programlisting">
thrQSizes = 2 -1 -1
thrTCounts = 6 1 1
</pre>
<p>The following example would disable multithreading.
Indexing will be performed by a single thread.</p>
<pre class="programlisting">
thrQSizes = -1 -1 -1
</pre>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.INDEXING.CONFIG.GUI"
id="RCL.INDEXING.CONFIG.GUI"></a>2.3.4.&nbsp;The
index configuration GUI</h3>
</div>
</div>
</div>
<p>Most parameters for a given index configuration can be
set from a <span class=
"command"><strong>recoll</strong></span> GUI running on
this configuration (either as default, or by setting
<code class="envar">RECOLL_CONFDIR</code> or the
<code class="option">-c</code> option.)</p>
<p>The interface is started from the <span class=
"guimenu">Preferences</span> ��� <span class=
"guimenuitem">Index Configuration</span> menu entry. It
is divided in four tabs, <span class="guilabel">Global
parameters</span>, <span class="guilabel">Local
parameters</span>, <span class="guilabel">Web
history</span> (which is explained in the next section)
and <span class="guilabel">Search parameters</span>.</p>
<p>The <span class="guilabel">Global parameters</span>
tab allows setting global variables, like the lists of
top directories, skipped paths, or stemming
languages.</p>
<p>The <span class="guilabel">Local parameters</span> tab
allows setting variables that can be redefined for
subdirectories. This second tab has an initially empty
list of customisation directories, to which you can add.
The variables are then set for the currently selected
directory (or at the top level if the empty line is
selected).</p>
<p>The <span class="guilabel">Search parameters</span>
section defines parameters which are used at query time,
but are global to an index and affect all search tools,
not only the GUI.</p>
<p>The meaning for most entries in the interface is
self-evident and documented by a <code class=
"literal">ToolTip</code> popup on the text label. For
more detail, you will need to refer to the <a class=
"link" href="#RCL.INSTALL.CONFIG" title=
"6.4.&nbsp;Configuration overview">configuration
section</a> of this guide.</p>
<p>The configuration tool normally respects the comments
and most of the formatting inside the configuration file,
so that it is quite possible to use it on hand-edited
files, which you might nevertheless want to backup
first...</p>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INDEXING.WEBQUEUE" id=
"RCL.INDEXING.WEBQUEUE"></a>2.4.&nbsp;Indexing the
WEB pages which you wisit.</h2>
</div>
</div>
</div>
<p>With the help of a <span class=
"application">Firefox</span> extension, <span class=
"application">Recoll</span> can index the Internet pages
that you visit. The extension has a long history: it was
initially designed for the <span class=
"application">Beagle</span> indexer, then adapted to
<span class="application">Recoll</span> and the
<span class="application">Firefox</span> <span class=
"application">XUL</span> API. A new version of the addon
has been written to work with the <span class=
"application">WebExtensions</span> API, which is the only
one supported after <span class=
"application">Firefox</span> version 57.</p>
<p>The extension works by copying visited WEB pages to an
indexing queue directory, which <span class=
"application">Recoll</span> then processes, indexing the
data, storing it into a local cache, then removing the file
from the queue.</p>
<p>Because the WebExtensions API introduces more
constraints to what extensions can do, the new version
works with one more step: the files are first created in
the browser default downloads location (typically
<code class="filename">$HOME/Downloads</code> ), then moved
by a script in the old queue location. The script is
automatically executed by the <span class=
"application">Recoll</span> indexer versions 1.23.5 and
newer. It could conceivably be executed independantly to
make the new browser extension compatible with an older
<span class="application">Recoll</span> version (the script
is named <span class=
"command"><strong>recoll-we-move-files.py</strong></span>).</p>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>For the WebExtensions-based version to work, it is
necessary to set the <code class=
"literal">webdownloadsdir</code> value in the
configuration if it was changed from the default
<code class="filename">$HOME/Downloads</code> in the
browser preferences.</p>
</div>
<p>The visited WEB pages indexing feature can be enabled on
the <span class="application">Recoll</span> side from the
GUI <span class="guilabel">Index configuration</span>
panel, or by editing the configuration file (set
<code class="varname">processwebqueue</code> to 1).</p>
<p>A current pointer to the extension can be found, along
with up-to-date instructions, on the <a class="ulink" href=
"https://www.lesbonscomptes.com/recoll/faqsandhowtos/IndexWebHistory"
target="_top">Recoll wiki</a>.</p>
<p>A copy of the indexed WEB pages is retained by Recoll in
a local cache (from which previews can be fetched). The
cache size can be adjusted from the <span class=
"guilabel">Index configuration</span> / <span class=
"guilabel">Web history</span> panel. Once the maximum size
is reached, old pages are purged - both from the cache and
the index - to make room for new ones, so you need to
explicitly archive in some other place the pages that you
want to keep indefinitely.</p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INDEXING.EXTATTR" id=
"RCL.INDEXING.EXTATTR"></a>2.5.&nbsp;Extended
attributes data</h2>
</div>
</div>
</div>
<p>User extended attributes are named pieces of information
that most modern file systems can attach to any file.</p>
<p><span class="application">Recoll</span> versions 1.19
and later process extended attributes as document fields by
default. For older versions, this has to be activated at
build time.</p>
<p>A <a class="ulink" href=
"http://www.freedesktop.org/wiki/CommonExtendedAttributes"
target="_top">freedesktop standard</a> defines a few
special attributes, which are handled as such by
<span class="application">Recoll</span>:</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">mime_type</span></dt>
<dd>
<p>If set, this overrides any other determination of
the file MIME type.</p>
</dd>
<dt><span class="term">charset</span></dt>
<dd>
<p>If set, this defines the file character set
(mostly useful for plain text files).</p>
</dd>
</dl>
</div>
<p>By default, other attributes are handled as <span class=
"application">Recoll</span> fields. On Linux, the
<code class="literal">user</code> prefix is removed from
the name. This can be configured more precisely inside the
<a class="link" href="#RCL.INSTALL.CONFIG.FIELDS" title=
"6.4.3.&nbsp;The fields file"><code class=
"filename">fields</code> configuration file</a>.</p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INDEXING.EXTTAGS" id=
"RCL.INDEXING.EXTTAGS"></a>2.6.&nbsp;Importing
external tags</h2>
</div>
</div>
</div>
<p>During indexing, it is possible to import metadata for
each file by executing commands. For example, this could
extract user tag data for the file and store it in a field
for indexing.</p>
<p>See the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.METADATACMDS">section about
the <code class="literal">metadatacmds</code> field</a> in
the main configuration chapter for a description of the
configuration syntax.</p>
<p>As an example, if you would want <span class=
"application">Recoll</span> to use tags managed by
<span class="application">tmsu</span>, you would add the
following to the configuration file:</p>
<pre class="programlisting">[/some/area/of/the/fs]
metadatacmds = ; tags = tmsu tags %f
</pre>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>Depending on the <span class="application">tmsu</span>
version, you may need/want to add options like
<code class="literal">--database=/some/db</code>.</p>
</div>
<p>You may want to restrict this processing to a subset of
the directory tree, because it may slow down indexing a bit
(<code class="literal">[some/area/of/the/fs]</code>).</p>
<p>Note the initial semi-colon after the equal sign.</p>
<p>In the example above, the output of <span class=
"command"><strong>tmsu</strong></span> is used to set a
field named <code class="literal">tags</code>. The field
name is arbitrary and could be <code class=
"literal">tmsu</code> or <code class=
"literal">myfield</code> just the same, but <code class=
"literal">tags</code> is an alias for the standard
<span class="application">Recoll</span> <code class=
"literal">keywords</code> field, and the <span class=
"command"><strong>tmsu</strong></span> output will just
augment its contents. This will avoid the need to extend
the <a class="link" href="#RCL.PROGRAM.FIELDS" title=
"5.2.&nbsp;Field data processing">field
configuration</a>.</p>
<p>Once re-indexing is performed (you'll need to force the
file reindexing, <span class="application">Recoll</span>
will not detect the need by itself), you will be able to
search from the query language, through any of its aliases:
<code class="literal">tags:some/alternate/values</code> or
<code class="literal">tags:all,these,values</code> (the
compact field search syntax is supported for recoll 1.20
and later. For older versions, you would need to repeat the
<code class="literal">tags:</code> specifier for each term,
e.g. <code class="literal">tags:some OR
tags:alternate</code>).</p>
<p>You should be aware that tags changes will not be
detected by the indexer if the file itself did not change.
One possible workaround would be to update the file
<code class="literal">ctime</code> when you modify the
tags, which would be consistent with how extended
attributes function. A pair of <span class=
"command"><strong>chmod</strong></span> commands could
accomplish this, or a <code class="literal">touch -a</code>
. Alternatively, just couple the tag update with a
<code class="literal">recollindex -e -i
filename.</code></p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INDEXING.PDF" id=
"RCL.INDEXING.PDF"></a>2.7.&nbsp;The PDF input
handler</h2>
</div>
</div>
</div>
<p>The PDF format is very important for scientific and
technical documentation, and document archival. It has
extensive facilities for storing metadata along with the
document, and these facilities are actually used in the
real world.</p>
<p>In consequence, the <code class=
"filename">rclpdf.py</code> PDF input handler has more
complex capabilities than most others, and it is also more
configurable. Specifically, <code class=
"filename">rclpdf.py</code> can automatically use
<span class="application">tesseract</span> to perform OCR
if the document text is empty, it can be configured to
extract specific metadata tags from an XMP packet, and to
extract PDF attachments.</p>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.INDEXING.PDF.OCR"
id="RCL.INDEXING.PDF.OCR"></a>2.7.1.&nbsp;OCR with
Tesseract</h3>
</div>
</div>
</div>
<p>If both <span class="application">tesseract</span> and
<span class="command"><strong>pdftoppm</strong></span>
(generally from the <span class=
"application">poppler-utils</span> package) are
installed, the PDF handler may attempt OCR on PDF files
with no text content. This is controlled by the <a class=
"link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.PDFOCR">pdfocr</a>
configuration variable, which is false by default because
OCR is very slow.</p>
<p>The choice of language is very important for
successfull OCR. Recoll has currently no way to determine
this from the document itself. You can set the language
to use through the contents of a <code class=
"filename">.ocrpdflang</code> text file in the same
directory as the PDF document, or through the
<code class="envar">RECOLL_TESSERACT_LANG</code>
environment variable, or through the contents of an
<code class="filename">ocrpdf</code> text file inside the
configuration directory. If none of the above are used,
<span class="application">Recoll</span> will try to guess
the language from the NLS environment.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.INDEXING.PDF.XMP"
id="RCL.INDEXING.PDF.XMP"></a>2.7.2.&nbsp;XMP
fields extraction</h3>
</div>
</div>
</div>
<p>The <code class="filename">rclpdf.py</code> script in
<span class="application">Recoll</span> version 1.23.2
and later can extract XMP metadata fields by executing
the <span class="command"><strong>pdfinfo</strong></span>
command (usually found with <span class=
"application">poppler-utils</span>). This is controlled
by the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.PDFEXTRAMETA">pdfextrameta</a>
configuration variable, which specifies which tags to
extract and, possibly, how to rename them.</p>
<p>The <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.PDFEXTRAMETAFIX">pdfextrametafix</a>
variable can be used to designate a file with Python code
to edit the metadata fields (available for <span class=
"application">Recoll</span> 1.23.3 and later. 1.23.2 has
equivalent code inside the handler script). Example:</p>
<pre class="programlisting">import sys
import re
class MetaFixer(object):
def __init__(self):
pass
def metafix(self, nm, txt):
if nm == 'bibtex:pages':
txt = re.sub(r'--', '-', txt)
elif nm == 'someothername':
# do something else
pass
elif nm == 'stillanother':
# etc.
pass
return txt
def wrapup(self, metaheaders):
pass
</pre>
<p>If the 'metafix()' method is defined, it is called for
each metadata field. A new MetaFixer object is created
for each PDF document (so the object can keep state for,
for example, eliminating duplicate values). If the
'wrapup()' method is defined, it is called at the end of
XMP fields processing with the whole metadata as
parameter, as an array of '(nm, val)' pairs, allowing an
alternate approach for editing or adding/deleting
fields.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.INDEXING.PDF.ATTACH"
id="RCL.INDEXING.PDF.ATTACH"></a>2.7.3.&nbsp;PDF
attachment indexing</h3>
</div>
</div>
</div>
<p>If <span class="application">pdftk</span> is
installed, and if the the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.PDFATTACH">pdfattach</a>
configuration variable is set, the PDF input handler will
try to extract PDF attachements for indexing as
sub-documents of the PDF file. This is disabled by
default, because it slows down PDF indexing a bit even if
not one attachment is ever found (PDF attachments are
uncommon in my experience).</p>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INDEXING.PERIODIC" id=
"RCL.INDEXING.PERIODIC"></a>2.8.&nbsp;Periodic
indexing</h2>
</div>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.PERIODIC.EXEC" id=
"RCL.INDEXING.PERIODIC.EXEC"></a>2.8.1.&nbsp;Running
indexing</h3>
</div>
</div>
</div>
<p>Indexing is always performed by the <span class=
"command"><strong>recollindex</strong></span> program,
which can be started either from the command line or from
the <span class="guimenu">File</span> menu in the
<span class="command"><strong>recoll</strong></span> GUI
program. When started from the GUI, the indexing will run
on the same configuration <span class=
"command"><strong>recoll</strong></span> was started on.
When started from the command line, <span class=
"command"><strong>recollindex</strong></span> will use
the <code class="envar">RECOLL_CONFDIR</code> variable or
accept a <code class="option">-c</code> <em class=
"replaceable"><code>confdir</code></em> option to specify
a non-default configuration directory.</p>
<p>If the <span class=
"command"><strong>recoll</strong></span> program finds no
index when it starts, it will automatically start
indexing (except if canceled).</p>
<p>The <span class=
"command"><strong>recollindex</strong></span> indexing
process can be interrupted by sending an interrupt
(<span class="keysym">Ctrl-C</span>, SIGINT) or terminate
(SIGTERM) signal. Some time may elapse before the process
exits, because it needs to properly flush and close the
index. This can also be done from the <span class=
"command"><strong>recoll</strong></span> GUI <span class=
"guimenu">File</span> ��� <span class="guimenuitem">Stop
Indexing</span> menu entry.</p>
<p>After such an interruption, the index will be somewhat
inconsistent because some operations which are normally
performed at the end of the indexing pass will have been
skipped (for example, the stemming and spelling databases
will be inexistant or out of date). You just need to
restart indexing at a later time to restore consistency.
The indexing will restart at the interruption point (the
full file tree will be traversed, but files that were
indexed up to the interruption and for which the index is
still up to date will not need to be reindexed).</p>
<p><span class=
"command"><strong>recollindex</strong></span> has a
number of other options which are described in its man
page. Only a few will be described here.</p>
<p>Option <code class="option">-z</code> will reset the
index when starting. This is almost the same as
destroying the index files (the nuance is that the
<span class="application">Xapian</span> format version
will not be changed).</p>
<p>Option <code class="option">-Z</code> will force the
update of all documents without resetting the index
first. This will not have the "clean start" aspect of
<code class="option">-z</code>, but the advantage is that
the index will remain available for querying while it is
rebuilt, which can be a significant advantage if it is
very big (some installations need days for a full index
rebuild).</p>
<p>Option <code class="option">-k</code> will force
retrying files which previously failed to be indexed, for
example because of a missing helper program.</p>
<p>Of special interest also, maybe, are the <code class=
"option">-i</code> and <code class="option">-f</code>
options. <code class="option">-i</code> allows indexing
an explicit list of files (given as command line
parameters or read on <code class=
"literal">stdin</code>). <code class="option">-f</code>
tells <span class=
"command"><strong>recollindex</strong></span> to ignore
file selection parameters from the configuration.
Together, these options allow building a custom file
selection process for some area of the file system, by
adding the top directory to the <code class=
"varname">skippedPaths</code> list and using an
appropriate file selection method to build the file list
to be fed to <span class=
"command"><strong>recollindex</strong></span>
<code class="option">-if</code>. Trivial example:</p>
<pre class="programlisting">
find . -name indexable.txt -print | recollindex -if
</pre>
<p><span class=
"command"><strong>recollindex</strong></span>
<code class="option">-i</code> will not descend into
subdirectories specified as parameters, but just add them
as index entries. It is up to the external file selection
method to build the complete file list.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.PERIODIC.AUTOMAT" id=
"RCL.INDEXING.PERIODIC.AUTOMAT"></a>2.8.2.&nbsp;Using
<span class="command"><strong>cron</strong></span>
to automate indexing</h3>
</div>
</div>
</div>
<p>The most common way to set up indexing is to have a
cron task execute it every night. For example the
following <code class="filename">crontab</code> entry
would do it every day at 3:30AM (supposing <span class=
"command"><strong>recollindex</strong></span> is in your
PATH):</p>
<pre class="screen">
30 3 * * * recollindex &gt; /some/tmp/dir/recolltrace 2&gt;&amp;1
</pre>
<p>Or, using <span class=
"command"><strong>anacron</strong></span>:</p>
<pre class="screen">
1 15 su mylogin -c "recollindex recollindex &gt; /tmp/rcltraceme 2&gt;&amp;1"
</pre>
<p>As of version 1.17 the <span class=
"application">Recoll</span> GUI has dialogs to manage
<code class="filename">crontab</code> entries for
<span class=
"command"><strong>recollindex</strong></span>. You can
reach them from the <span class=
"guimenu">Preferences</span> ��� <span class=
"guimenuitem">Indexing Schedule</span> menu. They only
work with the good old <span class=
"command"><strong>cron</strong></span>, and do not give
access to all features of <span class=
"command"><strong>cron</strong></span> scheduling.</p>
<p>The usual command to edit your <code class=
"filename">crontab</code> is <span class=
"command"><strong>crontab</strong></span> <code class=
"option">-e</code> (which will usually start the
<span class="command"><strong>vi</strong></span> editor
to edit the file). You may have more sophisticated tools
available on your system.</p>
<p>Please be aware that there may be differences between
your usual interactive command line environment and the
one seen by crontab commands. Especially the PATH
variable may be of concern. Please check the crontab
manual pages about possible issues.</p>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INDEXING.MONITOR" id=
"RCL.INDEXING.MONITOR"></a>2.9.&nbsp;Real time
indexing</h2>
</div>
</div>
</div>
<p>Real time monitoring/indexing is performed by starting
the <span class=
"command"><strong>recollindex</strong></span> <code class=
"option">-m</code> command. With this option, <span class=
"command"><strong>recollindex</strong></span> will detach
from the terminal and become a daemon, permanently
monitoring file changes and updating the index.</p>
<p>Under <span class="application">KDE</span>, <span class=
"application">Gnome</span> and some other desktop
environments, the daemon can automatically started when you
log in, by creating a desktop file inside the <code class=
"filename">~/.config/autostart</code> directory. This can
be done for you by the <span class=
"application">Recoll</span> GUI. Use the <span class=
"guimenu">Preferences-&gt;Indexing Schedule</span>
menu.</p>
<p>With older <span class="application">X11</span> setups,
starting the daemon is normally performed as part of the
user session script.</p>
<p>The <code class="filename">rclmon.sh</code> script can
be used to easily start and stop the daemon. It can be
found in the <code class="filename">examples</code>
directory (typically <code class=
"filename">/usr/local/[share/]recoll/examples</code>).</p>
<p>For example, my out of fashion <span class=
"application">xdm</span>-based session has a <code class=
"filename">.xsession</code> script with the following lines
at the end:</p>
<pre class="programlisting">recollconf=$HOME/.recoll-home
recolldata=/usr/local/share/recoll
RECOLL_CONFDIR=$recollconf $recolldata/examples/rclmon.sh start
fvwm
</pre>
<p>The indexing daemon gets started, then the window
manager, for which the session waits.</p>
<p>By default the indexing daemon will monitor the state of
the X11 session, and exit when it finishes, it is not
necessary to kill it explicitly. (The <span class=
"application">X11</span> server monitoring can be disabled
with option <code class="option">-x</code> to <span class=
"command"><strong>recollindex</strong></span>).</p>
<p>If you use the daemon completely out of an <span class=
"application">X11</span> session, you need to add option
<code class="option">-x</code> to disable <span class=
"application">X11</span> session monitoring (else the
daemon will not start).</p>
<p>By default, the messages from the indexing daemon will
be sent to the same file as those from the interactive
commands (<code class="literal">logfilename</code>). You
may want to change this by setting the <code class=
"varname">daemlogfilename</code> and <code class=
"varname">daemloglevel</code> configuration parameters.
Also the log file will only be truncated when the daemon
starts. If the daemon runs permanently, the log file may
grow quite big, depending on the log level.</p>
<p>When building <span class="application">Recoll</span>,
the real time indexing support can be customised during
package <a class="link" href="#RCL.INSTALL.BUILDING" title=
"6.3.&nbsp;Building from source">configuration</a> with the
<code class="option">--with[out]-fam</code> or <code class=
"option">--with[out]-inotify</code> options. The default is
currently to include <span class=
"application">inotify</span> monitoring on systems that
support it, and, as of <span class=
"application">Recoll</span> 1.17, <span class=
"application">gamin</span> support on <span class=
"application">FreeBSD</span>.</p>
<p>While it is convenient that data is indexed in real
time, repeated indexing can generate a significant load on
the system when files such as email folders change. Also,
monitoring large file trees by itself significantly taxes
system resources. You probably do not want to enable it if
your system is short on resources. Periodic indexing is
adequate in most cases.</p>
<p>As of <span class="application">Recoll</span> 1.25, you
can set the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.MONITORDIRS">monitordirs</a>
configuration variable to specify that only a subset of
your indexed files will be monitored for instant indexing.
In this situation, an incremental pass on the full tree can
be triggered by either restarting the indexer, or just
running the <span class=
"command"><strong>recollindex</strong></span>, which will
notify the running process. The <span class=
"command"><strong>recoll</strong></span> GUI also has a
menu entry for this.</p>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Increasing resources for inotify</h3>
<p>On Linux systems, monitoring a big tree may need
increasing the resources available to inotify, which are
normally defined in <code class=
"filename">/etc/sysctl.conf</code>.</p>
<pre class="programlisting">
### inotify
#
# cat /proc/sys/fs/inotify/max_queued_events - 16384
# cat /proc/sys/fs/inotify/max_user_instances - 128
# cat /proc/sys/fs/inotify/max_user_watches - 16384
#
# -- Change to:
#
fs.inotify.max_queued_events=32768
fs.inotify.max_user_instances=256
fs.inotify.max_user_watches=32768
</pre>
<p>Especially, you will need to trim your tree or adjust
the <code class="literal">max_user_watches</code> value
if indexing exits with a message about errno <code class=
"literal">ENOSPC</code> (28) from <code class=
"function">inotify_add_watch</code>.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INDEXING.MONITOR.FASTFILES" id=
"RCL.INDEXING.MONITOR.FASTFILES"></a>2.9.1.&nbsp;Slowing
down the reindexing rate for fast changing
files</h3>
</div>
</div>
</div>
<p>When using the real time monitor, it may happen that
some files need to be indexed, but change so often that
they impose an excessive load for the system.</p>
<p><span class="application">Recoll</span> provides a
configuration option to specify the minimum time before
which a file, specified by a wildcard pattern, cannot be
reindexed. See the <code class=
"varname">mondelaypatterns</code> parameter in the
<a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.MISC" title=
"6.4.2.5.&nbsp;Miscellaneous parameters">configuration
section</a>.</p>
</div>
</div>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="RCL.SEARCH" id=
"RCL.SEARCH"></a>Chapter&nbsp;3.&nbsp;Searching</h1>
</div>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.SEARCH.GUI" id=
"RCL.SEARCH.GUI"></a>3.1.&nbsp;Searching with the Qt
graphical user interface</h2>
</div>
</div>
</div>
<p>The <span class="command"><strong>recoll</strong></span>
program provides the main user interface for searching. It
is based on the <span class="application">Qt</span>
library.</p>
<p><span class="command"><strong>recoll</strong></span> has
two search modes:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>Simple search (the default, on the main screen)
has a single entry field where you can enter multiple
words.</p>
</li>
<li class="listitem">
<p>Advanced search (a panel accessed through the
<span class="guilabel">Tools</span> menu or the
toolbox bar icon) has multiple entry fields, which
you may use to build a logical condition, with
additional filtering on file type, location in the
file system, modification date, and size.</p>
</li>
</ul>
</div>
<p>In most cases, you can enter the terms as you think
them, even if they contain embedded punctuation or other
non-textual characters. For example, <span class=
"application">Recoll</span> can handle things like email
addresses, or arbitrary cut and paste from another text
window, punctation and all.</p>
<p>The main case where you should enter text differently
from how it is printed is for east-asian languages
(Chinese, Japanese, Korean). Words composed of single or
multiple characters should be entered separated by white
space in this case (they would typically be printed without
white space).</p>
<p>Some searches can be quite complex, and you may want to
re-use them later, perhaps with some tweaking. <span class=
"application">Recoll</span> versions 1.21 and later can
save and restore searches, using XML files. See <a class=
"link" href="#RCL.SEARCH.SAVING" title=
"3.1.14.&nbsp;Saving and restoring queries (1.21 and later)">
Saving and restoring queries</a>.</p>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.SIMPLE"
id="RCL.SEARCH.GUI.SIMPLE"></a>3.1.1.&nbsp;Simple
search</h3>
</div>
</div>
</div>
<div class="procedure">
<ol class="procedure" type="1">
<li class="step">
<p>Start the <span class=
"command"><strong>recoll</strong></span>
program.</p>
</li>
<li class="step">
<p>Possibly choose a search mode: <span class=
"guilabel">Any term</span>, <span class=
"guilabel">All terms</span>, <span class=
"guilabel">File name</span> or <span class=
"guilabel">Query language</span>.</p>
</li>
<li class="step">
<p>Enter search term(s) in the text field at the
top of the window.</p>
</li>
<li class="step">
<p>Click the <span class="guilabel">Search</span>
button or hit the <span class=
"keycap"><strong>Enter</strong></span> key to start
the search.</p>
</li>
</ol>
</div>
<p>The initial default search mode is <span class=
"guilabel">Query language</span>. Without special
directives, this will look for documents containing all
of the search terms (the ones with more terms will get
better scores), just like the <span class="guilabel">All
terms</span> mode which will ignore such directives.
<span class="guilabel">Any term</span> will search for
documents where at least one of the terms appear.</p>
<p>The <span class="guilabel">Query Language</span>
features are described in <a class="link" href=
"#RCL.SEARCH.LANG" title="3.6.&nbsp;The query language">a
separate section</a>.</p>
<p>All search modes allow wildcards inside terms
(<code class="literal">*</code>, <code class=
"literal">?</code>, <code class="literal">[]</code>). You
may want to have a look at the <a class="link" href=
"#RCL.SEARCH.WILDCARDS" title=
"3.8.1.&nbsp;More about wildcards">section about
wildcards</a> for more information about this.</p>
<p><span class="guilabel">File name</span> will
specifically look for file names. The point of having a
separate file name search is that wild card expansion can
be performed more efficiently on a small subset of the
index (allowing wild cards on the left of terms without
excessive penality). Things to know:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>White space in the entry should match white
space in the file name, and is not treated
specially.</p>
</li>
<li class="listitem">
<p>The search is insensitive to character case and
accents, independantly of the type of index.</p>
</li>
<li class="listitem">
<p>An entry without any wild card character and not
capitalized will be prepended and appended with '*'
(ie: <em class="replaceable"><code>etc</code></em>
-&gt; <em class=
"replaceable"><code>*etc*</code></em>, but
<em class="replaceable"><code>Etc</code></em> -&gt;
<em class="replaceable"><code>etc</code></em>).</p>
</li>
<li class="listitem">
<p>If you have a big index (many files),
excessively generic fragments may result in
inefficient searches.</p>
</li>
</ul>
</div>
<p>You can search for exact phrases (adjacent words in a
given order) by enclosing the input inside double quotes.
Ex: <code class="literal">"virtual reality"</code>.</p>
<p>When using a stripped index, character case has no
influence on search, except that you can disable stem
expansion for any term by capitalizing it. Ie: a search
for <code class="literal">floor</code> will also normally
look for <code class="literal">flooring</code>,
<code class="literal">floored</code>, etc., but a search
for <code class="literal">Floor</code> will only look for
<code class="literal">floor</code>, in any character
case. Stemming can also be disabled globally in the
preferences. When using a raw index, <a class="link"
href="#RCL.SEARCH.CASEDIAC" title=
"3.7.&nbsp;Search case and diacritics sensitivity">the
rules are a bit more complicated</a>.</p>
<p><span class="application">Recoll</span> remembers the
last few searches that you performed. You can use the
simple search text entry widget (a combobox) to recall
them (click on the thing at the right of the text field).
Please note, however, that only the search texts are
remembered, not the mode (all/any/file name).</p>
<p>Typing <span class=
"keycap"><strong>Esc</strong></span> <span class=
"keycap"><strong>Space</strong></span> while entering a
word in the simple search entry will open a window with
possible completions for the word. The completions are
extracted from the database.</p>
<p>Double-clicking on a word in the result list or a
preview window will insert it into the simple search
entry field.</p>
<p>You can cut and paste any text into an <span class=
"guilabel">All terms</span> or <span class="guilabel">Any
term</span> search field, punctuation, newlines and all -
except for wildcard characters (single <code class=
"literal">?</code> characters are ok). <span class=
"application">Recoll</span> will process it and produce a
meaningful search. This is what most differentiates this
mode from the <span class="guilabel">Query
Language</span> mode, where you have to care about the
syntax.</p>
<p>You can use the <a class="link" href=
"#RCL.SEARCH.GUI.COMPLEX" title=
"3.1.8.&nbsp;Complex/advanced search"><span class=
"guimenu">Tools</span> ��� <span class=
"guimenuitem">Advanced search</span></a> dialog for more
complex searches.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.RESLIST"
id="RCL.SEARCH.GUI.RESLIST"></a>3.1.2.&nbsp;The
default result list</h3>
</div>
</div>
</div>
<p>After starting a search, a list of results will
instantly be displayed in the main list window.</p>
<p>By default, the document list is presented in order of
relevance (how well the system estimates that the
document matches the query). You can sort the result by
ascending or descending date by using the vertical arrows
in the toolbar.</p>
<p>Clicking on the <code class="literal">Preview</code>
link for an entry will open an internal preview window
for the document. Further <code class=
"literal">Preview</code> clicks for the same search will
open tabs in the existing preview window. You can use
<span class="keycap"><strong>Shift</strong></span>+Click
to force the creation of another preview window, which
may be useful to view the documents side by side. (You
can also browse successive results in a single preview
window by typing <span class=
"keycap"><strong>Shift</strong></span>+<span class=
"keycap"><strong>ArrowUp/Down</strong></span> in the
window).</p>
<p>Clicking the <code class="literal">Open</code> link
will start an external viewer for the document. By
default, <span class="application">Recoll</span> lets the
desktop choose the appropriate application for most
document types (there is a short list of exceptions, see
further). If you prefer to completely customize the
choice of applications, you can uncheck the <span class=
"guilabel">Use desktop preferences</span> option in the
GUI preferences dialog, and click the <span class=
"guilabel">Choose editor applications</span> button to
adjust the predefined <span class=
"application">Recoll</span> choices. The tool accepts
multiple selections of MIME types (e.g. to set up the
editor for the dozens of office file types).</p>
<p>Even when <span class="guilabel">Use desktop
preferences</span> is checked, there is a small list of
exceptions, for MIME types where the <span class=
"application">Recoll</span> choice should override the
desktop one. These are applications which are well
integrated with <span class="application">Recoll</span>,
especially <span class="application">evince</span> for
viewing PDF and Postscript files because of its support
for opening the document at a specific page and passing a
search string as an argument. Of course, you can edit the
list (in the GUI preferences) if you would prefer to lose
the functionality and use the standard desktop tool.</p>
<p>You may also change the choice of applications by
editing the <a class="link" href=
"#RCL.INSTALL.CONFIG.MIMEVIEW" title=
"6.4.6.&nbsp;The mimeview file"><code class=
"filename">mimeview</code></a> configuration file if you
find this more convenient.</p>
<p>Each result entry also has a right-click menu with an
<span class="guilabel">Open With</span> entry. This lets
you choose an application from the list of those which
registered with the desktop for the document MIME
type.</p>
<p>The <code class="literal">Preview</code> and
<code class="literal">Open</code> edit links may not be
present for all entries, meaning that <span class=
"application">Recoll</span> has no configured way to
preview a given file type (which was indexed by name
only), or no configured external editor for the file
type. This can sometimes be adjusted simply by tweaking
the <a class="link" href="#RCL.INSTALL.CONFIG.MIMEMAP"
title="6.4.4.&nbsp;The mimemap file"><code class=
"filename">mimemap</code></a> and <a class="link" href=
"#RCL.INSTALL.CONFIG.MIMEVIEW" title=
"6.4.6.&nbsp;The mimeview file"><code class=
"filename">mimeview</code></a> configuration files (the
latter can be modified with the user preferences
dialog).</p>
<p>The format of the result list entries is entirely
configurable by using the preference dialog to <a class=
"link" href="#RCL.SEARCH.GUI.CUSTOM.RESLIST" title=
"3.1.15.1.&nbsp;The result list format">edit an HTML
fragment</a>.</p>
<p>You can click on the <code class="literal">Query
details</code> link at the top of the results page to see
the query actually performed, after stem expansion and
other processing.</p>
<p>Double-clicking on any word inside the result list or
a preview window will insert it into the simple search
text.</p>
<p>The result list is divided into pages (the size of
which you can change in the preferences). Use the arrow
buttons in the toolbar or the links at the bottom of the
page to browse the results.</p>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.RESLIST.SUGGS" id=
"RCL.SEARCH.GUI.RESLIST.SUGGS"></a>3.1.2.1.&nbsp;No
results: the spelling suggestions</h4>
</div>
</div>
</div>
<p>When a search yields no result, and if the
<span class="application">aspell</span> dictionary is
configured, <span class="application">Recoll</span>
will try to check for misspellings among the query
terms, and will propose lists of replacements. Clicking
on one of the suggestions will replace the word and
restart the search. You can hold any of the modifier
keys (Ctrl, Shift, etc.) while clicking if you would
rather stay on the suggestion screen because several
terms need replacement.</p>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.RESULTLIST.MENU" id=
"RCL.SEARCH.GUI.RESULTLIST.MENU"></a>3.1.2.2.&nbsp;The
result list right-click menu</h4>
</div>
</div>
</div>
<p>Apart from the preview and edit links, you can
display a pop-up menu by right-clicking over a
paragraph in the result list. This menu has the
following entries:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><span class="guilabel">Preview</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Open</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Open With</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Run Script</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Copy File
Name</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Copy Url</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Save to File</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Find similar</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Preview Parent
document</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Open Parent
document</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Open Snippets
Window</span></p>
</li>
</ul>
</div>
<p>The <span class="guilabel">Preview</span> and
<span class="guilabel">Open</span> entries do the same
thing as the corresponding links.</p>
<p><span class="guilabel">Open With</span> lets you
open the document with one of the applications claiming
to be able to handle its MIME type (the information
comes from the <code class="literal">.desktop</code>
files in <code class=
"filename">/usr/share/applications</code>).</p>
<p><span class="guilabel">Run Script</span> allows
starting an arbitrary command on the result file. It
will only appear for results which are top-level files.
See <a class="link" href="#RCL.SEARCH.GUI.RUNSCRIPT"
title=
"3.1.4.&nbsp;Running arbitrary commands on result files (1.20 and later)">
further</a> for a more detailed description.</p>
<p>The <span class="guilabel">Copy File Name</span> and
<span class="guilabel">Copy Url</span> copy the
relevant data to the clipboard, for later pasting.</p>
<p><span class="guilabel">Save to File</span> allows
saving the contents of a result document to a chosen
file. This entry will only appear if the document does
not correspond to an existing file, but is a
subdocument inside such a file (ie: an email
attachment). It is especially useful to extract
attachments with no associated editor.</p>
<p>The <span class="guilabel">Open/Preview Parent
document</span> entries allow working with the higher
level document (e.g. the email message an attachment
comes from). <span class="application">Recoll</span> is
sometimes not totally accurate as to what it can or
can't do in this area. For example the <span class=
"guilabel">Parent</span> entry will also appear for an
email which is part of an mbox folder file, but you
can't actually visualize the mbox (there will be an
error dialog if you try).</p>
<p>If the document is a top-level file, <span class=
"guilabel">Open Parent</span> will start the default
file manager on the enclosing filesystem directory.</p>
<p>The <span class="guilabel">Find similar</span> entry
will select a number of relevant term from the current
document and enter them into the simple search field.
You can then start a simple search, with a good chance
of finding documents related to the current result. I
can't remember a single instance where this function
was actually useful to me...</p>
<p><a name="RCL.SEARCH.GUI.RESULTLIST.MENU.SNIPPETS"
id="RCL.SEARCH.GUI.RESULTLIST.MENU.SNIPPETS"></a>The
<span class="guilabel">Open Snippets Window</span>
entry will only appear for documents which support page
breaks (typically PDF, Postscript, DVI). The snippets
window lists extracts from the document, taken around
search terms occurrences, along with the corresponding
page number, as links which can be used to start the
native viewer on the appropriate page. If the viewer
supports it, its search function will also be primed
with one of the search terms.</p>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.RESTABLE"
id="RCL.SEARCH.GUI.RESTABLE"></a>3.1.3.&nbsp;The
result table</h3>
</div>
</div>
</div>
<p>In <span class="application">Recoll</span> 1.15 and
newer, the results can be displayed in spreadsheet-like
fashion. You can switch to this presentation by clicking
the table-like icon in the toolbar (this is a toggle,
click again to restore the list).</p>
<p>Clicking on the column headers will allow sorting by
the values in the column. You can click again to invert
the order, and use the header right-click menu to reset
sorting to the default relevance order (you can also use
the sort-by-date arrows to do this).</p>
<p>Both the list and the table display the same
underlying results. The sort order set from the table is
still active if you switch back to the list mode. You can
click twice on a date sort arrow to reset it from
there.</p>
<p>The header right-click menu allows adding or deleting
columns. The columns can be resized, and their order can
be changed (by dragging). All the changes are recorded
when you quit <span class=
"command"><strong>recoll</strong></span></p>
<p>Hovering over a table row will update the detail area
at the bottom of the window with the corresponding
values. You can click the row to freeze the display. The
bottom area is equivalent to a result list paragraph,
with links for starting a preview or a native
application, and an equivalent right-click menu. Typing
<span class="keycap"><strong>Esc</strong></span> (the
Escape key) will unfreeze the display.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.SEARCH.GUI.RUNSCRIPT" id=
"RCL.SEARCH.GUI.RUNSCRIPT"></a>3.1.4.&nbsp;Running
arbitrary commands on result files (1.20 and
later)</h3>
</div>
</div>
</div>
<p>Apart from the <span class="guilabel">Open</span> and
<span class="guilabel">Open With</span> operations, which
allow starting an application on a result document (or a
temporary copy), based on its MIME type, it is also
possible to run arbitrary commands on results which are
top-level files, using the <span class="guilabel">Run
Script</span> entry in the results pop-up menu.</p>
<p>The commands which will appear in the <span class=
"guilabel">Run Script</span> submenu must be defined by
<code class="literal">.desktop</code> files inside the
<code class="filename">scripts</code> subdirectory of the
current configuration directory.</p>
<p>Here follows an example of a <code class=
"literal">.desktop</code> file, which could be named for
example, <code class=
"filename">~/.recoll/scripts/myscript.desktop</code> (the
exact file name inside the directory is irrelevant):</p>
<pre class="programlisting">
[Desktop Entry]
Type=Application
Name=MyFirstScript
Exec=/home/me/bin/tryscript %F
MimeType=*/*
</pre>
<p>The <code class="literal">Name</code> attribute
defines the label which will appear inside the
<span class="guilabel">Run Script</span> menu. The
<code class="literal">Exec</code> attribute defines the
program to be run, which does not need to actually be a
script, of course. The <code class=
"literal">MimeType</code> attribute is not used, but
needs to exist.</p>
<p>The commands defined this way can also be used from
links inside the <a class="link" href=
"#RCL.SEARCH.GUI.CUSTOM.RESLIST.PARA" title=
"The paragraph format">result paragraph</a>.</p>
<p>As an example, it might make sense to write a script
which would move the document to the trash and purge it
from the <span class="application">Recoll</span>
index.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.SEARCH.GUI.THUMBNAILS" id=
"RCL.SEARCH.GUI.THUMBNAILS"></a>3.1.5.&nbsp;Displaying
thumbnails</h3>
</div>
</div>
</div>
<p>The default format for the result list entries and the
detail area of the result table display an icon for each
result document. The icon is either a generic one
determined from the MIME type, or a thumbnail of the
document appearance. Thumbnails are only displayed if
found in the standard <span class=
"application">freedesktop</span> location, where they
would typically have been created by a file manager.</p>
<p>Recoll has no capability to create thumbnails. A
relatively simple trick is to use the <span class=
"guilabel">Open parent document/folder</span> entry in
the result list popup menu. This should open a file
manager window on the containing directory, which should
in turn create the thumbnails (depending on your
settings). Restarting the search should then display the
thumbnails.</p>
<p>There are also <a class="ulink" href=
"https://www.lesbonscomptes.com/recoll/faqsandhowtos/ResultsThumbnails.wiki"
target="_top">some pointers about thumbnail
generation</a> on the <span class=
"application">Recoll</span> wiki.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.PREVIEW"
id="RCL.SEARCH.GUI.PREVIEW"></a>3.1.6.&nbsp;The
preview window</h3>
</div>
</div>
</div>
<p>The preview window opens when you first click a
<code class="literal">Preview</code> link inside the
result list.</p>
<p>Subsequent preview requests for a given search open
new tabs in the existing window (except if you hold the
<span class="keycap"><strong>Shift</strong></span> key
while clicking which will open a new window for side by
side viewing).</p>
<p>Starting another search and requesting a preview will
create a new preview window. The old one stays open until
you close it.</p>
<p>You can close a preview tab by typing <span class=
"keycap"><strong>Ctrl-W</strong></span> (<span class=
"keycap"><strong>Ctrl</strong></span> + <span class=
"keycap"><strong>W</strong></span>) in the window.
Closing the last tab for a window will also close the
window.</p>
<p>Of course you can also close a preview window by using
the window manager button in the top of the frame.</p>
<p>You can display successive or previous documents from
the result list inside a preview tab by typing
<span class=
"keycap"><strong>Shift</strong></span>+<span class=
"keycap"><strong>Down</strong></span> or <span class=
"keycap"><strong>Shift</strong></span>+<span class=
"keycap"><strong>Up</strong></span> (<span class=
"keycap"><strong>Down</strong></span> and <span class=
"keycap"><strong>Up</strong></span> are the arrow
keys).</p>
<p>A right-click menu in the text area allows switching
between displaying the main text or the contents of
fields associated to the document (ie: author, abtract,
etc.). This is especially useful in cases where the term
match did not occur in the main text but in one of the
fields. In the case of images, you can switch between
three displays: the image itself, the image metadata as
extracted by <span class=
"command"><strong>exiftool</strong></span> and the
fields, which is the metadata stored in the index.</p>
<p>You can print the current preview window contents by
typing <span class=
"keycap"><strong>Ctrl-P</strong></span> (<span class=
"keycap"><strong>Ctrl</strong></span> + <span class=
"keycap"><strong>P</strong></span>) in the window
text.</p>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.PREVIEW.SEARCH" id=
"RCL.SEARCH.GUI.PREVIEW.SEARCH"></a>3.1.6.1.&nbsp;Searching
inside the preview</h4>
</div>
</div>
</div>
<p>The preview window has an internal search
capability, mostly controlled by the panel at the
bottom of the window, which works in two modes: as a
classical editor incremental search, where we look for
the text entered in the entry zone, or as a way to walk
the matches between the document and the <span class=
"application">Recoll</span> query that found it.</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">Incremental text
search</span></dt>
<dd>
<p>The preview tabs have an internal incremental
search function. You initiate the search either
by typing a <span class=
"keycap"><strong>/</strong></span> (slash) or
<span class=
"keycap"><strong>CTL-F</strong></span> inside the
text area or by clicking into the <span class=
"guilabel">Search for:</span> text field and
entering the search string. You can then use the
<span class="guilabel">Next</span> and
<span class="guilabel">Previous</span> buttons to
find the next/previous occurrence. You can also
type <span class=
"keycap"><strong>F3</strong></span> inside the
text area to get to the next occurrence.</p>
<p>If you have a search string entered and you
use Ctrl-Up/Ctrl-Down to browse the results, the
search is initiated for each successive document.
If the string is found, the cursor will be
positioned at the first occurrence of the search
string.</p>
</dd>
<dt><span class="term">Walking the match
lists</span></dt>
<dd>
<p>If the entry area is empty when you click the
<span class="guilabel">Next</span> or
<span class="guilabel">Previous</span> buttons,
the editor will be scrolled to show the next
match to any search term (the next highlighted
zone). If you select a search group from the
dropdown list and click <span class=
"guilabel">Next</span> or <span class=
"guilabel">Previous</span>, the match list for
this group will be walked. This is not the same
as a text search, because the occurences will
include non-exact matches (as caused by stemming
or wildcards). The search will revert to the text
mode as soon as you edit the entry area.</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.FRAGBUTS"
id="RCL.SEARCH.GUI.FRAGBUTS"></a>3.1.7.&nbsp;The
Query Fragments window</h3>
</div>
</div>
</div>
<p>Selecting the <span class="guimenu">Tools</span> ���
<span class="guimenuitem">Query Fragments</span> menu
entry will open a window with radio- and check-buttons
which can be used to activate query language fragments
for filtering the current query. This can be useful if
you have frequent reusable selectors, for example,
filtering on alternate directories, or searching just one
category of files, not covered by the standard category
selectors.</p>
<p>The contents of the window are entirely customizable,
and defined by the contents of the <code class=
"filename">fragbuts.xml</code> file inside the
configuration directory. The sample file distributed with
<span class="application">Recoll</span> (which you should
be able to find under <code class=
"filename">/usr/share/recoll/examples/fragbuts.xml</code>),
contains an example which filters the results from the
WEB history.</p>
<p>Here follows an example:</p>
<pre class="programlisting">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;fragbuts version="1.0"&gt;
&lt;radiobuttons&gt;
&lt;fragbut&gt;
&lt;label&gt;Include Web Results&lt;/label&gt;
&lt;frag&gt;&lt;/frag&gt;
&lt;/fragbut&gt;
&lt;fragbut&gt;
&lt;label&gt;Exclude Web Results&lt;/label&gt;
&lt;frag&gt;-rclbes:BGL&lt;/frag&gt;
&lt;/fragbut&gt;
&lt;fragbut&gt;
&lt;label&gt;Only Web Results&lt;/label&gt;
&lt;frag&gt;rclbes:BGL&lt;/frag&gt;
&lt;/fragbut&gt;
&lt;/radiobuttons&gt;
&lt;buttons&gt;
&lt;fragbut&gt;
&lt;label&gt;Year 2010&lt;/label&gt;
&lt;frag&gt;date:2010-01-01/2010-12-31&lt;/frag&gt;
&lt;/fragbut&gt;
&lt;fragbut&gt;
&lt;label&gt;My Great Directory Only&lt;/label&gt;
&lt;frag&gt;dir:/my/great/directory&lt;/frag&gt;
&lt;/fragbut&gt;
&lt;/buttons&gt;
&lt;/fragbuts&gt;
</pre>
<p>Each <code class="literal">radiobuttons</code> or
<code class="literal">buttons</code> section defines a
line of checkbuttons or radiobuttons inside the window.
Any number of buttons can be selected, but the
radiobuttons in a line are exclusive.</p>
<p>Each <code class="literal">fragbut</code> section
defines the label for a button, and the Query Language
fragment which will be added (as an AND filter) before
performing the query if the button is active.</p>
<p>This feature is new in <span class=
"application">Recoll</span> 1.20, and will probably be
refined depending on user feedback.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.COMPLEX"
id=
"RCL.SEARCH.GUI.COMPLEX"></a>3.1.8.&nbsp;Complex/advanced
search</h3>
</div>
</div>
</div>
<p>The advanced search dialog helps you build more
complex queries without memorizing the search language
constructs. It can be opened through the <span class=
"guilabel">Tools</span> menu or through the main
toolbar.</p>
<p><span class="application">Recoll</span> keeps a
history of searches. See <a class="link" href=
"#RCL.SEARCH.GUI.COMPLEX.HISTORY" title=
"3.1.8.3.&nbsp;Avanced search history">Advanced search
history</a>.</p>
<p>The dialog has two tabs:</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>The first tab lets you specify terms to search
for, and permits specifying multiple clauses which
are combined to build the search.</p>
</li>
<li class="listitem">
<p>The second tab lets filter the results according
to file size, date of modification, MIME type, or
location.</p>
</li>
</ol>
</div>
<p>Click on the <span class="guilabel">Start
Search</span> button in the advanced search dialog, or
type <span class="keycap"><strong>Enter</strong></span>
in any text field to start the search. The button in the
main window always performs a simple search.</p>
<p>Click on the <code class="literal">Show query
details</code> link at the top of the result page to see
the query expansion.</p>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.COMPLEX.TERMS" id=
"RCL.SEARCH.GUI.COMPLEX.TERMS"></a>3.1.8.1.&nbsp;Avanced
search: the "find" tab</h4>
</div>
</div>
</div>
<p>This part of the dialog lets you constructc a query
by combining multiple clauses of different types. Each
entry field is configurable for the following
modes:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>All terms.</p>
</li>
<li class="listitem">
<p>Any term.</p>
</li>
<li class="listitem">
<p>None of the terms.</p>
</li>
<li class="listitem">
<p>Phrase (exact terms in order within an
adjustable window).</p>
</li>
<li class="listitem">
<p>Proximity (terms in any order within an
adjustable window).</p>
</li>
<li class="listitem">
<p>Filename search.</p>
</li>
</ul>
</div>
<p>Additional entry fields can be created by clicking
the <span class="guilabel">Add clause</span>
button.</p>
<p>When searching, the non-empty clauses will be
combined either with an AND or an OR conjunction,
depending on the choice made on the left (<span class=
"guilabel">All clauses</span> or <span class=
"guilabel">Any clause</span>).</p>
<p>Entries of all types except "Phrase" and "Near"
accept a mix of single words and phrases enclosed in
double quotes. Stemming and wildcard expansion will be
performed as for simple search.</p>
<p><b>Phrases and Proximity searches.&nbsp;</b>These
two clauses work in similar ways, with the difference
that proximity searches do not impose an order on the
words. In both cases, an adjustable number (slack) of
non-matched words may be accepted between the searched
ones (use the counter on the left to adjust this
count). For phrases, the default count is zero (exact
match). For proximity it is ten (meaning that two
search terms, would be matched if found within a window
of twelve words). Examples: a phrase search for
<code class="literal">quick fox</code> with a slack of
0 will match <code class="literal">quick fox</code> but
not <code class="literal">quick brown fox</code>. With
a slack of 1 it will match the latter, but not
<code class="literal">fox quick</code>. A proximity
search for <code class="literal">quick fox</code> with
the default slack will match the latter, and also
<code class="literal">a fox is a cunning and quick
animal</code>.</p>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.COMPLEX.FILTER" id=
"RCL.SEARCH.GUI.COMPLEX.FILTER"></a>3.1.8.2.&nbsp;Avanced
search: the "filter" tab</h4>
</div>
</div>
</div>
<p>This part of the dialog has several sections which
allow filtering the results of a search according to a
number of criteria</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>The first section allows filtering by dates of
last modification. You can specify both a minimum
and a maximum date. The initial values are set
according to the oldest and newest documents
found in the index.</p>
</li>
<li class="listitem">
<p>The next section allows filtering the results
by file size. There are two entries for minimum
and maximum size. Enter decimal numbers. You can
use suffix multipliers: <code class=
"literal">k/K</code>, <code class=
"literal">m/M</code>, <code class=
"literal">g/G</code>, <code class=
"literal">t/T</code> for 1E3, 1E6, 1E9, 1E12
respectively.</p>
</li>
<li class="listitem">
<p>The next section allows filtering the results
by their MIME types, or MIME categories (ie:
media/text/message/etc.).</p>
<p>You can transfer the types between two boxes,
to define which will be included or excluded by
the search.</p>
<p>The state of the file type selection can be
saved as the default (the file type filter will
not be activated at program start-up, but the
lists will be in the restored state).</p>
</li>
<li class="listitem">
<p>The bottom section allows restricting the
search results to a sub-tree of the indexed area.
You can use the <span class=
"guilabel">Invert</span> checkbox to search for
files not in the sub-tree instead. If you use
directory filtering often and on big subsets of
the file system, you may think of setting up
multiple indexes instead, as the performance may
be better.</p>
<p>You can use relative/partial paths for
filtering. Ie, entering <code class=
"literal">dirA/dirB</code> would match either
<code class=
"filename">/dir1/dirA/dirB/myfile1</code> or
<code class=
"filename">/dir2/dirA/dirB/someother/myfile2</code>.</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.COMPLEX.HISTORY" id=
"RCL.SEARCH.GUI.COMPLEX.HISTORY"></a>3.1.8.3.&nbsp;Avanced
search history</h4>
</div>
</div>
</div>
<p>The advanced search tool memorizes the last 100
searches performed. You can walk the saved searches by
using the up and down arrow keys while the keyboard
focus belongs to the advanced search dialog.</p>
<p>The complex search history can be erased, along with
the one for simple search, by selecting the
<span class="guimenu">File</span> ��� <span class=
"guimenuitem">Erase Search History</span> menu
entry.</p>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.SEARCH.GUI.TERMEXPLORER" id=
"RCL.SEARCH.GUI.TERMEXPLORER"></a>3.1.9.&nbsp;The
term explorer tool</h3>
</div>
</div>
</div>
<p><span class="application">Recoll</span> automatically
manages the expansion of search terms to their
derivatives (ie: plural/singular, verb inflections). But
there are other cases where the exact search term is not
known. For example, you may not remember the exact
spelling, or only know the beginning of the name.</p>
<p>The search will only propose replacement terms with
spelling variations when no matching document were found.
In some cases, both proper spellings and mispellings are
present in the index, and it may be interesting to look
for them explicitely.</p>
<p>The term explorer tool (started from the toolbar icon
or from the <span class="guilabel">Term explorer</span>
entry of the <span class="guilabel">Tools</span> menu)
can be used to search the full index terms list. It has
three modes of operations:</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">Wildcard</span></dt>
<dd>
<p>In this mode of operation, you can enter a
search string with shell-like wildcards (*, ?, []).
ie: <em class="replaceable"><code>xapi*</code></em>
would display all index terms beginning with
<em class="replaceable"><code>xapi</code></em>.
(More about wildcards <a class="link" href=
"#RCL.SEARCH.WILDCARDS" title=
"3.8.1.&nbsp;More about wildcards">here</a>).</p>
</dd>
<dt><span class="term">Regular expression</span></dt>
<dd>
<p>This mode will accept a regular expression as
input. Example: <em class=
"replaceable"><code>word[0-9]+</code></em>. The
expression is implicitely anchored at the
beginning. Ie: <em class=
"replaceable"><code>press</code></em> will match
<em class="replaceable"><code>pression</code></em>
but not <em class=
"replaceable"><code>expression</code></em>. You can
use <em class=
"replaceable"><code>.*press</code></em> to match
the latter, but be aware that this will cause a
full index term list scan, which can be quite
long.</p>
</dd>
<dt><span class="term">Stem expansion</span></dt>
<dd>
<p>This mode will perform the usual stem expansion
normally done as part user input processing. As
such it is probably mostly useful to demonstrate
the process.</p>
</dd>
<dt><span class="term">Spelling/Phonetic</span></dt>
<dd>
<p>In this mode, you enter the term as you think it
is spelled, and <span class=
"application">Recoll</span> will do its best to
find index terms that sound like your entry. This
mode uses the <span class=
"application">Aspell</span> spelling application,
which must be installed on your system for things
to work (if your documents contain non-ascii
characters, <span class="application">Recoll</span>
needs an aspell version newer than 0.60 for UTF-8
support). The language which is used to build the
dictionary out of the index terms (which is done at
the end of an indexing pass) is the one defined by
your NLS environment. Weird things will probably
happen if languages are mixed up.</p>
</dd>
</dl>
</div>
<p>Note that in cases where <span class=
"application">Recoll</span> does not know the beginning
of the string to search for (ie a wildcard expression
like <em class="replaceable"><code>*coll</code></em>),
the expansion can take quite a long time because the full
index term list will have to be processed. The expansion
is currently limited at 10000 results for wildcards and
regular expressions. It is possible to change the limit
in the configuration file.</p>
<p>Double-clicking on a term in the result list will
insert it into the simple search entry field. You can
also cut/paste between the result list and any entry
field (the end of lines will be taken care of).</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.MULTIDB"
id=
"RCL.SEARCH.GUI.MULTIDB"></a>3.1.10.&nbsp;Multiple
indexes</h3>
</div>
</div>
</div>
<p>See the <a class="link" href=
"#RCL.INDEXING.CONFIG.MULTIPLE" title=
"2.3.1.&nbsp;Multiple indexes">section describing the use
of multiple indexes</a> for generalities. Only the
aspects concerning the <span class=
"command"><strong>recoll</strong></span> GUI are
described here.</p>
<p>A <span class="command"><strong>recoll</strong></span>
program instance is always associated with a specific
index, which is the one to be updated when requested from
the <span class="guimenu">File</span> menu, but it can
use any number of <span class="application">Recoll</span>
indexes for searching. The external indexes can be
selected through the <span class="guilabel">external
indexes</span> tab in the preferences dialog.</p>
<p>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. These
parameters are retained across program executions (there
are kept separately for each <span class=
"application">Recoll</span> configuration). The set of
all indexes is usually quite stable, while the active
ones might typically be adjusted quite frequently.</p>
<p>The main index (defined by <code class=
"envar">RECOLL_CONFDIR</code>) is always active. If this
is undesirable, you can set up your base configuration to
index an empty directory.</p>
<p>When adding a new index to the set, you can select
either a <span class="application">Recoll</span>
configuration directory, or directly a <span class=
"application">Xapian</span> index directory. In the first
case, the <span class="application">Xapian</span> index
directory will be obtained from the selected
configuration.</p>
<p>As building the set of all indexes can be a little
tedious when done through the user interface, you can use
the <code class="envar">RECOLL_EXTRA_DBS</code>
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:</p>
<pre class="screen">
export RECOLL_EXTRA_DBS=/some/place/xapiandb:/some/other/db</pre>
<p>Another environment variable, <code class=
"envar">RECOLL_ACTIVE_EXTRA_DBS</code> allows adding to
the active list of indexes. This variable was suggested
and implemented by a <span class=
"application">Recoll</span> user. It is mostly useful if
you use scripts to mount external volumes with
<span class="application">Recoll</span> indexes. By using
<code class="envar">RECOLL_EXTRA_DBS</code> and
<code class="envar">RECOLL_ACTIVE_EXTRA_DBS</code>, you
can add and activate the index for the mounted volume
when starting <span class=
"command"><strong>recoll</strong></span>.</p>
<p><code class="envar">RECOLL_ACTIVE_EXTRA_DBS</code> is
available for <span class="application">Recoll</span>
versions 1.17.2 and later. A change was made in the same
update so that <span class=
"command"><strong>recoll</strong></span> will
automatically deactivate unreachable indexes when
starting up.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.HISTORY"
id=
"RCL.SEARCH.GUI.HISTORY"></a>3.1.11.&nbsp;Document
history</h3>
</div>
</div>
</div>
<p>Documents that you actually view (with the internal
preview or an external tool) are entered into the
document history, which is remembered.</p>
<p>You can display the history list by using the
<span class="guilabel">Tools/</span><span class=
"guilabel">Doc History</span> menu entry.</p>
<p>You can erase the document history by using the
<span class="guilabel">Erase document history</span>
entry in the <span class="guimenu">File</span> menu.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.SORT" id=
"RCL.SEARCH.GUI.SORT"></a>3.1.12.&nbsp;Sorting
search results and collapsing duplicates</h3>
</div>
</div>
</div>
<p>The documents in a result list are normally sorted in
order of relevance. It is possible to specify a different
sort order, either by using the vertical arrows in the
GUI toolbox to sort by date, or switching to the result
table display and clicking on any header. The sort order
chosen inside the result table remains active if you
switch back to the result list, until you click one of
the vertical arrows, until both are unchecked (you are
back to sort by relevance).</p>
<p>Sort parameters are remembered between program
invocations, but result sorting is normally always
inactive when the program starts. It is possible to keep
the sorting activation state between program invocations
by checking the <span class="guilabel">Remember sort
activation state</span> option in the preferences.</p>
<p>It is also possible to hide duplicate entries inside
the result list (documents with the exact same contents
as the displayed one). The test of identity is based on
an MD5 hash of the document container, not only of the
text contents (so that ie, a text document with an image
added will not be a duplicate of the text only).
Duplicates hiding is controlled by an entry in the
<span class="guilabel">GUI configuration</span> dialog,
and is off by default.</p>
<p>As of release 1.19, when a result document does have
undisplayed duplicates, a <code class=
"literal">Dups</code> link will be shown with the result
list entry. Clicking the link will display the paths
(URLs + ipaths) for the duplicate entries.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.TIPS" id=
"RCL.SEARCH.GUI.TIPS"></a>3.1.13.&nbsp;Search tips,
shortcuts</h3>
</div>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.TIPS.TERMS" id=
"RCL.SEARCH.GUI.TIPS.TERMS"></a>3.1.13.1.&nbsp;Terms
and search expansion</h4>
</div>
</div>
</div>
<p><b>Term completion.&nbsp;</b>Typing <span class=
"keycap"><strong>Esc</strong></span> <span class=
"keycap"><strong>Space</strong></span> in the simple
search entry field while entering a word will either
complete the current word if its beginning matches a
unique term in the index, or open a window to propose a
list of completions.</p>
<p><b>Picking up new terms from result or preview
text.&nbsp;</b>Double-clicking on a word in the result
list or in a preview window will copy it to the simple
search entry field.</p>
<p><b>Wildcards.&nbsp;</b>Wildcards can be used inside
search terms in all forms of searches. <a class="link"
href="#RCL.SEARCH.WILDCARDS" title=
"3.8.1.&nbsp;More about wildcards">More about
wildcards</a>.</p>
<p><b>Automatic suffixes.&nbsp;</b>Words like
<code class="literal">odt</code> or <code class=
"literal">ods</code> can be automatically turned into
query language <code class="literal">ext:xxx</code>
clauses. This can be enabled in the <span class=
"guilabel">Search preferences</span> panel in the
GUI.</p>
<p><b>Disabling stem expansion.&nbsp;</b>Entering a
capitalized word in any search field will prevent stem
expansion (no search for <code class=
"literal">gardening</code> if you enter <code class=
"literal">Garden</code> instead of <code class=
"literal">garden</code>). This is the only case where
character case should make a difference for a
<span class="application">Recoll</span> search. You can
also disable stem expansion or change the stemming
language in the preferences.</p>
<p><b>Finding related documents.&nbsp;</b>Selecting the
<span class="guilabel">Find similar documents</span>
entry in the result list paragraph right-click menu
will select a set of "interesting" terms from the
current result, and insert them into the simple search
entry field. You can then possibly edit the list and
start a search to find documents which may be
apparented to the current result.</p>
<p><b>File names.&nbsp;</b>File names are added as
terms during indexing, and you can specify them as
ordinary terms in normal search fields (<span class=
"application">Recoll</span> used to index all
directories in the file path as terms. This has been
abandoned as it did not seem really useful).
Alternatively, you can use the specific file name
search which will <span class=
"emphasis"><em>only</em></span> look for file names,
and may be faster than the generic search especially
when using wildcards.</p>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.TIPS.PHRASES" id=
"RCL.SEARCH.GUI.TIPS.PHRASES"></a>3.1.13.2.&nbsp;Working
with phrases and proximity</h4>
</div>
</div>
</div>
<p><b>Phrases and Proximity searches.&nbsp;</b>A phrase
can be looked for by enclosing it in double quotes.
Example: <code class="literal">"user manual"</code>
will look only for occurrences of <code class=
"literal">user</code> immediately followed by
<code class="literal">manual</code>. You can use the
<span class="guilabel">This phrase</span> field of the
advanced search dialog to the same effect. Phrases can
be entered along simple terms in all simple or advanced
search entry fields (except <span class="guilabel">This
exact phrase</span>).</p>
<p><b>AutoPhrases.&nbsp;</b>This option can be set in
the preferences dialog. If it is set, a phrase will be
automatically built and added to simple searches when
looking for <code class="literal">Any terms</code>.
This will not change radically the results, but will
give a relevance boost to the results where the search
terms appear as a phrase. Ie: searching for
<code class="literal">virtual reality</code> will still
find all documents where either <code class=
"literal">virtual</code> or <code class=
"literal">reality</code> or both appear, but those
which contain <code class="literal">virtual
reality</code> should appear sooner in the list.</p>
<p>Phrase searches can strongly slow down a query if
most of the terms in the phrase are common. This is why
the <code class="varname">autophrase</code> option is
off by default for <span class=
"application">Recoll</span> versions before 1.17. As of
version 1.17, <code class="varname">autophrase</code>
is on by default, but very common terms will be removed
from the constructed phrase. The removal threshold can
be adjusted from the search preferences.</p>
<p><b>Phrases and abbreviations.&nbsp;</b>As of
<span class="application">Recoll</span> version 1.17,
dotted abbreviations like <code class=
"literal">I.B.M.</code> are also automatically indexed
as a word without the dots: <code class=
"literal">IBM</code>. Searching for the word inside a
phrase (ie: <code class="literal">"the IBM
company"</code>) will only match the dotted
abrreviation if you increase the phrase slack (using
the advanced search panel control, or the <code class=
"literal">o</code> query language modifier). Literal
occurences of the word will be matched normally.</p>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.TIPS.MISC" id=
"RCL.SEARCH.GUI.TIPS.MISC"></a>3.1.13.3.&nbsp;Others</h4>
</div>
</div>
</div>
<p><b>Using fields.&nbsp;</b>You can use the <a class=
"link" href="#RCL.SEARCH.LANG" title=
"3.6.&nbsp;The query language">query language</a> and
field specifications to only search certain parts of
documents. This can be especially helpful with email,
for example only searching emails from a specific
originator: <code class="literal">search tips
from:helpfulgui</code></p>
<p><b>Ajusting the result table columns.&nbsp;</b>When
displaying results in table mode, you can use a right
click on the table headers to activate a pop-up menu
which will let you adjust what columns are displayed.
You can drag the column headers to adjust their order.
You can click them to sort by the field displayed in
the column. You can also save the result list in CSV
format.</p>
<p><b>Changing the GUI geometry.&nbsp;</b>It is
possible to configure the GUI in wide form factor by
dragging the toolbars to one of the sides (their
location is remembered between sessions), and moving
the category filters to a menu (can be set in the
<span class="guimenu">Preferences</span> ��� <span class=
"guimenuitem">GUI configuration</span> ��� <span class=
"guimenuitem">User interface</span> panel).</p>
<p><b>Query explanation.&nbsp;</b>You can get an exact
description of what the query looked for, including
stem expansion, and Boolean operators used, by clicking
on the result list header.</p>
<p><b>Advanced search history.&nbsp;</b>As of
<span class="application">Recoll</span> 1.18, you can
display any of the last 100 complex searches performed
by using the up and down arrow keys while the advanced
search panel is active.</p>
<p><b>Browsing the result list inside a preview
window.&nbsp;</b>Entering <span class=
"keycap"><strong>Shift-Down</strong></span> or
<span class="keycap"><strong>Shift-Up</strong></span>
(<span class="keycap"><strong>Shift</strong></span> +
an arrow key) in a preview window will display the next
or the previous document from the result list. Any
secondary search currently active will be executed on
the new document.</p>
<p><b>Scrolling the result list from the
keyboard.&nbsp;</b>You can use <span class=
"keycap"><strong>PageUp</strong></span> and
<span class="keycap"><strong>PageDown</strong></span>
to scroll the result list, <span class=
"keycap"><strong>Shift+Home</strong></span> to go back
to the first page. These work even while the focus is
in the search entry.</p>
<p><b>Result table: moving the focus to the
table.&nbsp;</b>You can use <span class=
"keycap"><strong>Ctrl-r</strong></span> to move the
focus from the search entry to the table, and then use
the arrow keys to change the current row. <span class=
"keycap"><strong>Ctrl-Shift-s</strong></span> returns
to the search.</p>
<p><b>Result table: open / preview.&nbsp;</b>With the
focus in the result table, you can use <span class=
"keycap"><strong>Ctrl-o</strong></span> to open the
document from the current row, <span class=
"keycap"><strong>Ctrl-Shift-o</strong></span> to open
the document and close <span class=
"command"><strong>recoll</strong></span>, <span class=
"keycap"><strong>Ctrl-d</strong></span> to preview the
document.</p>
<p><b>Editing a new search while the focus is not in
the search entry.&nbsp;</b>You can use the <span class=
"keycap"><strong>Ctrl-Shift-S</strong></span> shortcut
to return the cursor to the search entry (and select
the current search text), while the focus is anywhere
in the main window.</p>
<p><b>Forced opening of a preview window.&nbsp;</b>You
can use <span class=
"keycap"><strong>Shift</strong></span>+Click on a
result list <code class="literal">Preview</code> link
to force the creation of a preview window instead of a
new tab in the existing one.</p>
<p><b>Closing previews.&nbsp;</b>Entering <span class=
"keycap"><strong>Ctrl-W</strong></span> in a tab will
close it (and, for the last tab, close the preview
window). Entering <span class=
"keycap"><strong>Esc</strong></span> will close the
preview window and all its tabs.</p>
<p><b>Printing previews.&nbsp;</b>Entering <span class=
"keycap"><strong>Ctrl-P</strong></span> in a preview
window will print the currently displayed text.</p>
<p><b>Quitting.&nbsp;</b>Entering <span class=
"keycap"><strong>Ctrl-Q</strong></span> almost anywhere
will close the application.</p>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.SAVING" id=
"RCL.SEARCH.SAVING"></a>3.1.14.&nbsp;Saving and
restoring queries (1.21 and later)</h3>
</div>
</div>
</div>
<p>Both simple and advanced query dialogs save recent
history, but the amount is limited: old queries will
eventually be forgotten. Also, important queries may be
difficult to find among others. This is why both types of
queries can also be explicitely saved to files, from the
GUI menus: <span class="guimenu">File</span> ���
<span class="guimenuitem">Save last query / Load last
query</span></p>
<p>The default location for saved queries is a
subdirectory of the current configuration directory, but
saved queries are ordinary files and can be written or
moved anywhere.</p>
<p>Some of the saved query parameters are part of the
preferences (e.g. <code class="literal">autophrase</code>
or the active external indexes), and may differ when the
query is loaded from the time it was saved. In this case,
<span class="application">Recoll</span> will warn of the
differences, but will not change the user
preferences.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.GUI.CUSTOM"
id=
"RCL.SEARCH.GUI.CUSTOM"></a>3.1.15.&nbsp;Customizing
the search interface</h3>
</div>
</div>
</div>
<p>You can customize some aspects of the search interface
by using the <span class="guimenu">GUI
configuration</span> entry in the <span class=
"guimenu">Preferences</span> menu.</p>
<p>There are several tabs in the dialog, dealing with the
interface itself, the parameters used for searching and
returning results, and what indexes are searched.</p>
<p><a name="RCL.SEARCH.GUI.CUSTOM.UI" id=
"RCL.SEARCH.GUI.CUSTOM.UI"></a><b>User interface
parameters:&nbsp;</b></p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><span class="guilabel">Highlight color for query
terms</span>: Terms from the user query are
highlighted in the result list samples and the
preview window. The color can be chosen here. Any
Qt color string should work (ie <code class=
"literal">red</code>, <code class=
"literal">#ff0000</code>). The default is
<code class="literal">blue</code>.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Style sheet</span>: The
name of a <span class="application">Qt</span> style
sheet text file which is applied to the whole
Recoll application on startup. The default value is
empty, but there is a skeleton style sheet
(<code class="filename">recoll.qss</code>) inside
the <code class=
"filename">/usr/share/recoll/examples</code>
directory. Using a style sheet, you can change most
<span class=
"command"><strong>recoll</strong></span> graphical
parameters: colors, fonts, etc. See the sample file
for a few simple examples.</p>
<p>You should be aware that parameters (e.g.: the
background color) set inside the <span class=
"application">Recoll</span> GUI style sheet will
override global system preferences, with possible
strange side effects: for example if you set the
foreground to a light color and the background to a
dark one in the desktop preferences, but only the
background is set inside the <span class=
"application">Recoll</span> style sheet, and it is
light too, then text will appear light-on-light
inside the <span class="application">Recoll</span>
GUI.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Maximum text size
highlighted for preview</span> Inserting highlights
on search term inside the text before inserting it
in the preview window involves quite a lot of
processing, and can be disabled over the given text
size to speed up loading.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Prefer HTML to plain text
for preview</span> if set, Recoll will display HTML
as such inside the preview window. If this causes
problems with the Qt HTML display, you can uncheck
it to display the plain text version instead.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Activate links in
preview</span> if set, Recoll will turn HTTP links
found inside plain text into proper HTML anchors,
and clicking a link inside a preview window will
start the default browser on the link target.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Plain text to HTML line
style</span>: when displaying plain text inside the
preview window, <span class=
"application">Recoll</span> tries to preserve some
of the original text line breaks and indentation.
It can either use PRE HTML tags, which will well
preserve the indentation but will force horizontal
scrolling for long lines, or use BR tags to break
at the original line breaks, which will let the
editor introduce other line breaks according to the
window width, but will lose some of the original
indentation. The third option has been available in
recent releases and is probably now the best one:
use PRE tags with line wrapping.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Choose editor
applicationsr</span>: this opens a dialog which
allows you to select the application to be used to
open each MIME type. The default is nornally to use
the <span class=
"command"><strong>xdg-open</strong></span> utility,
but you can override it.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Exceptions</span>: even
wen <span class=
"command"><strong>xdg-open</strong></span> is used
by default for opening documents, you can set
exceptions for MIME types that will still be opened
according to <span class=
"application">Recoll</span> preferences. This is
useful for passing parameters like page numbers or
search strings to applications that support them
(e.g. <span class="application">evince</span>).
This cannot be done with <span class=
"command"><strong>xdg-open</strong></span> which
only supports passing one parameter.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Document filter choice
style</span>: this will let you choose if the
document categories are displayed as a list or a
set of buttons, or a menu.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Start with simple search
mode</span>: this lets you choose the value of the
simple search type on program startup. Either a
fixed value (e.g. <code class="literal">Query
Language</code>, or the value in use when the
program last exited.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Auto-start simple search
on white space entry</span>: if this is checked, a
search will be executed each time you enter a space
in the simple search input field. This lets you
look at the result list as you enter new terms.
This is off by default, you may like it or
not...</p>
</li>
<li class="listitem">
<p><span class="guilabel">Start with advanced
search dialog open</span> : If you use this dialog
frequently, checking the entries will get it to
open when recoll starts.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Remember sort activation
state</span> if set, Recoll will remember the sort
tool stat between invocations. It normally starts
with sorting disabled.</p>
</li>
</ul>
</div>
<p><a name="RCL.SEARCH.GUI.CUSTOM.RL" id=
"RCL.SEARCH.GUI.CUSTOM.RL"></a><b>Result list
parameters:&nbsp;</b></p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><span class="guilabel">Number of results in a
result page</span></p>
</li>
<li class="listitem">
<p><span class="guilabel">Result list font</span>:
There is quite a lot of information shown in the
result list, and you may want to customize the font
and/or font size. The rest of the fonts used by
<span class="application">Recoll</span> are
determined by your generic Qt config (try the
<span class=
"command"><strong>qtconfig</strong></span>
command).</p>
</li>
<li class="listitem">
<p><a name="RCL.SEARCH.GUI.CUSTOM.RESULTPARA" id=
"RCL.SEARCH.GUI.CUSTOM.RESULTPARA"></a><span class=
"guilabel">Edit result list paragraph format
string</span>: allows you to change the
presentation of each result list entry. See the
<a class="link" href=
"#RCL.SEARCH.GUI.CUSTOM.RESLIST" title=
"3.1.15.1.&nbsp;The result list format">result list
customisation section</a>.</p>
</li>
<li class="listitem">
<p><a name="RCL.SEARCH.GUI.CUSTOM.RESULTHEAD" id=
"RCL.SEARCH.GUI.CUSTOM.RESULTHEAD"></a><span class=
"guilabel">Edit result page HTML header
insert</span>: allows you to define text inserted
at the end of the result page HTML header. More
detail in the <a class="link" href=
"#RCL.SEARCH.GUI.CUSTOM.RESLIST" title=
"3.1.15.1.&nbsp;The result list format">result list
customisation section.</a></p>
</li>
<li class="listitem">
<p><span class="guilabel">Date format</span>:
allows specifying the format used for displaying
dates inside the result list. This should be
specified as an strftime() string (man
strftime).</p>
</li>
<li class="listitem">
<p><a name="RCL.SEARCH.GUI.CUSTOM.ABSSEP" id=
"RCL.SEARCH.GUI.CUSTOM.ABSSEP"></a><span class=
"guilabel">Abstract snippet separator</span>: for
synthetic abstracts built from index data, which
are usually made of several snippets from different
parts of the document, this defines the snippet
separator, an ellipsis by default.</p>
</li>
</ul>
</div>
<p><a name="RCL.SEARCH.GUI.CUSTOM.SEARCH" id=
"RCL.SEARCH.GUI.CUSTOM.SEARCH"></a><b>Search
parameters:&nbsp;</b></p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><span class="guilabel">Hide duplicate
results</span>: decides if result list entries are
shown for identical documents found in different
places.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Stemming language</span>:
stemming obviously depends on the document's
language. This listbox will let you chose among the
stemming databases which were built during indexing
(this is set in the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF" title=
"6.4.2.&nbsp;Recoll main configuration file, recoll.conf">
main configuration file</a>), or later added with
<span class="command"><strong>recollindex
-s</strong></span> (See the recollindex manual).
Stemming languages which are dynamically added will
be deleted at the next indexing pass unless they
are also added in the configuration file.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Automatically add phrase
to simple searches</span>: a phrase will be
automatically built and added to simple searches
when looking for <code class="literal">Any
terms</code>. This will give a relevance boost to
the results where the search terms appear as a
phrase (consecutive and in order).</p>
</li>
<li class="listitem">
<p><span class="guilabel">Autophrase term frequency
threshold percentage</span>: very frequent terms
should not be included in automatic phrase searches
for performance reasons. The parameter defines the
cutoff percentage (percentage of the documents
where the term appears).</p>
</li>
<li class="listitem">
<p><span class="guilabel">Replace abstracts from
documents</span>: this decides if we should
synthesize and display an abstract in place of an
explicit abstract found within the document
itself.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Dynamically build
abstracts</span>: this decides if <span class=
"application">Recoll</span> tries to build document
abstracts (lists of <span class=
"emphasis"><em>snippets</em></span>) when
displaying the result list. Abstracts are
constructed by taking context from the document
information, around the search terms.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Synthetic abstract
size</span>: adjust to taste...</p>
</li>
<li class="listitem">
<p><span class="guilabel">Synthetic abstract
context words</span>: how many words should be
displayed around each term occurrence.</p>
</li>
<li class="listitem">
<p><span class="guilabel">Query language magic file
name suffixes</span>: a list of words which
automatically get turned into <code class=
"literal">ext:xxx</code> file name suffix clauses
when starting a query language query (ie:
<code class="literal">doc xls xlsx...</code>). This
will save some typing for people who use file types
a lot when querying.</p>
</li>
</ul>
</div>
<p><a name="RCL.SEARCH.GUI.CUSTOM.EXTRADB" id=
"RCL.SEARCH.GUI.CUSTOM.EXTRADB"></a><b>External
indexes:&nbsp;</b>This panel will let you browse for
additional indexes that you may want to search. External
indexes are designated by their database directory (ie:
<code class=
"filename">/home/someothergui/.recoll/xapiandb</code>,
<code class=
"filename">/usr/local/recollglobal/xapiandb</code>).</p>
<p>Once entered, the indexes will appear in the
<span class="guilabel">External indexes</span> list, and
you can chose which ones you want to use at any moment by
checking or unchecking their entries.</p>
<p>Your main database (the one the current configuration
indexes to), is always implicitly active. If this is not
desirable, you can set up your configuration so that it
indexes, for example, an empty directory. An alternative
indexer may also need to implement a way of purging the
index from stale data,</p>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.GUI.CUSTOM.RESLIST" id=
"RCL.SEARCH.GUI.CUSTOM.RESLIST"></a>3.1.15.1.&nbsp;The
result list format</h4>
</div>
</div>
</div>
<p>Newer versions of Recoll (from 1.17) normally use
WebKit HTML widgets for the result list and the
<a class="link" href=
"#RCL.SEARCH.GUI.RESULTLIST.MENU.SNIPPETS">snippets
window</a> (this may be disabled at build time). Total
customisation is possible with full support for CSS and
Javascript. Conversely, there are limits to what you
can do with the older Qt QTextBrowser, but still, it is
possible to decide what data each result will contain,
and how it will be displayed.</p>
<p>The result list presentation can be exhaustively
customized by adjusting two elements:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>The paragraph format</p>
</li>
<li class="listitem">
<p>HTML code inside the header section. For
versions 1.21 and later, this is also used for
the <a class="link" href=
"#RCL.SEARCH.GUI.RESULTLIST.MENU.SNIPPETS">snippets
window</a></p>
</li>
</ul>
</div>
<p>The paragraph format and the header fragment can be
edited from the <span class="guilabel">Result
list</span> tab of the <span class="guilabel">GUI
configuration</span>.</p>
<p>The header fragment is used both for the result list
and the snippets window. The snippets list is a table
and has a <code class="literal">snippets</code> class
attribute. Each paragraph in the result list is a
table, with class <code class="literal">respar</code>,
but this can be changed by editing the paragraph
format.</p>
<p>There are a few examples on the <a class="ulink"
href="http://www.recoll.org/custom.html" target=
"_top">page about customising the result list</a> on
the <span class="application">Recoll</span> web
site.</p>
<div class="sect4">
<div class="titlepage">
<div>
<div>
<h5 class="title"><a name=
"RCL.SEARCH.GUI.CUSTOM.RESLIST.PARA" id=
"RCL.SEARCH.GUI.CUSTOM.RESLIST.PARA"></a>The
paragraph format</h5>
</div>
</div>
</div>
<p>This is an arbitrary HTML string where the
following printf-like <code class="literal">%</code>
substitutions will be performed:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><b>%A.&nbsp;</b>Abstract</p>
</li>
<li class="listitem">
<p><b>%D.&nbsp;</b>Date</p>
</li>
<li class="listitem">
<p><b>%I.&nbsp;</b>Icon image name. This is
normally determined from the MIME type. The
associations are defined inside the <a class=
"link" href="#RCL.INSTALL.CONFIG.MIMECONF"
title=
"6.4.5.&nbsp;The mimeconf file"><code class=
"filename">mimeconf</code> configuration
file</a>. If a thumbnail for the file is found
at the standard Freedesktop location, this will
be displayed instead.</p>
</li>
<li class="listitem">
<p><b>%K.&nbsp;</b>Keywords (if any)</p>
</li>
<li class="listitem">
<p><b>%L.&nbsp;</b>Precooked Preview, Edit, and
possibly Snippets links</p>
</li>
<li class="listitem">
<p><b>%M.&nbsp;</b>MIME type</p>
</li>
<li class="listitem">
<p><b>%N.&nbsp;</b>result Number inside the
result page</p>
</li>
<li class="listitem">
<p><b>%P.&nbsp;</b>Parent folder Url. In the
case of an embedded document, this is the
parent folder for the top level container
file.</p>
</li>
<li class="listitem">
<p><b>%R.&nbsp;</b>Relevance percentage</p>
</li>
<li class="listitem">
<p><b>%S.&nbsp;</b>Size information</p>
</li>
<li class="listitem">
<p><b>%T.&nbsp;</b>Title or Filename if not
set.</p>
</li>
<li class="listitem">
<p><b>%t.&nbsp;</b>Title or empty.</p>
</li>
<li class="listitem">
<p><b>%U.&nbsp;</b>Url</p>
</li>
</ul>
</div>
<p>The format of the Preview, Edit, and Snippets
links is <code class="literal">&lt;a
href="P%N"&gt;</code>, <code class="literal">&lt;a
href="E%N"&gt;</code> and <code class="literal">&lt;a
href="A%N"&gt;</code> where <em class=
"replaceable"><code>docnum</code></em> (%N) expands
to the document number inside the result page).</p>
<p>A link target defined as <code class=
"literal">"F%N"</code> will open the document
corresponding to the <code class="literal">%P</code>
parent folder expansion, usually creating a file
manager window on the folder where the container file
resides. E.g.:</p>
<pre class="programlisting">
&lt;a href="F%N"&gt;%P&lt;/a&gt;</pre>
<p>A link target defined as <code class=
"literal">R%N|<em class=
"replaceable"><code>scriptname</code></em></code>
will run the corresponding script on the result file
(if the document is embedded, the script will be
started on the top-level parent). See the <a class=
"link" href="#RCL.SEARCH.GUI.RUNSCRIPT" title=
"3.1.4.&nbsp;Running arbitrary commands on result files (1.20 and later)">
section about defining scripts</a>.</p>
<p>In addition to the predefined values above, all
strings like <code class=
"literal">%(fieldname)</code> will be replaced by the
value of the field named <code class=
"literal">fieldname</code> for this document. Only
stored fields can be accessed in this way, the value
of indexed but not stored fields is not known at this
point in the search process (see <a class="link"
href="#RCL.PROGRAM.FIELDS" title=
"5.2.&nbsp;Field data processing">field
configuration</a>). There are currently very few
fields stored by default, apart from the values above
(only <code class="literal">author</code> and
<code class="literal">filename</code>), so this
feature will need some custom local configuration to
be useful. An example candidate would be the
<code class="literal">recipient</code> field which is
generated by the message input handlers.</p>
<p>The default value for the paragraph format string
is:</p>
<pre class="screen">
"&lt;table class=\"respar\"&gt;\n"
"&lt;tr&gt;\n"
"&lt;td&gt;&lt;a href='%U'&gt;&lt;img src='%I' width='64'&gt;&lt;/a&gt;&lt;/td&gt;\n"
"&lt;td&gt;%L &amp;nbsp;&lt;i&gt;%S&lt;/i&gt; &amp;nbsp;&amp;nbsp;&lt;b&gt;%T&lt;/b&gt;&lt;br&gt;\n"
"&lt;span style='white-space:nowrap'&gt;&lt;i&gt;%M&lt;/i&gt;&amp;nbsp;%D&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;i&gt;%U&lt;/i&gt;&amp;nbsp;%i&lt;br&gt;\n"
"%A %K&lt;/td&gt;\n"
"&lt;/tr&gt;&lt;/table&gt;\n"
</pre>
<p>You may, for example, try the following for a more
web-like experience:</p>
<pre class="screen">
&lt;u&gt;&lt;b&gt;&lt;a href="P%N"&gt;%T&lt;/a&gt;&lt;/b&gt;&lt;/u&gt;&lt;br&gt;
%A&lt;font color=#008000&gt;%U - %S&lt;/font&gt; - %L
</pre>
<p>Note that the P%N link in the above paragraph
makes the title a preview link. Or the clean
looking:</p>
<pre class="screen">
&lt;img src="%I" align="left"&gt;%L &lt;font color="#900000"&gt;%R&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&lt;b&gt;%T&amp;&lt;/b&gt;&lt;br&gt;%S&amp;nbsp;
&lt;font color="#808080"&gt;&lt;i&gt;%U&lt;/i&gt;&lt;/font&gt;
&lt;table bgcolor="#e0e0e0"&gt;
&lt;tr&gt;&lt;td&gt;&lt;div&gt;%A&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;%K
</pre>
<p>These samples, and some others are <a class=
"ulink" href="http://www.recoll.org/custom.html"
target="_top">on the web site, with pictures to show
how they look.</a></p>
<p>It is also possible to <a class="link" href=
"#RCL.SEARCH.GUI.CUSTOM.ABSSEP">define the value of
the snippet separator inside the abstract
section</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.SEARCH.KIO" id=
"RCL.SEARCH.KIO"></a>3.2.&nbsp;Searching with the KDE
KIO slave</h2>
</div>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.KIO.INTRO"
id="RCL.SEARCH.KIO.INTRO"></a>3.2.1.&nbsp;What's
this</h3>
</div>
</div>
</div>
<p>The <span class="application">Recoll</span> KIO slave
allows performing a <span class=
"application">Recoll</span> search by entering an
appropriate URL in a KDE open dialog, or with an
HTML-based interface displayed in <span class=
"command"><strong>Konqueror</strong></span>.</p>
<p>The HTML-based interface is similar to the Qt-based
interface, but slightly less powerful for now. Its
advantage is that you can perform your search while
staying fully within the KDE framework: drag and drop
from the result list works normally and you have your
normal choice of applications for opening files.</p>
<p>The alternative interface uses a directory view of
search results. Due to limitations in the current KIO
slave interface, it is currently not obviously useful (to
me).</p>
<p>The interface is described in more detail inside a
help file which you can access by entering <code class=
"filename">recoll:/</code> inside the <span class=
"command"><strong>konqueror</strong></span> URL line
(this works only if the recoll KIO slave has been
previously installed).</p>
<p>The instructions for building this module are located
in the source tree. See: <code class=
"filename">kde/kio/recoll/00README.txt</code>. Some Linux
distributions do package the kio-recoll module, so check
before diving into the build process, maybe it's already
out there ready for one-click installation.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.SEARCH.KIO.SEARCHABLEDOCS" id=
"RCL.SEARCH.KIO.SEARCHABLEDOCS"></a>3.2.2.&nbsp;Searchable
documents</h3>
</div>
</div>
</div>
<p>As a sample application, the <span class=
"application">Recoll</span> KIO slave could allow
preparing a set of HTML documents (for example a manual)
so that they become their own search interface inside
<span class=
"command"><strong>konqueror</strong></span>.</p>
<p>This can be done by either explicitly inserting
<code class="literal">&lt;a
href="recoll://..."&gt;</code> links around some document
areas, or automatically by adding a very small
<span class="application">javascript</span> program to
the documents, like the following example, which would
initiate a search by double-clicking any term:</p>
<pre class="programlisting">
&lt;script language="JavaScript"&gt;
function recollsearch() {
var t = document.getSelection();
window.location.href = 'recoll://search/query?qtp=a&amp;p=0&amp;q=' +
encodeURIComponent(t);
}
&lt;/script&gt;
....
&lt;body ondblclick="recollsearch()"&gt;
</pre>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.SEARCH.COMMANDLINE" id=
"RCL.SEARCH.COMMANDLINE"></a>3.3.&nbsp;Searching on
the command line</h2>
</div>
</div>
</div>
<p>There are several ways to obtain search results as a
text stream, without a graphical interface:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>By passing option <code class="option">-t</code>
to the <span class=
"command"><strong>recoll</strong></span> program, or
by calling it as <span class=
"command"><strong>recollq</strong></span> (through a
link).</p>
</li>
<li class="listitem">
<p>By using the <span class=
"command"><strong>recollq</strong></span>
program.</p>
</li>
<li class="listitem">
<p>By writing a custom <span class=
"application">Python</span> program, using the
<a class="link" href="#RCL.PROGRAM.PYTHONAPI" title=
"5.3.&nbsp;Python API">Recoll Python API</a>.</p>
</li>
</ul>
</div>
<p>The first two methods work in the same way and
accept/need the same arguments (except for the additional
<code class="option">-t</code> to <span class=
"command"><strong>recoll</strong></span>). The query to be
executed is specified as command line arguments.</p>
<p><span class="command"><strong>recollq</strong></span> is
not built by default. You can use the <code class=
"filename">Makefile</code> in the <code class=
"filename">query</code> directory to build it. This is a
very simple program, and if you can program a little c++,
you may find it useful to taylor its output format to your
needs. Not that recollq is only really useful on systems
where the Qt libraries (or even the X11 ones) are not
available. Otherwise, just use <code class="literal">recoll
-t</code>, which takes the exact same parameters and
options which are described for <span class=
"command"><strong>recollq</strong></span></p>
<p><span class="command"><strong>recollq</strong></span>
has a man page (not installed by default, look in the
<code class="filename">doc/man</code> directory). The Usage
string is as follows:</p>
<pre class="programlisting">
recollq: usage:
-P: Show the date span for all the documents present in the index
[-o|-a|-f] [-q] &lt;query string&gt;
Runs a recoll query and displays result lines.
Default: will interpret the argument(s) as a xesam query string
query may be like:
implicit AND, Exclusion, field spec: t1 -t2 title:t3
OR has priority: t1 OR t2 t3 OR t4 means (t1 OR t2) AND (t3 OR t4)
Phrase: "t1 t2" (needs additional quoting on cmd line)
-o Emulate the GUI simple search in ANY TERM mode
-a Emulate the GUI simple search in ALL TERMS mode
-f Emulate the GUI simple search in filename mode
-q is just ignored (compatibility with the recoll GUI command line)
Common options:
-c &lt;configdir&gt; : specify config directory, overriding $RECOLL_CONFDIR
-d also dump file contents
-n [first-]&lt;cnt&gt; define the result slice. The default value for [first]
is 0. Without the option, the default max count is 2000.
Use n=0 for no limit
-b : basic. Just output urls, no mime types or titles
-Q : no result lines, just the processed query and result count
-m : dump the whole document meta[] array for each result
-A : output the document abstracts
-S fld : sort by field &lt;fld&gt;
-s stemlang : set stemming language to use (must exist in index...)
Use -s "" to turn off stem expansion
-D : sort descending
-i &lt;dbdir&gt; : additional index, several can be given
-e use url encoding (%xx) for urls
-F &lt;field name list&gt; : output exactly these fields for each result.
The field values are encoded in base64, output in one line and
separated by one space character. This is the recommended format
for use by other programs. Use a normal query with option -m to
see the field names.
</pre>
<p>Sample execution:</p>
<pre class="programlisting">
recollq 'ilur -nautique mime:text/html'
Recoll query: ((((ilur:(wqf=11) OR ilurs) AND_NOT (nautique:(wqf=11)
OR nautiques OR nautiqu OR nautiquement)) FILTER Ttext/html))
4 results
text/html [file:///Users/uncrypted-dockes/projets/bateaux/ilur/comptes.html] [comptes.html] 18593 bytes
text/html [file:///Users/uncrypted-dockes/projets/nautique/webnautique/articles/ilur1/index.html] [Constructio...
text/html [file:///Users/uncrypted-dockes/projets/pagepers/index.html] [psxtcl/writemime/recoll]...
text/html [file:///Users/uncrypted-dockes/projets/bateaux/ilur/factEtCie/recu-chasse-maree....
</pre>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.SEARCH.SYNONYMS" id=
"RCL.SEARCH.SYNONYMS"></a>3.4.&nbsp;Using Synonyms
(1.22)</h2>
</div>
</div>
</div>
<p><b>Term synonyms:&nbsp;</b>there are a number of ways to
use term synonyms for searching text:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>At index creation time, they can be used to alter
the indexed terms, either increasing or decreasing
their number, by expanding the original terms to all
synonyms, or by reducing all synonym terms to a
canonical one.</p>
</li>
<li class="listitem">
<p>At query time, they can be used to match texts
containing terms which are synonyms of the ones
specified by the user, either by expanding the query
for all synonyms, or by reducing the user entry to
canonical terms (the latter only works if the
corresponding processing has been performed while
creating the index).</p>
</li>
</ul>
</div>
<p><span class="application">Recoll</span> only uses
synonyms at query time. A user query term which part of a
synonym group will be optionally expanded into an
<code class="literal">OR</code> query for all terms in the
group.</p>
<p>Synonym groups are defined inside ordinary text files.
Each line in the file defines a group.</p>
<p>Example:</p>
<pre class="programlisting">
hi hello "good morning"
# not sure about "au revoir" though. Is this english ?
bye goodbye "see you" \
"au revoir"
</pre>
<p>As usual, lines beginning with a <code class=
"literal">#</code> are comments, empty lines are ignored,
and lines can be continued by ending them with a
backslash.</p>
<p>Multi-word synonyms are supported, but be aware that
these will generate phrase queries, which may degrade
performance and will disable stemming expansion for the
phrase terms.</p>
<p>The synonyms file can be specified in the <span class=
"guilabel">Search parameters</span> tab of the <span class=
"guilabel">GUI configuration</span> <span class=
"guilabel">Preferences</span> menu entry, or as an option
for command-line searches.</p>
<p>Once the file is defined, the use of synonyms can be
enabled or disabled directly from the <span class=
"guilabel">Preferences</span> menu.</p>
<p>The synonyms are searched for matches with user terms
after the latter are stem-expanded, but the contents of the
synonyms file itself is not subjected to stem expansion.
This means that a match will not be found if the form
present in the synonyms file is not present anywhere in the
document set.</p>
<p>The synonyms function is probably not going to help you
find your letters to Mr. Smith. It is best used for
domain-specific searches. For example, it was initially
suggested by a user performing searches among historical
documents: the synonyms file would contains nicknames and
aliases for each of the persons of interest.</p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.SEARCH.PTRANS" id=
"RCL.SEARCH.PTRANS"></a>3.5.&nbsp;Path
translations</h2>
</div>
</div>
</div>
<p>In some cases, the document paths stored inside the
index do not match the actual ones, so that document
previews and accesses will fail. This can occur in a number
of circumstances:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>When using multiple indexes it is a relatively
common occurrence that some will actually reside on a
remote volume, for exemple mounted via NFS. In this
case, the paths used to access the documents on the
local machine are not necessarily the same than the
ones used while indexing on the remote machine. For
example, <code class="filename">/home/me</code> may
have been used as a <code class=
"literal">topdirs</code> elements while indexing, but
the directory might be mounted as <code class=
"filename">/net/server/home/me</code> on the local
machine.</p>
</li>
<li class="listitem">
<p>The case may also occur with removable disks. It
is perfectly possible to configure an index to live
with the documents on the removable disk, but it may
happen that the disk is not mounted at the same place
so that the documents paths from the index are
invalid.</p>
</li>
<li class="listitem">
<p>As a last exemple, one could imagine that a big
directory has been moved, but that it is currently
inconvenient to run the indexer.</p>
</li>
</ul>
</div>
<p><span class="application">Recoll</span> has a facility
for rewriting access paths when extracting the data from
the index. The translations can be defined for the main
index and for any additional query index.</p>
<p>The path translation facility will be useful whenever
the documents paths seen by the indexer are not the same as
the ones which should be used at query time.</p>
<p>In the above NFS example, <span class=
"application">Recoll</span> could be instructed to rewrite
any <code class="filename">file:///home/me</code> URL from
the index to <code class=
"filename">file:///net/server/home/me</code>, allowing
accesses from the client.</p>
<p>The translations are defined in the <a class="link"
href="#RCL.INSTALL.CONFIG.PTRANS" title=
"6.4.7.&nbsp;The ptrans file"><code class=
"filename">ptrans</code></a> configuration file, which can
be edited by hand or from the GUI external indexes
configuration dialog: <span class=
"guimenu">Preferences</span> ��� <span class=
"guimenuitem">External index dialog</span>, then click the
<span class="guilabel">Paths translations</span> button on
the right below the index list.</p>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>Due to a current bug, the GUI must be restarted after
changing the <code class="filename">ptrans</code> values
(even when they were changed from the GUI).</p>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.SEARCH.LANG" id=
"RCL.SEARCH.LANG"></a>3.6.&nbsp;The query
language</h2>
</div>
</div>
</div>
<p>The query language processor is activated in the GUI
simple search entry when the search mode selector is set to
<span class="guilabel">Query Language</span>. It can also
be used with the KIO slave or the command line search. It
broadly has the same capabilities as the complex search
interface in the GUI.</p>
<p>The language was based on the now defunct <a class=
"ulink" href=
"http://www.xesam.org/main/XesamUserSearchLanguage95"
target="_top">Xesam</a> user search language
specification.</p>
<p>If the results of a query language search puzzle you and
you doubt what has been actually searched for, you can use
the GUI <code class="literal">Show Query</code> link at the
top of the result list to check the exact query which was
finally executed by Xapian.</p>
<p>Here follows a sample request that we are going to
explain:</p>
<pre class="programlisting">
author:"john doe" Beatles OR Lennon Live OR Unplugged -potatoes
</pre>
<p>This would search for all documents with <em class=
"replaceable"><code>John Doe</code></em> appearing as a
phrase in the author field (exactly what this is would
depend on the document type, ie: the <code class=
"literal">From:</code> header, for an email message), and
containing either <em class=
"replaceable"><code>beatles</code></em> or <em class=
"replaceable"><code>lennon</code></em> and either
<em class="replaceable"><code>live</code></em> or
<em class="replaceable"><code>unplugged</code></em> but not
<em class="replaceable"><code>potatoes</code></em> (in any
part of the document).</p>
<p>An element is composed of an optional field
specification, and a value, separated by a colon (the field
separator is the last colon in the element). Examples:
<em class="replaceable"><code>Eugenie</code></em>,
<em class="replaceable"><code>author:balzac</code></em>,
<em class="replaceable"><code>dc:title:grandet</code></em>
<em class="replaceable"><code>dc:title:"eugenie
grandet"</code></em></p>
<p>The colon, if present, means "contains". Xesam defines
other relations, which are mostly unsupported for now
(except in special cases, described further down).</p>
<p>All elements in the search entry are normally combined
with an implicit AND. It is possible to specify that
elements be OR'ed instead, as in <em class=
"replaceable"><code>Beatles</code></em> <code class=
"literal">OR</code> <em class=
"replaceable"><code>Lennon</code></em>. The <code class=
"literal">OR</code> must be entered literally (capitals),
and it has priority over the AND associations: <em class=
"replaceable"><code>word1</code></em> <em class=
"replaceable"><code>word2</code></em> <code class=
"literal">OR</code> <em class=
"replaceable"><code>word3</code></em> means <em class=
"replaceable"><code>word1</code></em> AND (<em class=
"replaceable"><code>word2</code></em> <code class=
"literal">OR</code> <em class=
"replaceable"><code>word3</code></em>) not (<em class=
"replaceable"><code>word1</code></em> AND <em class=
"replaceable"><code>word2</code></em>) <code class=
"literal">OR</code> <em class=
"replaceable"><code>word3</code></em>.</p>
<p><span class="application">Recoll</span> versions 1.21
and later, allow using parentheses to group elements, which
will sometimes make things clearer, and may allow
expressing combinations which would have been difficult
otherwise.</p>
<p>An element preceded by a <code class="literal">-</code>
specifies a term that should <span class=
"emphasis"><em>not</em></span> appear.</p>
<p>As usual, words inside quotes define a phrase (the order
of words is significant), so that <em class=
"replaceable"><code>title:"prejudice pride"</code></em> is
not the same as <em class=
"replaceable"><code>title:prejudice
title:pride</code></em>, and is unlikely to find a
result.</p>
<p>Words inside phrases and capitalized words are not
stem-expanded. Wildcards may be used anywhere inside a
term. Specifying a wild-card on the left of a term can
produce a very slow search (or even an incorrect one if the
expansion is truncated because of excessive size). Also see
<a class="link" href="#RCL.SEARCH.WILDCARDS" title=
"3.8.1.&nbsp;More about wildcards">More about
wildcards</a>.</p>
<p>To save you some typing, recent <span class=
"application">Recoll</span> versions (1.20 and later)
interpret a comma-separated list of terms as an AND list
inside the field. Use slash characters ('/') for an OR
list. No white space is allowed. So</p>
<pre class="programlisting">author:john,lennon</pre>
<p>will search for documents with <code class=
"literal">john</code> and <code class=
"literal">lennon</code> inside the <code class=
"literal">author</code> field (in any order), and</p>
<pre class="programlisting">author:john/ringo</pre>
<p>would search for <code class="literal">john</code> or
<code class="literal">ringo</code>.</p>
<p>Modifiers can be set on a double-quote value, for
example to specify a proximity search (unordered). See
<a class="link" href="#RCL.SEARCH.LANG.MODIFIERS" title=
"3.6.2.&nbsp;Modifiers">the modifier section</a>. No space
must separate the final double-quote and the modifiers
value, e.g. <em class="replaceable"><code>"two
one"po10</code></em></p>
<p><span class="application">Recoll</span> currently
manages the following default fields:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p><code class="literal">title</code>, <code class=
"literal">subject</code> or <code class=
"literal">caption</code> are synonyms which specify
data to be searched for in the document title or
subject.</p>
</li>
<li class="listitem">
<p><code class="literal">author</code> or
<code class="literal">from</code> for searching the
documents originators.</p>
</li>
<li class="listitem">
<p><code class="literal">recipient</code> or
<code class="literal">to</code> for searching the
documents recipients.</p>
</li>
<li class="listitem">
<p><code class="literal">keyword</code> for searching
the document-specified keywords (few documents
actually have any).</p>
</li>
<li class="listitem">
<p><code class="literal">filename</code> for the
document's file name. This is not necessarily set for
all documents: internal documents contained inside a
compound one (for example an EPUB section) do not
inherit the container file name any more, this was
replaced by an explicit field (see next).
Sub-documents can still have a specific <code class=
"literal">filename</code>, if it is implied by the
document format, for example the attachment file name
for an email attachment.</p>
</li>
<li class="listitem">
<p><code class="literal">containerfilename</code>.
This is set for all documents, both top-level and
contained sub-documents, and is always the name of
the filesystem directory entry which contains the
data. The terms from this field can only be matched
by an explicit field specification (as opposed to
terms from <code class="literal">filename</code>
which are also indexed as general document content).
This avoids getting matches for all the sub-documents
when searching for the container file name.</p>
</li>
<li class="listitem">
<p><code class="literal">ext</code> specifies the
file name extension (Ex: <code class=
"literal">ext:html</code>)</p>
</li>
</ul>
</div>
<p><span class="application">Recoll</span> 1.20 and later
have a way to specify aliases for the field names, which
will save typing, for example by aliasing <code class=
"literal">filename</code> to <em class=
"replaceable"><code>fn</code></em> or <code class=
"literal">containerfilename</code> to <em class=
"replaceable"><code>cfn</code></em>. See the <a class=
"link" href="#RCL.INSTALL.CONFIG.FIELDS" title=
"6.4.3.&nbsp;The fields file">section about the
<code class="filename">fields</code> file</a></p>
<p>The document input handlers used while indexing have the
possibility to create other fields with arbitrary names,
and aliases may be defined in the configuration, so that
the exact field search possibilities may be different for
you if someone took care of the customisation.</p>
<p>The field syntax also supports a few field-like, but
special, criteria:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p><code class="literal">dir</code> for filtering the
results on file location (Ex: <code class=
"literal">dir:/home/me/somedir</code>). <code class=
"literal">-dir</code> also works to find results not
in the specified directory (release &gt;= 1.15.8).
Tilde expansion will be performed as usual (except
for a bug in versions 1.19 to 1.19.11p1). Wildcards
will be expanded, but please <a class="link" href=
"#RCL.SEARCH.WILDCARDS.PATH" title=
"3.8.1.1.&nbsp;Wildcards and path filtering">have a
look</a> at an important limitation of wildcards in
path filters.</p>
<p>Relative paths also make sense, for example,
<code class="literal">dir:share/doc</code> would
match either <code class=
"filename">/usr/share/doc</code> or <code class=
"filename">/usr/local/share/doc</code></p>
<p>Several <code class="literal">dir</code> clauses
can be specified, both positive and negative. For
example the following makes sense:</p>
<pre class="programlisting">
dir:recoll dir:src -dir:utils -dir:common
</pre>
<p>This would select results which have both
<code class="filename">recoll</code> and <code class=
"filename">src</code> in the path (in any order), and
which have not either <code class=
"filename">utils</code> or <code class=
"filename">common</code>.</p>
<p>You can also use <code class="literal">OR</code>
conjunctions with <code class="literal">dir:</code>
clauses.</p>
<p>A special aspect of <code class=
"literal">dir</code> clauses is that the values in
the index are not transcoded to UTF-8, and never
lower-cased or unaccented, but stored as binary. This
means that you need to enter the values in the exact
lower or upper case, and that searches for names with
diacritics may sometimes be impossible because of
character set conversion issues. Non-ASCII UNIX file
paths are an unending source of trouble and are best
avoided.</p>
<p>You need to use double-quotes around the path
value if it contains space characters.</p>
</li>
<li class="listitem">
<p><code class="literal">size</code> for filtering
the results on file size. Example: <code class=
"literal">size&lt;10000</code>. You can use
<code class="literal">&lt;</code>, <code class=
"literal">&gt;</code> or <code class=
"literal">=</code> as operators. You can specify a
range like the following: <code class=
"literal">size&gt;100 size&lt;1000</code>. The usual
<code class="literal">k/K, m/M, g/G, t/T</code> can
be used as (decimal) multipliers. Ex: <code class=
"literal">size&gt;1k</code> to search for files
bigger than 1000 bytes.</p>
</li>
<li class="listitem">
<p><code class="literal">date</code> for searching or
filtering on dates. The syntax for the argument is
based on the ISO8601 standard for dates and time
intervals. Only dates are supported, no times. The
general syntax is 2 elements separated by a
<code class="literal">/</code> character. Each
element can be a date or a period of time. Periods
are specified as <code class=
"literal">P</code><em class=
"replaceable"><code>n</code></em><code class=
"literal">Y</code><em class=
"replaceable"><code>n</code></em><code class=
"literal">M</code><em class=
"replaceable"><code>n</code></em><code class=
"literal">D</code>. The <em class=
"replaceable"><code>n</code></em> numbers are the
respective numbers of years, months or days, any of
which may be missing. Dates are specified as
<em class=
"replaceable"><code>YYYY</code></em>-<em class=
"replaceable"><code>MM</code></em>-<em class=
"replaceable"><code>DD</code></em>. The days and
months parts may be missing. If the <code class=
"literal">/</code> is present but an element is
missing, the missing element is interpreted as the
lowest or highest date in the index. Examples:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: circle;">
<li class="listitem">
<p><code class=
"literal">2001-03-01/2002-05-01</code> the
basic syntax for an interval of dates.</p>
</li>
<li class="listitem">
<p><code class=
"literal">2001-03-01/P1Y2M</code> the same
specified with a period.</p>
</li>
<li class="listitem">
<p><code class="literal">2001/</code> from the
beginning of 2001 to the latest date in the
index.</p>
</li>
<li class="listitem">
<p><code class="literal">2001</code> the whole
year of 2001</p>
</li>
<li class="listitem">
<p><code class="literal">P2D/</code> means 2
days ago up to now if there are no documents
with dates in the future.</p>
</li>
<li class="listitem">
<p><code class="literal">/2003</code> all
documents from 2003 or older.</p>
</li>
</ul>
</div>
<p>Periods can also be specified with small letters
(ie: p2y).</p>
</li>
<li class="listitem">
<p><code class="literal">mime</code> or <code class=
"literal">format</code> for specifying the MIME type.
These clauses are processed besides the normal
Boolean logic of the search. Multiple values will be
OR'ed (instead of the normal AND). You can specify
types to be excluded, with the usual <code class=
"literal">-</code>, and use wildcards. Example:
<em class="replaceable"><code>mime:text/*
-mime:text/plain</code></em> Specifying an explicit
boolean operator before a <code class=
"literal">mime</code> specification is not supported
and will produce strange results.</p>
</li>
<li class="listitem">
<p><code class="literal">type</code> or <code class=
"literal">rclcat</code> for specifying the category
(as in text/media/presentation/etc.). The
classification of MIME types in categories is defined
in the <span class="application">Recoll</span>
configuration (<code class=
"filename">mimeconf</code>), and can be modified or
extended. The default category names are those which
permit filtering results in the main GUI screen.
Categories are OR'ed like MIME types above, and can
be negated with <code class="literal">-</code>.</p>
</li>
</ul>
</div>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p><code class="literal">mime</code>, <code class=
"literal">rclcat</code>, <code class=
"literal">size</code> and <code class=
"literal">date</code> criteria always affect the whole
query (they are applied as a final filter), even if set
with other terms inside a parenthese.</p>
</div>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p><code class="literal">mime</code> (or the equivalent
<code class="literal">rclcat</code>) is the <span class=
"emphasis"><em>only</em></span> field with an
<code class="literal">OR</code> default. You do need to
use <code class="literal">OR</code> with <code class=
"literal">ext</code> terms for example.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.LANG.RANGES"
id="RCL.SEARCH.LANG.RANGES"></a>3.6.1.&nbsp;Range
clauses</h3>
</div>
</div>
</div>
<p><span class="application">Recoll</span> 1.24 and later
support range clauses on fields which have been
configured to support it. No default field uses them
currently, so this paragraph is only interesting if you
modified the fields configuration and possibly use a
custom input handler.</p>
<p>A range clause looks like one of the following:</p>
<pre class="programlisting"><em class=
"replaceable"><code>myfield</code></em>:<em class=
"replaceable"><code>small</code></em>..<em class=
"replaceable"><code>big</code></em>
<em class="replaceable"><code>myfield</code></em>:<em class=
"replaceable"><code>small</code></em>..
<em class="replaceable"><code>myfield</code></em>:..<em class=
"replaceable"><code>big</code></em>
</pre>
<p>The nature of the clause is indicated by the two dots
<code class="literal">..</code>, and the effect is to
filter the results for which the <em class=
"replaceable"><code>myfield</code></em> value is in the
possibly open-ended interval.</p>
<p>See the section about the <a class="link" href=
"#RCL.INSTALL.CONFIG.FIELDS" title=
"6.4.3.&nbsp;The fields file"><code class=
"filename">fields</code> configuration file</a> for the
details of configuring a field for range searches (list
them in the [values] section).</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.SEARCH.LANG.MODIFIERS" id=
"RCL.SEARCH.LANG.MODIFIERS"></a>3.6.2.&nbsp;Modifiers</h3>
</div>
</div>
</div>
<p>Some characters are recognized as search modifiers
when found immediately after the closing double quote of
a phrase, as in <code class="literal">"some
term"modifierchars</code>. The actual "phrase" can be a
single term of course. Supported modifiers:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><code class="literal">l</code> can be used to
turn off stemming (mostly makes sense with
<code class="literal">p</code> because stemming is
off by default for phrases).</p>
</li>
<li class="listitem">
<p><code class="literal">s</code> can be used to
turn off synonym expansion, if a synonyms file is
in place (only for <span class=
"application">Recoll</span> 1.22 and later).</p>
</li>
<li class="listitem">
<p><code class="literal">o</code> can be used to
specify a "slack" for phrase and proximity
searches: the number of additional terms that may
be found between the specified ones. If
<code class="literal">o</code> is followed by an
integer number, this is the slack, else the default
is 10.</p>
</li>
<li class="listitem">
<p><code class="literal">p</code> can be used to
turn the default phrase search into a proximity one
(unordered). Example: <code class="literal">"order
any in"p</code></p>
</li>
<li class="listitem">
<p><code class="literal">C</code> will turn on case
sensitivity (if the index supports it).</p>
</li>
<li class="listitem">
<p><code class="literal">D</code> will turn on
diacritics sensitivity (if the index supports
it).</p>
</li>
<li class="listitem">
<p>A weight can be specified for a query element by
specifying a decimal value at the start of the
modifiers. Example: <code class=
"literal">"Important"2.5</code>.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.SEARCH.CASEDIAC" id=
"RCL.SEARCH.CASEDIAC"></a>3.7.&nbsp;Search case and
diacritics sensitivity</h2>
</div>
</div>
</div>
<p>For <span class="application">Recoll</span> versions
1.18 and later, and <span class="emphasis"><em>when working
with a raw index</em></span> (not the default), searches
can be sensitive to character case and diacritics. How this
happens is controlled by configuration variables and what
search data is entered.</p>
<p>The general default is that searches entered without
upper-case or accented characters are insensitive to case
and diacritics. An entry of <code class=
"literal">resume</code> will match any of <code class=
"literal">Resume</code>, <code class=
"literal">RESUME</code>, <code class=
"literal">r��sum��</code>, <code class=
"literal">R��sum��</code> etc.</p>
<p>Two configuration variables can automate switching on
sensitivity (they were documented but actually did nothing
until <span class="application">Recoll</span> 1.22):</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">autodiacsens</span></dt>
<dd>
<p>If this is set, search sensitivity to diacritics
will be turned on as soon as an accented character
exists in a search term. When the variable is set to
true, <code class="literal">resume</code> will start
a diacritics-unsensitive search, but <code class=
"literal">r��sum��</code> will be matched exactly. The
default value is <span class=
"emphasis"><em>false</em></span>.</p>
</dd>
<dt><span class="term">autocasesens</span></dt>
<dd>
<p>If this is set, search sensitivity to character
case will be turned on as soon as an upper-case
character exists in a search term <span class=
"emphasis"><em>except for the first one</em></span>.
When the variable is set to true, <code class=
"literal">us</code> or <code class=
"literal">Us</code> will start a
diacritics-unsensitive search, but <code class=
"literal">US</code> will be matched exactly. The
default value is <span class=
"emphasis"><em>true</em></span> (contrary to
<code class="literal">autodiacsens</code>).</p>
</dd>
</dl>
</div>
<p>As in the past, capitalizing the first letter of a word
will turn off its stem expansion and have no effect on
case-sensitivity.</p>
<p>You can also explicitely activate case and diacritics
sensitivity by using modifiers with the query language.
<code class="literal">C</code> will make the term
case-sensitive, and <code class="literal">D</code> will
make it diacritics-sensitive. Examples:</p>
<pre class="programlisting">
"us"C
</pre>
<p>will search for the term <code class="literal">us</code>
exactly (<code class="literal">Us</code> will not be a
match).</p>
<pre class="programlisting">
"resume"D
</pre>
<p>will search for the term <code class=
"literal">resume</code> exactly (<code class=
"literal">r��sum��</code> will not be a match).</p>
<p>When either case or diacritics sensitivity is activated,
stem expansion is turned off. Having both does not make
much sense.</p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.SEARCH.ANCHORWILD" id=
"RCL.SEARCH.ANCHORWILD"></a>3.8.&nbsp;Anchored
searches and wildcards</h2>
</div>
</div>
</div>
<p>Some special characters are interpreted by <span class=
"application">Recoll</span> in search strings to expand or
specialize the search. Wildcards expand a root term in
controlled ways. Anchor characters can restrict a search to
succeed only if the match is found at or near the beginning
of the document or one of its fields.</p>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.WILDCARDS"
id="RCL.SEARCH.WILDCARDS"></a>3.8.1.&nbsp;More
about wildcards</h3>
</div>
</div>
</div>
<p>All words entered in <span class=
"application">Recoll</span> search fields will be
processed for wildcard expansion before the request is
finally executed.</p>
<p>The wildcard characters are:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><code class="literal">*</code> which matches 0
or more characters.</p>
</li>
<li class="listitem">
<p><code class="literal">?</code> which matches a
single character.</p>
</li>
<li class="listitem">
<p><code class="literal">[]</code> which allow
defining sets of characters to be matched (ex:
<code class="literal">[</code><strong class=
"userinput"><code>abc</code></strong><code class=
"literal">]</code> matches a single character which
may be 'a' or 'b' or 'c', <code class=
"literal">[</code><strong class=
"userinput"><code>0-9</code></strong><code class=
"literal">]</code> matches any number.</p>
</li>
</ul>
</div>
<p>You should be aware of a few things when using
wildcards.</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>Using a wildcard character at the beginning of a
word can make for a slow search because
<span class="application">Recoll</span> will have
to scan the whole index term list to find the
matches. However, this is much less a problem for
field searches, and queries like <em class=
"replaceable"><code>author:*@domain.com</code></em>
can sometimes be very useful.</p>
</li>
<li class="listitem">
<p>For <span class="application">Recoll</span>
version 18 only, when working with a raw index
(preserving character case and diacritics), the
literal part of a wildcard expression will be
matched exactly for case and diacritics. This is
not true any more for versions 19 and later.</p>
</li>
<li class="listitem">
<p>Using a <code class="literal">*</code> at the
end of a word can produce more matches than you
would think, and strange search results. You can
use the <a class="link" href=
"#RCL.SEARCH.GUI.TERMEXPLORER" title=
"3.1.9.&nbsp;The term explorer tool">term
explorer</a> tool to check what completions exist
for a given term. You can also see exactly what
search was performed by clicking on the link at the
top of the result list. In general, for natural
language terms, stem expansion will produce better
results than an ending <code class=
"literal">*</code> (stem expansion is turned off
when any wildcard character appears in the
term).</p>
</li>
</ul>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.SEARCH.WILDCARDS.PATH" id=
"RCL.SEARCH.WILDCARDS.PATH"></a>3.8.1.1.&nbsp;Wildcards
and path filtering</h4>
</div>
</div>
</div>
<p>Due to the way that <span class=
"application">Recoll</span> processes wildcards inside
<code class="literal">dir</code> path filtering
clauses, they will have a multiplicative effect on the
query size. A clause containg wildcards in several
paths elements, like, for example, <code class=
"literal">dir:</code><em class=
"replaceable"><code>/home/me/*/*/docdir</code></em>,
will almost certainly fail if your indexed tree is of
any realistic size.</p>
<p>Depending on the case, you may be able to work
around the issue by specifying the paths elements more
narrowly, with a constant prefix, or by using 2
separate <code class="literal">dir:</code> clauses
instead of multiple wildcards, as in <code class=
"literal">dir:</code><em class=
"replaceable"><code>/home/me</code></em> <code class=
"literal">dir:</code><em class=
"replaceable"><code>docdir</code></em>. The latter
query is not equivalent to the initial one because it
does not specify a number of directory levels, but
that's the best we can do (and it may be actually more
useful in some cases).</p>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.ANCHOR" id=
"RCL.SEARCH.ANCHOR"></a>3.8.2.&nbsp;Anchored
searches</h3>
</div>
</div>
</div>
<p>Two characters are used to specify that a search hit
should occur at the beginning or at the end of the text.
<code class="literal">^</code> at the beginning of a term
or phrase constrains the search to happen at the start,
<code class="literal">$</code> at the end force it to
happen at the end.</p>
<p>As this function is implemented as a phrase search it
is possible to specify a maximum distance at which the
hit should occur, either through the controls of the
advanced search panel, or using the query language, for
example, as in:</p>
<pre class="programlisting">"^someterm"o10</pre>
<p>which would force <code class=
"literal">someterm</code> to be found within 10 terms of
the start of the text. This can be combined with a field
search as in <code class=
"literal">somefield:"^someterm"o10</code> or <code class=
"literal">somefield:someterm$</code>.</p>
<p>This feature can also be used with an actual phrase
search, but in this case, the distance applies to the
whole phrase and anchor, so that, for example,
<code class="literal">bla bla my unexpected term</code>
at the beginning of the text would be a match for
<code class="literal">"^my term"o5</code>.</p>
<p>Anchored searches can be very useful for searches
inside somewhat structured documents like scientific
articles, in case explicit metadata has not been supplied
(a most frequent case), for example for looking for
matches inside the abstract or the list of authors (which
occur at the top of the document).</p>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.SEARCH.DESKTOP" id=
"RCL.SEARCH.DESKTOP"></a>3.9.&nbsp;Desktop
integration</h2>
</div>
</div>
</div>
<p>Being independant of the desktop type has its drawbacks:
<span class="application">Recoll</span> desktop integration
is minimal. However there are a few tools available:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>The <span class="application">KDE</span> KIO Slave
was described in a <a class="link" href=
"#RCL.SEARCH.KIO" title=
"3.2.&nbsp;Searching with the KDE KIO slave">previous
section</a>.</p>
</li>
<li class="listitem">
<p>If you use a recent version of Ubuntu Linux, you
may find the <a class="ulink" href=
"https://www.lesbonscomptes.com/recoll/faqsandhowtos/UnityLens"
target="_top">Ubuntu Unity Lens</a> module
useful.</p>
</li>
<li class="listitem">
<p>There is also an independantly developed <a class=
"ulink" href=
"http://kde-apps.org/content/show.php/recollrunner?content=128203"
target="_top">Krunner plugin</a>.</p>
</li>
</ul>
</div>
<p>Here follow a few other things that may help.</p>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.SEARCH.SHORTCUT" id=
"RCL.SEARCH.SHORTCUT"></a>3.9.1.&nbsp;Hotkeying
recoll</h3>
</div>
</div>
</div>
<p>It is surprisingly convenient to be able to show or
hide the <span class="application">Recoll</span> GUI with
a single keystroke. Recoll comes with a small Python
script, based on the <span class=
"application">libwnck</span> window manager interface
library, which will allow you to do just this. The
detailed instructions are on <a class="ulink" href=
"https://www.lesbonscomptes.com/recoll/faqsandhowtos/HotRecoll"
target="_top">this wiki page</a>.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="RCL.KICKER-APPLET" id=
"RCL.KICKER-APPLET"></a>3.9.2.&nbsp;The KDE Kicker
Recoll applet</h3>
</div>
</div>
</div>
<p>This is probably obsolete now. Anyway:</p>
<p>The <span class="application">Recoll</span> source
tree contains the source code to the <span class=
"application">recoll_applet</span>, a small application
derived from the <span class=
"application">find_applet</span>. This can be used to add
a small <span class="application">Recoll</span> launcher
to the KDE panel.</p>
<p>The applet is not automatically built with the main
<span class="application">Recoll</span> programs, nor is
it included with the main source distribution (because
the KDE build boilerplate makes it relatively big). You
can download its source from the recoll.org download
page. Use the omnipotent <strong class=
"userinput"><code>configure;make;make
install</code></strong> incantation to build and
install.</p>
<p>You can then add the applet to the panel by
right-clicking the panel and choosing the <span class=
"guilabel">Add applet</span> entry.</p>
<p>The <span class="application">recoll_applet</span> has
a small text window where you can type a <span class=
"application">Recoll</span> query (in query language
form), and an icon which can be used to restrict the
search to certain types of files. It is quite primitive,
and launches a new recoll GUI instance every time (even
if it is already running). You may find it useful
anyway.</p>
</div>
</div>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="RCL.MOVABLE" id=
"RCL.MOVABLE"></a>Chapter&nbsp;4.&nbsp;Movable
datasets</h1>
</div>
</div>
</div>
<p>As of <span class="application">Recoll</span> 1.24, it has
become easy to build self-contained datasets including a
<span class="application">Recoll</span> configuration
directory and index together with the indexed documents, and
to move such a dataset around (for example copying it to an
USB drive), without having to adjust the configuration for
querying the index.</p>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>This is a query-time feature only. The index must only
be updated in its original location. If an update is
necessary in a different location, the index must be
reset.</p>
</div>
<p>To make a long story short, here follows a script to
create a <span class="application">Recoll</span>
configuration and index under a given directory (given as
single parameter). The resulting data set (files + recoll
directory) can later to be moved to a CDROM or thumb drive.
Longer explanations come after the script.</p>
<pre class="programlisting">#!/bin/sh
fatal()
{
echo $*;exit 1
}
usage()
{
fatal "Usage: init-recoll-volume.sh &lt;top-directory&gt;"
}
test $# = 1 || usage
topdir=$1
test -d "$topdir" || fatal $topdir should be a directory
confdir="$topdir/recoll-config"
test ! -d "$confdir" || fatal $confdir should not exist
mkdir "$confdir"
cd "$topdir"
topdir=`pwd`
cd "$confdir"
confdir=`pwd`
(echo topdirs = '"'$topdir'"'; \
echo orgidxconfdir = $topdir/recoll-config) &gt; "$confdir/recoll.conf"
recollindex -c "$confdir"
</pre>
<p>The examples below will assume that you have a dataset
under <code class="filename">/home/me/mydata/</code>, with
the index configuration and data stored inside <code class=
"filename">/home/me/mydata/recoll-confdir</code>.</p>
<p>In order to be able to run queries after the dataset has
been moved, you must ensure the following:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>The main configuration file must define the
<a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.ORGIDXCONFDIR">orgidxconfdir</a>
variable to be the original location of the
configuration directory (<code class=
"filename">orgidxconfdir=/home/me/mydata/recoll-confdir</code>
must be set inside <code class=
"filename">/home/me/mydata/recoll-confdir/recoll.conf</code>
in the example above).</p>
</li>
<li class="listitem">
<p>The configuration directory must exist with the
documents, somewhere under the directory which will be
moved. E.g. if you are moving <code class=
"filename">/home/me/mydata</code> around, the
configuration directory must exist somewhere below this
point, for example <code class=
"filename">/home/me/mydata/recoll-confdir</code>, or
<code class=
"filename">/home/me/mydata/sub/recoll-confdir</code>.</p>
</li>
<li class="listitem">
<p>You should keep the default locations for the index
elements (they are relative to the configuration
directory by default). Only the paths referring to the
documents themselves (e.g. <code class=
"literal">topdirs</code> values) should be absolute (in
general, they are only used when indexing anyway).</p>
</li>
</ul>
</div>
<p>Only the first point needs an explicit user action, the
<span class="application">Recoll</span> defaults are
compatible with the second one, and the third is natural.</p>
<p>If, after the move, the configuration directory needs to
be copied out of the dataset (for example because the thumb
drive is too slow), you can set the <a class="link" href=
"#RCL.INSTALL.CONFIG.RECOLLCONF.CURIDXCONFDIR">curidxconfdir</a>,
variable inside the copied configuration to define the
location of the moved one. For example if <code class=
"filename">/home/me/mydata</code> is now mounted onto
<code class="filename">/media/me/somelabel</code>, but the
configuration directory and index has been copied to
<code class="filename">/tmp/tempconfig</code>, you would set
<code class="literal">curidxconfdir</code> to <code class=
"filename">/media/me/somelabel/recoll-confdir</code> inside
<code class="filename">/tmp/tempconfig/recoll.conf</code>.
<code class="literal">orgidxconfdir</code> would still be
<code class="filename">/home/me/mydata/recoll-confdir</code>
in the original and the copy.</p>
<p>If you are regularly copying the configuration out of the
dataset, it will be useful to write a script to automate the
procedure. This can't really be done inside <span class=
"application">Recoll</span> because there are probably many
possible variants. One example would be to copy the
configuration to make it writable, but keep the index data on
the medium because it is too big - in this case, the script
would also need to set <code class="literal">dbdir</code> in
the copied configuration.</p>
<p>The same set of modifications (<span class=
"application">Recoll</span> 1.24) has also made it possible
to run queries from a readonly configuration directory (with
slightly reduced function of course, such as not recording
the query history).</p>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="RCL.PROGRAM" id=
"RCL.PROGRAM"></a>Chapter&nbsp;5.&nbsp;Programming
interface</h1>
</div>
</div>
</div>
<p><span class="application">Recoll</span> has an Application
Programming Interface, usable both for indexing and
searching, currently accessible from the <span class=
"application">Python</span> language.</p>
<p>Another less radical way to extend the application is to
write input handlers for new types of documents.</p>
<p>The processing of metadata attributes for documents
(<code class="literal">fields</code>) is highly
configurable.</p>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.PROGRAM.FILTERS" id=
"RCL.PROGRAM.FILTERS"></a>5.1.&nbsp;Writing a
document input handler</h2>
</div>
</div>
</div>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Terminology</h3>
<p>The small programs or pieces of code which handle the
processing of the different document types for
<span class="application">Recoll</span> used to be called
<code class="literal">filters</code>, which is still
reflected in the name of the directory which holds them
and many configuration variables. They were named this
way because one of their primary functions is to filter
out the formatting directives and keep the text content.
However these modules may have other behaviours, and the
term <code class="literal">input handler</code> is now
progressively substituted in the documentation.
<code class="literal">filter</code> is still used in many
places though.</p>
</div>
<p><span class="application">Recoll</span> input handlers
cooperate to translate from the multitude of input document
formats, simple ones as <span class=
"application">opendocument</span>, <span class=
"application">acrobat</span>), or compound ones such as
<span class="application">Zip</span> or <span class=
"application">Email</span>, into the final <span class=
"application">Recoll</span> indexing input format, which is
plain text. Most input handlers are executable programs or
scripts. A few handlers are coded in C++ and live inside
<span class="command"><strong>recollindex</strong></span>.
This latter kind will not be described here.</p>
<p>There are currently (since version 1.13) two kinds of
external executable input handlers:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>Simple <code class="literal">exec</code> handlers
run once and exit. They can be bare programs like
<span class=
"command"><strong>antiword</strong></span>, or
scripts using other programs. They are very simple to
write, because they just need to print the converted
document to the standard output. Their output can be
plain text or HTML. HTML is usually preferred because
it can store metadata fields and it allows preserving
some of the formatting for the GUI preview.</p>
</li>
<li class="listitem">
<p>Multiple <code class="literal">execm</code>
handlers can process multiple files (sparing the
process startup time which can be very significant),
or multiple documents per file (e.g.: for
<span class="application">zip</span> or <span class=
"application">chm</span> files). They communicate
with the indexer through a simple protocol, but are
nevertheless a bit more complicated than the older
kind. Most of new handlers are written in
<span class="application">Python</span>, using a
common module to handle the protocol. There is an
exception, <span class=
"command"><strong>rclimg</strong></span> which is
written in Perl. The subdocuments output by these
handlers can be directly indexable (text or HTML), or
they can be other simple or compound documents that
will need to be processed by another handler.</p>
</li>
</ul>
</div>
<p>In both cases, handlers deal with regular file system
files, and can process either a single document, or a
linear list of documents in each file. <span class=
"application">Recoll</span> is responsible for performing
up to date checks, deal with more complex embedding and
other upper level issues.</p>
<p>A simple handler returning a document in <code class=
"literal">text/plain</code> format, can transfer no
metadata to the indexer. Generic metadata, like document
size or modification date, will be gathered and stored by
the indexer.</p>
<p>Handlers that produce <code class=
"literal">text/html</code> format can return an arbitrary
amount of metadata inside HTML <code class=
"literal">meta</code> tags. These will be processed
according to the directives found in the <a class="link"
href="#RCL.PROGRAM.FIELDS" title=
"5.2.&nbsp;Field data processing"><code class=
"filename">fields</code> configuration file</a>.</p>
<p>The handlers that can handle multiple documents per file
return a single piece of data to identify each document
inside the file. This piece of data, called an <code class=
"literal">ipath element</code> will be sent back by
<span class="application">Recoll</span> to extract the
document at query time, for previewing, or for creating a
temporary file to be opened by a viewer.</p>
<p>The following section describes the simple handlers, and
the next one gives a few explanations about the
<code class="literal">execm</code> ones. You could
conceivably write a simple handler with only the elements
in the manual. This will not be the case for the other
ones, for which you will have to look at the code.</p>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.FILTERS.SIMPLE" id=
"RCL.PROGRAM.FILTERS.SIMPLE"></a>5.1.1.&nbsp;Simple
input handlers</h3>
</div>
</div>
</div>
<p><span class="application">Recoll</span> simple
handlers are usually shell-scripts, but this is in no way
necessary. Extracting the text from the native format is
the difficult part. Outputting the format expected by
<span class="application">Recoll</span> is trivial.
Happily enough, most document formats have translators or
text extractors which can be called from the handler. In
some cases the output of the translating program is
completely appropriate, and no intermediate shell-script
is needed.</p>
<p>Input handlers are called with a single argument which
is the source file name. They should output the result to
stdout.</p>
<p>When writing a handler, you should decide if it will
output plain text or HTML. Plain text is simpler, but you
will not be able to add metadata or vary the output
character encoding (this will be defined in a
configuration file). Additionally, some formatting may be
easier to preserve when previewing HTML. Actually the
deciding factor is metadata: <span class=
"application">Recoll</span> has a way to <a class="link"
href="#RCL.PROGRAM.FILTERS.HTML" title=
"5.1.4.&nbsp;Input handler output">extract metadata from
the HTML header and use it for field searches.</a>.</p>
<p>The <code class=
"envar">RECOLL_FILTER_FORPREVIEW</code> environment
variable (values <code class="literal">yes</code>,
<code class="literal">no</code>) tells the handler if the
operation is for indexing or previewing. Some handlers
use this to output a slightly different format, for
example stripping uninteresting repeated keywords (ie:
<code class="literal">Subject:</code> for email) when
indexing. This is not essential.</p>
<p>You should look at one of the simple handlers, for
example <span class=
"command"><strong>rclps</strong></span> for a starting
point.</p>
<p>Don't forget to make your handler executable before
testing !</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.FILTERS.MULTIPLE" id=
"RCL.PROGRAM.FILTERS.MULTIPLE"></a>5.1.2.&nbsp;"Multiple"
handlers</h3>
</div>
</div>
</div>
<p>If you can program and want to write an <code class=
"literal">execm</code> handler, it should not be too
difficult to make sense of one of the existing modules.
There is a sample one with many comments, not actually
used by <span class="application">Recoll</span>, which
would index a text file as one document per line. Look
for <code class="filename">rcltxtlines.py</code> in the
<code class="filename">src/filters</code> directory in
the <span class="application">Recoll</span> <a class=
"ulink" href="https://bitbucket.org/medoc/recoll/src"
target="_top">BitBucket repository</a> (the sample not in
the distributed release at the moment).</p>
<p>You can also have a look at the slightly more complex
<span class="command"><strong>rclzip</strong></span>
which uses Zip file paths as identifiers (<code class=
"literal">ipath</code>).</p>
<p><code class="literal">execm</code> handlers sometimes
need to make a choice for the nature of the <code class=
"literal">ipath</code> elements that they use in
communication with the indexer. Here are a few
guidelines:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>Use ASCII or UTF-8 (if the identifier is an
integer print it, for example, like printf %d would
do).</p>
</li>
<li class="listitem">
<p>If at all possible, the data should make some
kind of sense when printed to a log file to help
with debugging.</p>
</li>
<li class="listitem">
<p><span class="application">Recoll</span> uses a
colon (<code class="literal">:</code>) as a
separator to store a complex path internally (for
deeper embedding). Colons inside the <code class=
"literal">ipath</code> elements output by a handler
will be escaped, but would be a bad choice as a
handler-specific separator (mostly, again, for
debugging issues).</p>
</li>
</ul>
</div>
<p>In any case, the main goal is that it should be easy
for the handler to extract the target document, given the
file name and the <code class="literal">ipath</code>
element.</p>
<p><code class="literal">execm</code> handlers will also
produce a document with a null <code class=
"literal">ipath</code> element. Depending on the type of
document, this may have some associated data (e.g. the
body of an email message), or none (typical for an
archive file). If it is empty, this document will be
useful anyway for some operations, as the parent of the
actual data documents.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.FILTERS.ASSOCIATION" id=
"RCL.PROGRAM.FILTERS.ASSOCIATION"></a>5.1.3.&nbsp;Telling
<span class="application">Recoll</span> about the
handler</h3>
</div>
</div>
</div>
<p>There are two elements that link a file to the handler
which should process it: the association of file to MIME
type and the association of a MIME type with a
handler.</p>
<p>The association of files to MIME types is mostly based
on name suffixes. The types are defined inside the
<a class="link" href="#RCL.INSTALL.CONFIG.MIMEMAP" title=
"6.4.4.&nbsp;The mimemap file"><code class=
"filename">mimemap</code> file</a>. Example:</p>
<pre class="programlisting">
.doc = application/msword
</pre>
<p>If no suffix association is found for the file name,
<span class="application">Recoll</span> will try to
execute a system command (typically <span class=
"command"><strong>file -i</strong></span> or <span class=
"command"><strong>xdg-mime</strong></span>) to determine
a MIME type.</p>
<p>The second element is the association of MIME types to
handlers in the <a class="link" href=
"#RCL.INSTALL.CONFIG.MIMECONF" title=
"6.4.5.&nbsp;The mimeconf file"><code class=
"filename">mimeconf</code> file</a>. A sample will
probably be better than a long explanation:</p>
<pre class="programlisting">
[index]
application/msword = exec antiword -t -i 1 -m UTF-8;\
mimetype = text/plain ; charset=utf-8
application/ogg = exec rclogg
text/rtf = exec unrtf --nopict --html; charset=iso-8859-1; mimetype=text/html
application/x-chm = execm rclchm
</pre>
<p>The fragment specifies that:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><code class="literal">application/msword</code>
files are processed by executing the <span class=
"command"><strong>antiword</strong></span> program,
which outputs <code class=
"literal">text/plain</code> encoded in <code class=
"literal">utf-8</code>.</p>
</li>
<li class="listitem">
<p><code class="literal">application/ogg</code>
files are processed by the <span class=
"command"><strong>rclogg</strong></span> script,
with default output type (<code class=
"literal">text/html</code>, with encoding specified
in the header, or <code class=
"literal">utf-8</code> by default).</p>
</li>
<li class="listitem">
<p><code class="literal">text/rtf</code> is
processed by <span class=
"command"><strong>unrtf</strong></span>, which
outputs <code class="literal">text/html</code>. The
<code class="literal">iso-8859-1</code> encoding is
specified because it is not the <code class=
"literal">utf-8</code> default, and not output by
<span class="command"><strong>unrtf</strong></span>
in the HTML header section.</p>
</li>
<li class="listitem">
<p><code class="literal">application/x-chm</code>
is processed by a persistant handler. This is
determined by the <code class=
"literal">execm</code> keyword.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.FILTERS.HTML" id=
"RCL.PROGRAM.FILTERS.HTML"></a>5.1.4.&nbsp;Input
handler output</h3>
</div>
</div>
</div>
<p>Both the simple and persistent input handlers can
return any MIME type to Recoll, which will further
process the data according to the MIME configuration.</p>
<p>Most input filters filters produce either <code class=
"literal">text/plain</code> or <code class=
"literal">text/html</code> data. There are exceptions,
for example, filters which process archive file
(<code class="literal">zip</code>, <code class=
"literal">tar</code>, etc.) will usually return the
documents as they are found, without processing them
further.</p>
<p>There is nothing to say about <code class=
"literal">text/plain</code> output, except that its
character encoding should be consistent with what is
specified in the <code class="filename">mimeconf</code>
file.</p>
<p>For filters producing HTML, the output could be very
minimal like the following example:</p>
<pre class="programlisting">
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html;charset=UTF-8"&gt;
&lt;/head&gt;
&lt;body&gt;
Some text content
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>You should take care to escape some characters inside
the text by transforming them into appropriate entities.
At the very minimum, "<code class="literal">&amp;</code>"
should be transformed into "<code class=
"literal">&amp;amp;</code>", "<code class=
"literal">&lt;</code>" should be transformed into
"<code class="literal">&amp;lt;</code>". This is not
always properly done by external helper programs which
output HTML, and of course never by those which output
plain text.</p>
<p>When encapsulating plain text in an HTML body, the
display of a preview may be improved by enclosing the
text inside <code class="literal">&lt;pre&gt;</code>
tags.</p>
<p>The character set needs to be specified in the header.
It does not need to be UTF-8 (<span class=
"application">Recoll</span> will take care of translating
it), but it must be accurate for good results.</p>
<p><span class="application">Recoll</span> will process
<code class="literal">meta</code> tags inside the header
as possible document fields candidates. Documents fields
can be processed by the indexer in different ways, for
searching or displaying inside query results. This is
described in a <a class="link" href="#RCL.PROGRAM.FIELDS"
title="5.2.&nbsp;Field data processing">following
section.</a></p>
<p>By default, the indexer will process the standard
header fields if they are present: <code class=
"literal">title</code>, <code class=
"literal">meta/description</code>, and <code class=
"literal">meta/keywords</code> are both indexed and
stored for query-time display.</p>
<p>A predefined non-standard <code class=
"literal">meta</code> tag will also be processed by
<span class="application">Recoll</span> without further
configuration: if a <code class="literal">date</code> tag
is present and has the right format, it will be used as
the document date (for display and sorting), in
preference to the file modification date. The date format
should be as follows:</p>
<pre class="programlisting">
&lt;meta name="date" content="YYYY-mm-dd HH:MM:SS"&gt;
or
&lt;meta name="date" content="YYYY-mm-ddTHH:MM:SS"&gt;
</pre>
<p>Example:</p>
<pre class="programlisting">
&lt;meta name="date" content="2013-02-24 17:50:00"&gt;
</pre>
<p>Input handlers also have the possibility to "invent"
field names. This should also be output as meta tags:</p>
<pre class="programlisting">
&lt;meta name="somefield" content="Some textual data" /&gt;
</pre>
<p>You can embed HTML markup inside the content of custom
fields, for improving the display inside result lists. In
this case, add a (wildly non-standard) <code class=
"literal">markup</code> attribute to tell <span class=
"application">Recoll</span> that the value is HTML and
should not be escaped for display.</p>
<pre class="programlisting">
&lt;meta name="somefield" markup="html" content="Some &lt;i&gt;textual&lt;/i&gt; data" /&gt;
</pre>
<p>As written above, the processing of fields is
described in a <a class="link" href="#RCL.PROGRAM.FIELDS"
title="5.2.&nbsp;Field data processing">further
section</a>.</p>
<p>Persistent filters can use another, probably simpler,
method to produce metadata, by calling the <code class=
"literal">setfield()</code> helper method. This avoids
the necessity to produce HTML, and any issue with HTML
quoting. See, for example, <code class=
"filename">rclaudio</code> in <span class=
"application">Recoll</span> 1.23 and later for an example
of handler which outputs <code class=
"literal">text/plain</code> and uses <code class=
"literal">setfield()</code> to produce metadata.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.FILTERS.PAGES" id=
"RCL.PROGRAM.FILTERS.PAGES"></a>5.1.5.&nbsp;Page
numbers</h3>
</div>
</div>
</div>
<p>The indexer will interpret <code class=
"literal">^L</code> characters in the handler output as
indicating page breaks, and will record them. At query
time, this allows starting a viewer on the right page for
a hit or a snippet. Currently, only the PDF, Postscript
and DVI handlers generate page breaks.</p>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.PROGRAM.FIELDS" id=
"RCL.PROGRAM.FIELDS"></a>5.2.&nbsp;Field data
processing</h2>
</div>
</div>
</div>
<p><code class="literal">Fields</code> are named pieces of
information in or about documents, like <code class=
"literal">title</code>, <code class=
"literal">author</code>, <code class=
"literal">abstract</code>.</p>
<p>The field values for documents can appear in several
ways during indexing: either output by input handlers as
<code class="literal">meta</code> fields in the HTML header
section, or extracted from file extended attributes, or
added as attributes of the <code class="literal">Doc</code>
object when using the API, or again synthetized internally
by <span class="application">Recoll</span>.</p>
<p>The <span class="application">Recoll</span> query
language allows searching for text in a specific field.</p>
<p><span class="application">Recoll</span> defines a number
of default fields. Additional ones can be output by
handlers, and described in the <code class=
"filename">fields</code> configuration file.</p>
<p>Fields can be:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p><code class="literal">indexed</code>, meaning that
their terms are separately stored in inverted lists
(with a specific prefix), and that a field-specific
search is possible.</p>
</li>
<li class="listitem">
<p><code class="literal">stored</code>, meaning that
their value is recorded in the index data record for
the document, and can be returned and displayed with
search results.</p>
</li>
</ul>
</div>
<p>A field can be either or both indexed and stored. This
and other aspects of fields handling is defined inside the
<code class="filename">fields</code> configuration
file.</p>
<p>Some fields may also designated as supporting range
queries, meaning that the results may be selected for an
interval of its values. See the <a class="link" href=
"#RCL.INSTALL.CONFIG.FIELDS" title=
"6.4.3.&nbsp;The fields file">configuration section</a> for
more details.</p>
<p>The sequence of events for field processing is as
follows:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>During indexing, <span class=
"command"><strong>recollindex</strong></span> scans
all <code class="literal">meta</code> fields in HTML
documents (most document types are transformed into
HTML at some point). It compares the name for each
element to the configuration defining what should be
done with fields (the <code class=
"filename">fields</code> file)</p>
</li>
<li class="listitem">
<p>If the name for the <code class=
"literal">meta</code> element matches one for a field
that should be indexed, the contents are processed
and the terms are entered into the index with the
prefix defined in the <code class=
"filename">fields</code> file.</p>
</li>
<li class="listitem">
<p>If the name for the <code class=
"literal">meta</code> element matches one for a field
that should be stored, the content of the element is
stored with the document data record, from which it
can be extracted and displayed at query time.</p>
</li>
<li class="listitem">
<p>At query time, if a field search is performed, the
index prefix is computed and the match is only
performed against appropriately prefixed terms in the
index.</p>
</li>
<li class="listitem">
<p>At query time, the field can be displayed inside
the result list by using the appropriate directive in
the definition of the <a class="link" href=
"#RCL.SEARCH.GUI.CUSTOM.RESLIST" title=
"3.1.15.1.&nbsp;The result list format">result list
paragraph format</a>. All fields are displayed on the
fields screen of the preview window (which you can
reach through the right-click menu). This is
independant of the fact that the search which
produced the results used the field or not.</p>
</li>
</ul>
</div>
<p>You can find more information in the <a class="link"
href="#RCL.INSTALL.CONFIG.FIELDS" title=
"6.4.3.&nbsp;The fields file">section about the
<code class="filename">fields</code> file</a>, or in
comments inside the file.</p>
<p>You can also have a look at the <a class="ulink" href=
"https://www.lesbonscomptes.com/recoll/faqsandhowtos/HandleCustomField"
target="_top">example in the FAQs area</a>, detailing how
one could add a <span class="emphasis"><em>page
count</em></span> field to pdf documents for displaying
inside result lists.</p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.PROGRAM.PYTHONAPI" id=
"RCL.PROGRAM.PYTHONAPI"></a>5.3.&nbsp;Python API</h2>
</div>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.INTRO" id=
"RCL.PROGRAM.PYTHONAPI.INTRO"></a>5.3.1.&nbsp;Introduction</h3>
</div>
</div>
</div>
<p><span class="application">Recoll</span> versions after
1.11 define a Python programming interface, both for
searching and creating/updating an index.</p>
<p>The search interface is used in the <span class=
"application">Recoll</span> Ubuntu Unity Lens and the
<span class="application">Recoll</span> Web UI. It can
run queries on any <span class=
"application">Recoll</span> configuration.</p>
<p>The index update section of the API may be used to
create and update <span class="application">Recoll</span>
indexes on specific configurations (separate from the
ones created by <span class=
"command"><strong>recollindex</strong></span>). The
resulting databases can be queried alone, or in
conjunction with regular ones, through the GUI or any of
the query interfaces.</p>
<p>The search API is modeled along the Python database
API specification. There were two major changes along
<span class="application">Recoll</span> versions:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>The basis for the <span class=
"application">Recoll</span> API changed from Python
database API version 1.0 (<span class=
"application">Recoll</span> versions up to 1.18.1),
to version 2.0 (<span class=
"application">Recoll</span> 1.18.2 and later).</p>
</li>
<li class="listitem">
<p>The <code class="literal">recoll</code> module
became a package (with an internal <code class=
"literal">recoll</code> module) as of <span class=
"application">Recoll</span> version 1.19, in order
to add more functions. For existing code, this only
changes the way the interface must be imported.</p>
</li>
</ul>
</div>
<p>We will describe the new API and package structure
here. A paragraph at the end of this section will explain
a few differences and ways to write code compatible with
both versions.</p>
<p>There is a good chance that your system repository has
packages for the Recoll Python API, sometimes in a
package separate from the main one (maybe named something
like python-recoll). Else refer to the <a class="link"
href="#RCL.INSTALL.BUILDING" title=
"6.3.&nbsp;Building from source">Building from source
chapter</a>.</p>
<p>As an introduction, the following small sample will
run a query and list the title and url for each of the
results. It would work with <span class=
"application">Recoll</span> 1.19 and later. The
<code class="filename">python/samples</code> source
directory contains several examples of Python programming
with <span class="application">Recoll</span>, exercising
the extension more completely, and especially its data
extraction features.</p>
<pre class="programlisting">
#!/usr/bin/env python
from recoll import recoll
db = recoll.connect()
query = db.query()
nres = query.execute("some query")
results = query.fetchmany(20)
for doc in results:
print(doc.url, doc.title)
</pre>
<p>You can also take a look at the source for the
<a class="ulink" href=
"https://github.com/koniu/recoll-webui" target=
"_top">Recoll WebUI</a>, or the <a class="ulink" href=
"https://opensourceprojects.eu/p/upmpdcli/code/ci/c8c8e75bd181ad9db2df14da05934e53ca867a06/tree/src/mediaserver/cdplugins/uprcl/uprclfolders.py"
target="_top">upmpdcli local media server</a>, which are
both based on the Python API.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.ELEMENTS" id=
"RCL.PROGRAM.PYTHONAPI.ELEMENTS"></a>5.3.2.&nbsp;Interface
elements</h3>
</div>
</div>
</div>
<p>A few elements in the interface are specific and and
need an explanation.</p>
<div class="variablelist">
<dl class="variablelist">
<dt><a name="RCL.PROGRAM.PYTHONAPI.ELEMENTS.IPATH"
id="RCL.PROGRAM.PYTHONAPI.ELEMENTS.IPATH"></a><span class="term">ipath</span></dt>
<dd>
<p>This data value (set as a field in the Doc
object) is stored, along with the URL, but not
indexed by <span class="application">Recoll</span>.
Its contents are not interpreted by the index
layer, and its use is up to the application. For
example, the <span class=
"application">Recoll</span> file system indexer
uses the <code class="literal">ipath</code> to
store the part of the document access path internal
to (possibly imbricated) container documents.
<code class="literal">ipath</code> in this case is
a vector of access elements (e.g, the first part
could be a path inside a zip file to an archive
member which happens to be an mbox file, the second
element would be the message sequential number
inside the mbox etc.). <code class=
"literal">url</code> and <code class=
"literal">ipath</code> are returned in every search
result and define the access to the original
document. <code class="literal">ipath</code> is
empty for top-level document/files (e.g. a PDF
document which is a filesystem file). The
<span class="application">Recoll</span> GUI knows
about the structure of the <code class=
"literal">ipath</code> values used by the
filesystem indexer, and uses it for such functions
as opening the parent of a given document.</p>
</dd>
<dt><a name="RCL.PROGRAM.PYTHONAPI.ELEMENTS.UDI" id=
"RCL.PROGRAM.PYTHONAPI.ELEMENTS.UDI"></a><span class=
"term">udi</span></dt>
<dd>
<p>An <code class="literal">udi</code> (unique
document identifier) identifies a document. Because
of limitations inside the index engine, it is
restricted in length (to 200 bytes), which is why a
regular URI cannot be used. The structure and
contents of the <code class="literal">udi</code> is
defined by the application and opaque to the index
engine. For example, the internal file system
indexer uses the complete document path (file path
+ internal path), truncated to length, the
suppressed part being replaced by a hash value. The
<code class="literal">udi</code> is not explicit in
the query interface (it is used "under the hood" by
the <code class="filename">rclextract</code>
module), but it is an explicit element of the
update interface.</p>
</dd>
<dt><a name=
"RCL.PROGRAM.PYTHONAPI.ELEMENTS.PARENTUDI" id=
"RCL.PROGRAM.PYTHONAPI.ELEMENTS.PARENTUDI"></a><span class="term">parent_udi</span></dt>
<dd>
<p>If this attribute is set on a document when
entering it in the index, it designates its
physical container document. In a multilevel
hierarchy, this may not be the immediate parent.
<code class="literal">parent_udi</code> is
optional, but its use by an indexer may simplify
index maintenance, as <span class=
"application">Recoll</span> will automatically
delete all children defined by <code class=
"literal">parent_udi == udi</code> when the
document designated by <code class=
"literal">udi</code> is destroyed. e.g. if a
<code class="literal">Zip</code> archive contains
entries which are themselves containers, like
<code class="literal">mbox</code> files, all the
subdocuments inside the <code class=
"literal">Zip</code> file (mbox, messages, message
attachments, etc.) would have the same <code class=
"literal">parent_udi</code>, matching the
<code class="literal">udi</code> for the
<code class="literal">Zip</code> file, and all
would be destroyed when the <code class=
"literal">Zip</code> file (identified by its
<code class="literal">udi</code>) is removed from
the index. The standard filesystem indexer uses
<code class="literal">parent_udi</code>.</p>
</dd>
<dt><span class="term">Stored and indexed
fields</span></dt>
<dd>
<p>The <code class="filename">fields</code> file
inside the <span class="application">Recoll</span>
configuration defines which document fields are
either "indexed" (searchable), "stored"
(retrievable with search results), or both.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.SEARCH" id=
"RCL.PROGRAM.PYTHONAPI.SEARCH"></a>5.3.3.&nbsp;Python
search interface</h3>
</div>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.PACKAGE" id=
"RCL.PROGRAM.PYTHONAPI.PACKAGE"></a>5.3.3.1.&nbsp;Recoll
package</h4>
</div>
</div>
</div>
<p>The <code class="literal">recoll</code> package
contains two modules:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>The <code class="literal">recoll</code> module
contains functions and classes used to query (or
update) the index. This section will only
describe the query part, see further for the
update part.</p>
</li>
<li class="listitem">
<p>The <code class="literal">rclextract</code>
module contains functions and classes used to
access document data.</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RECOLL" id=
"RCL.PROGRAM.PYTHONAPI.RECOLL"></a>5.3.3.2.&nbsp;The
recoll module</h4>
</div>
</div>
</div>
<div class="sect4">
<div class="titlepage">
<div>
<div>
<h5 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RECOLL.FUNCTIONS" id=
"RCL.PROGRAM.PYTHONAPI.RECOLL.FUNCTIONS"></a>Functions</h5>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">connect(confdir=None,
extra_dbs=None, writable = False)</span></dt>
<dd>
<p>The <code class="literal">connect()</code>
function connects to one or several
<span class="application">Recoll</span>
index(es) and returns a <code class=
"literal">Db</code> object.</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><code class="literal">confdir</code>
may specify a configuration directory.
The usual defaults apply.</p>
</li>
<li class="listitem">
<p><code class="literal">extra_dbs</code>
is a list of additional indexes (Xapian
directories).</p>
</li>
<li class="listitem">
<p><code class="literal">writable</code>
decides if we can index new data through
this connection.</p>
</li>
</ul>
</div>
<p>This call initializes the recoll module, and
it should always be performed before any other
call or object creation.</p>
</dd>
</dl>
</div>
</div>
<div class="sect4">
<div class="titlepage">
<div>
<div>
<h5 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES" id=
"RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES"></a>Classes</h5>
</div>
</div>
</div>
<div class="sect5">
<div class="titlepage">
<div>
<div>
<h6 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES.DB" id=
"RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES.DB"></a>The
Db class</h6>
</div>
</div>
</div>
<p>A Db object is created by a <code class=
"literal">connect()</code> call and holds a
connection to a Recoll index.</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">Db.close()</span></dt>
<dd>
<p>Closes the connection. You can't do
anything with the <code class=
"literal">Db</code> object after this.</p>
</dd>
<dt><span class="term">Db.query(),
Db.cursor()</span></dt>
<dd>
<p>These aliases return a blank <code class=
"literal">Query</code> object for this
index.</p>
</dd>
<dt><span class=
"term">Db.setAbstractParams(maxchars,
contextwords)</span></dt>
<dd>
<p>Set the parameters used to build snippets
(sets of keywords in context text fragments).
<code class="literal">maxchars</code> defines
the maximum total size of the abstract.
<code class="literal">contextwords</code>
defines how many terms are shown around the
keyword.</p>
</dd>
<dt><span class="term">Db.termMatch(match_type,
expr, field='', maxlen=-1, casesens=False,
diacsens=False, lang='english')</span></dt>
<dd>
<p>Expand an expression against the index
term list. Performs the basic function from
the GUI term explorer tool. <code class=
"literal">match_type</code> can be either of
<code class="literal">wildcard</code>,
<code class="literal">regexp</code> or
<code class="literal">stem</code>. Returns a
list of terms expanded from the input
expression.</p>
</dd>
</dl>
</div>
</div>
<div class="sect5">
<div class="titlepage">
<div>
<div>
<h6 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES.QUERY"
id=
"RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES.QUERY"></a>The
Query class</h6>
</div>
</div>
</div>
<p>A <code class="literal">Query</code> object
(equivalent to a cursor in the Python DB API) is
created by a <code class=
"literal">Db.query()</code> call. It is used to
execute index searches.</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">Query.sortby(fieldname,
ascending=True)</span></dt>
<dd>
<p>Sort results by <em class=
"replaceable"><code>fieldname</code></em>, in
ascending or descending order. Must be called
before executing the search.</p>
</dd>
<dt><span class=
"term">Query.execute(query_string, stemming=1,
stemlang="english",
fetchtext=False)</span></dt>
<dd>
<p>Starts a search for <em class=
"replaceable"><code>query_string</code></em>,
a <span class="application">Recoll</span>
search language string. If the index stores
the document texts and <code class=
"literal">fetchtext</code> is True, store the
document extracted text in <code class=
"literal">doc.text</code>.</p>
</dd>
<dt><span class=
"term">Query.executesd(SearchData,
fetchtext=False)</span></dt>
<dd>
<p>Starts a search for the query defined by
the SearchData object. If the index stores
the document texts and <code class=
"literal">fetchtext</code> is True, store the
document extracted text in <code class=
"literal">doc.text</code>.</p>
</dd>
<dt><span class=
"term">Query.fetchmany(size=query.arraysize)</span></dt>
<dd>
<p>Fetches the next <code class=
"literal">Doc</code> objects in the current
search results, and returns them as an array
of the required size, which is by default the
value of the <code class=
"literal">arraysize</code> data member.</p>
</dd>
<dt><span class=
"term">Query.fetchone()</span></dt>
<dd>
<p>Fetches the next <code class=
"literal">Doc</code> object from the current
search results. Generates a StopIteration
exception if there are no results left.</p>
</dd>
<dt><span class=
"term">Query.close()</span></dt>
<dd>
<p>Closes the query. The object is unusable
after the call.</p>
</dd>
<dt><span class="term">Query.scroll(value,
mode='relative')</span></dt>
<dd>
<p>Adjusts the position in the current result
set. <code class="literal">mode</code> can be
<code class="literal">relative</code> or
<code class="literal">absolute</code>.</p>
</dd>
<dt><span class=
"term">Query.getgroups()</span></dt>
<dd>
<p>Retrieves the expanded query terms as a
list of pairs. Meaningful only after
executexx In each pair, the first entry is a
list of user terms (of size one for simple
terms, or more for group and phrase clauses),
the second a list of query terms as derived
from the user terms and used in the Xapian
Query.</p>
</dd>
<dt><span class=
"term">Query.getxquery()</span></dt>
<dd>
<p>Return the Xapian query description as a
Unicode string. Meaningful only after
executexx.</p>
</dd>
<dt><span class="term">Query.highlight(text,
ishtml = 0, methods = object)</span></dt>
<dd>
<p>Will insert &lt;span "class=rclmatch"&gt;,
&lt;/span&gt; tags around the match areas in
the input text and return the modified text.
<code class="literal">ishtml</code> can be
set to indicate that the input text is HTML
and that HTML special characters should not
be escaped. <code class=
"literal">methods</code> if set should be an
object with methods startMatch(i) and
endMatch() which will be called for each
match and should return a begin and end
tag</p>
</dd>
<dt><span class=
"term">Query.makedocabstract(doc, methods =
object))</span></dt>
<dd>
<p>Create a snippets abstract for
<code class="literal">doc</code> (a
<code class="literal">Doc</code> object) by
selecting text around the match terms. If
methods is set, will also perform
highlighting. See the highlight method.</p>
</dd>
<dt><span class="term">Query.__iter__() and
Query.next()</span></dt>
<dd>
<p>So that things like <code class=
"literal">for doc in query:</code> will
work.</p>
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><span class=
"term">Query.arraysize</span></dt>
<dd>
<p>Default number of records processed by
fetchmany (r/w).</p>
</dd>
<dt><span class=
"term">Query.rowcount</span></dt>
<dd>
<p>Number of records returned by the last
execute.</p>
</dd>
<dt><span class=
"term">Query.rownumber</span></dt>
<dd>
<p>Next index to be fetched from results.
Normally increments after each fetchone()
call, but can be set/reset before the call to
effect seeking (equivalent to using
<code class="literal">scroll()</code>).
Starts at 0.</p>
</dd>
</dl>
</div>
</div>
<div class="sect5">
<div class="titlepage">
<div>
<div>
<h6 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES.DOC"
id="RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES.DOC">
</a>The Doc class</h6>
</div>
</div>
</div>
<p>A <code class="literal">Doc</code> object
contains index data for a given document. The data
is extracted from the index when searching, or set
by the indexer program when updating. The Doc
object has many attributes to be read or set by its
user. It matches exactly the Rcl::Doc C++ object.
Some of the attributes are predefined, but,
especially when indexing, others can be set, the
name of which will be processed as field names by
the indexing configuration. Inputs can be specified
as Unicode or strings. Outputs are Unicode objects.
All dates are specified as Unix timestamps, printed
as strings. Please refer to the <code class=
"filename">rcldb/rcldoc.h</code> C++ file for a
description of the predefined attributes.</p>
<p>At query time, only the fields that are defined
as <code class="literal">stored</code> either by
default or in the <code class=
"filename">fields</code> configuration file will be
meaningful in the <code class="literal">Doc</code>
object. Especially this will not be the case for
the document text. See the <code class=
"literal">rclextract</code> module for accessing
document contents.</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">get(key), []
operator</span></dt>
<dd>
<p>Retrieve the named doc attribute. You can
also use <code class="literal">getattr(doc,
key)</code> or <code class=
"literal">doc.key</code>.</p>
</dd>
<dt><span class="term">doc.key =
value</span></dt>
<dd>
<p>Set the the named doc attribute. You can
also use <code class="literal">setattr(doc,
key, value)</code>.</p>
</dd>
<dt><span class="term">getbinurl()</span></dt>
<dd>
<p>Retrieve the URL in byte array format (no
transcoding), for use as parameter to a
system call.</p>
</dd>
<dt><span class=
"term">setbinurl(url)</span></dt>
<dd>
<p>Set the URL in byte array format (no
transcoding).</p>
</dd>
<dt><span class="term">items()</span></dt>
<dd>
<p>Return a dictionary of doc object
keys/values</p>
</dd>
<dt><span class="term">keys()</span></dt>
<dd>
<p>list of doc object keys (attribute
names).</p>
</dd>
</dl>
</div>
</div>
<div class="sect5">
<div class="titlepage">
<div>
<div>
<h6 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES.SEARCHDATA"
id=
"RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES.SEARCHDATA">
</a>The SearchData class</h6>
</div>
</div>
</div>
<p>A <code class="literal">SearchData</code> object
allows building a query by combining clauses, for
execution by <code class=
"literal">Query.executesd()</code>. It can be used
in replacement of the query language approach. The
interface is going to change a little, so no
detailed doc for now...</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class=
"term">addclause(type='and'|'or'|'excl'|'phrase'|'near'|'sub',
qstring=string, slack=0, field='', stemming=1,
subSearch=SearchData)</span></dt>
<dd></dd>
</dl>
</div>
</div>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RCLEXTRACT" id=
"RCL.PROGRAM.PYTHONAPI.RCLEXTRACT"></a>5.3.3.3.&nbsp;The
rclextract module</h4>
</div>
</div>
</div>
<p>Index queries do not provide document content (only
a partial and unprecise reconstruction is performed to
show the snippets text). In order to access the actual
document data, the data extraction part of the indexing
process must be performed (subdocument access and
format translation). This is not trivial in the case of
embedded documents. The <code class=
"literal">rclextract</code> module provides a single
class which can be used to access the data content for
result documents.</p>
<div class="sect4">
<div class="titlepage">
<div>
<div>
<h5 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RCLEXTRACT.CLASSES" id=
"RCL.PROGRAM.PYTHONAPI.RCLEXTRACT.CLASSES"></a>Classes</h5>
</div>
</div>
</div>
<div class="sect5">
<div class="titlepage">
<div>
<div>
<h6 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.RCLEXTRACT.CLASSES.EXTRACTOR"
id=
"RCL.PROGRAM.PYTHONAPI.RCLEXTRACT.CLASSES.EXTRACTOR">
</a>The Extractor class</h6>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><span class=
"term">Extractor(doc)</span></dt>
<dd>
<p>An <code class="literal">Extractor</code>
object is built from a <code class=
"literal">Doc</code> object, output from a
query.</p>
</dd>
<dt><span class=
"term">Extractor.textextract(ipath)</span></dt>
<dd>
<p>Extract document defined by <em class=
"replaceable"><code>ipath</code></em> and
return a <code class="literal">Doc</code>
object. The <code class=
"literal">doc.text</code> field has the
document text converted to either text/plain
or text/html according to <code class=
"literal">doc.mimetype</code>. The typical
use would be as follows:</p>
<pre class="programlisting">
qdoc = query.fetchone()
extractor = recoll.Extractor(qdoc)
doc = extractor.textextract(qdoc.ipath)
# use doc.text, e.g. for previewing</pre>
<p>Passing <code class=
"literal">qdoc.ipath</code> to <code class=
"literal">textextract()</code> is redundant,
but reflects the fact that the <code class=
"literal">Extractor</code> object actually
has the capability to access the other
entries in a compound document.</p>
</dd>
<dt><span class=
"term">Extractor.idoctofile(ipath, targetmtype,
outfile='')</span></dt>
<dd>
<p>Extracts document into an output file,
which can be given explicitly or will be
created as a temporary file to be deleted by
the caller. Typical use:</p>
<pre class="programlisting">
qdoc = query.fetchone()
extractor = recoll.Extractor(qdoc)
filename = extractor.idoctofile(qdoc.ipath, qdoc.mimetype)</pre>
<p>In all cases the output is a copy, even if
the requested document is a regular system
file, which may be wasteful in some cases. If
you want to avoid this, you can test for a
simple file document as follows:</p>
<pre class="programlisting">
not doc.ipath and (not "rclbes" in doc.keys() or doc["rclbes"] == "FS")
</pre>
</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.SEARCH.EXAMPLE" id=
"RCL.PROGRAM.PYTHONAPI.SEARCH.EXAMPLE"></a>5.3.3.4.&nbsp;Search
API usage example</h4>
</div>
</div>
</div>
<p>The following sample would query the index with a
user language string. See the <code class=
"filename">python/samples</code> directory inside the
<span class="application">Recoll</span> source for
other examples. The <code class=
"filename">recollgui</code> subdirectory has a very
embryonic GUI which demonstrates the highlighting and
data extraction functions.</p>
<pre class="programlisting">
#!/usr/bin/env python
from recoll import recoll
db = recoll.connect()
db.setAbstractParams(maxchars=80, contextwords=4)
query = db.query()
nres = query.execute("some user question")
print "Result count: ", nres
if nres &gt; 5:
nres = 5
for i in range(nres):
doc = query.fetchone()
print "Result #%d" % (query.rownumber,)
for k in ("title", "size"):
print k, ":", getattr(doc, k).encode('utf-8')
abs = db.makeDocAbstract(doc, query).encode('utf-8')
print abs
print
</pre>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.UPDATE" id=
"RCL.PROGRAM.PYTHONAPI.UPDATE"></a>5.3.4.&nbsp;Creating
Python external indexers</h3>
</div>
</div>
</div>
<p>The update API can be used to create an index from
data which is not accessible to the regular <span class=
"application">Recoll</span> indexer, or structured to
present difficulties to the <span class=
"application">Recoll</span> input handlers.</p>
<p>An indexer created using this API will be have
equivalent work to do as the the Recoll file system
indexer: look for modified documents, extract their text,
call the API for indexing it, take care of purging the
index out of data from documents which do not exist in
the document store any more.</p>
<p>The data for such an external indexer should be stored
in an index separate from any used by the <span class=
"application">Recoll</span> internal file system indexer.
The reason is that the main document indexer purge pass
(removal of deleted documents) would also remove all the
documents belonging to the external indexer, as they were
not seen during the filesystem walk. The main indexer
documents would also probably be a problem for the
external indexer own purge operation.</p>
<p>While there would be ways to enable multiple foreign
indexers to cooperate on a single index, it is just
simpler to use separate ones, and use the multiple index
access capabilities of the query interface, if
needed.</p>
<p>There are two parts in the update interface:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>Methods inside the <code class=
"filename">recoll</code> module allow inserting
data into the index, to make it accessible by the
normal query interface.</p>
</li>
<li class="listitem">
<p>An interface based on scripts execution is
defined to allow either the GUI or the <code class=
"filename">rclextract</code> module to access
original document data for previewing or
editing.</p>
</li>
</ul>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.UPDATE.UPDATE" id=
"RCL.PROGRAM.PYTHONAPI.UPDATE.UPDATE"></a>5.3.4.1.&nbsp;Python
update interface</h4>
</div>
</div>
</div>
<p>The update methods are part of the <code class=
"filename">recoll</code> module described above. The
connect() method is used with a <code class=
"literal">writable=true</code> parameter to obtain a
writable <code class="literal">Db</code> object. The
following <code class="literal">Db</code> object
methods are then available.</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">addOrUpdate(udi, doc,
parent_udi=None)</span></dt>
<dd>
<p>Add or update index data for a given document
The <code class="literal"><a class="link" href=
"#RCL.PROGRAM.PYTHONAPI.ELEMENTS.UDI">udi</a></code>
string must define a unique id for the document.
It is an opaque interface element and not
interpreted inside Recoll. <code class=
"literal">doc</code> is a <code class=
"literal"><a class="link" href=
"#RCL.PROGRAM.PYTHONAPI.RECOLL.CLASSES.DOC"
title="The Doc class">Doc</a></code> object,
created from the data to be indexed (the main
text should be in <code class=
"literal">doc.text</code>). If <code class=
"literal"><a class="link" href=
"#RCL.PROGRAM.PYTHONAPI.ELEMENTS.PARENTUDI">parent_udi</a></code>
is set, this is a unique identifier for the
top-level container (e.g. for the filesystem
indexer, this would be the one which is an actual
file).</p>
</dd>
<dt><span class="term">delete(udi)</span></dt>
<dd>
<p>Purge index from all data for <code class=
"literal">udi</code>, and all documents (if any)
which have a matrching <code class=
"literal">parent_udi</code>.</p>
</dd>
<dt><span class="term">needUpdate(udi,
sig)</span></dt>
<dd>
<p>Test if the index needs to be updated for the
document identified by <code class=
"literal">udi</code>. If this call is to be used,
the <code class="literal">doc.sig</code> field
should contain a signature value when calling
<code class="literal">addOrUpdate()</code>. The
<code class="literal">needUpdate()</code> call
then compares its parameter value with the stored
<code class="literal">sig</code> for <code class=
"literal">udi</code>. <code class=
"literal">sig</code> is an opaque value, compared
as a string.</p>
<p>The filesystem indexer uses a concatenation of
the decimal string values for file size and
update time, but a hash of the contents could
also be used.</p>
<p>As a side effect, if the return value is false
(the index is up to date), the call will set the
existence flag for the document (and any
subdocument defined by its <code class=
"literal">parent_udi</code>), so that a later
<code class="literal">purge()</code> call will
preserve them).</p>
<p>The use of <code class=
"literal">needUpdate()</code> and <code class=
"literal">purge()</code> is optional, and the
indexer may use another method for checking the
need to reindex or to delete stale entries.</p>
</dd>
<dt><span class="term">purge()</span></dt>
<dd>
<p>Delete all documents that were not touched
during the just finished indexing pass (since
open-for-write). These are the documents for the
needUpdate() call was not performed, indicating
that they no longer exist in the primary storage
system.</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.UPDATE.ACCESS" id=
"RCL.PROGRAM.PYTHONAPI.UPDATE.ACCESS"></a>5.3.4.2.&nbsp;Query
data access for external indexers (1.23)</h4>
</div>
</div>
</div>
<p><span class="application">Recoll</span> has internal
methods to access document data for its internal
(filesystem) indexer. An external indexer needs to
provide data access methods if it needs integration
with the GUI (e.g. preview function), or support for
the <code class="filename">rclextract</code>
module.</p>
<p>The index data and the access method are linked by
the <code class="literal">rclbes</code> (recoll backend
storage) <code class="literal">Doc</code> field. You
should set this to a short string value identifying
your indexer (e.g. the filesystem indexer uses either
"FS" or an empty value, the Web history indexer uses
"BGL").</p>
<p>The link is actually performed inside a <code class=
"filename">backends</code> configuration file (stored
in the configuration directory). This defines commands
to execute to access data from the specified indexer.
Example, for the mbox indexing sample found in the
Recoll source (which sets <code class=
"literal">rclbes="MBOX"</code>):</p>
<pre class="programlisting">[MBOX]
fetch = /path/to/recoll/src/python/samples/rclmbox.py fetch
makesig = path/to/recoll/src/python/samples/rclmbox.py makesig
</pre>
<p><code class="literal">fetch</code> and <code class=
"literal">makesig</code> define two commands to execute
to respectively retrieve the document text and compute
the document signature (the example implementation uses
the same script with different first parameters to
perform both operations).</p>
<p>The scripts are called with three additional
arguments: <code class="literal">udi</code>,
<code class="literal">url</code>, <code class=
"literal">ipath</code>, stored with the document when
it was indexed, and may use any or all to perform the
requested operation. The caller expects the result data
on <code class="literal">stdout</code>.</p>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.UPDATE.SAMPLES" id=
"RCL.PROGRAM.PYTHONAPI.UPDATE.SAMPLES"></a>5.3.4.3.&nbsp;External
indexer samples</h4>
</div>
</div>
</div>
<p>The Recoll source tree has two samples of external
indexers in the <code class=
"filename">src/python/samples</code> directory. The
more interesting one is <code class=
"filename">rclmbox.py</code> which indexes a directory
containing <code class="literal">mbox</code> folder
files. It exercises most features in the update
interface, and has a data access interface.</p>
<p>See the comments inside the file for more
information.</p>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.PROGRAM.PYTHONAPI.COMPAT" id=
"RCL.PROGRAM.PYTHONAPI.COMPAT"></a>5.3.5.&nbsp;Package
compatibility with the previous version</h3>
</div>
</div>
</div>
<p>The following code fragments can be used to ensure
that code can run with both the old and the new API (as
long as it does not use the new abilities of the new API
of course).</p>
<p>Adapting to the new package structure:</p>
<pre class="programlisting">
try:
from recoll import recoll
from recoll import rclextract
hasextract = True
except:
import recoll
hasextract = False
</pre>
<p>Adapting to the change of nature of the <code class=
"literal">next</code> <code class="literal">Query</code>
member. The same test can be used to choose to use the
<code class="literal">scroll()</code> method (new) or set
the <code class="literal">next</code> value (old).</p>
<pre class="programlisting">
rownum = query.next if type(query.next) == int else \
query.rownumber
</pre>
</div>
</div>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="RCL.INSTALL" id=
"RCL.INSTALL"></a>Chapter&nbsp;6.&nbsp;Installation and
configuration</h1>
</div>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INSTALL.BINARY" id=
"RCL.INSTALL.BINARY"></a>6.1.&nbsp;Installing a
binary copy</h2>
</div>
</div>
</div>
<p><span class="application">Recoll</span> binary copies
are always distributed as regular packages for your system.
They can be obtained either through the system's normal
software distribution framework (e.g. <span class=
"application">Debian/Ubuntu apt</span>, <span class=
"application">FreeBSD</span> ports, etc.), or from some
type of "backports" repository providing versions newer
than the standard ones, or found on the <span class=
"application">Recoll</span> WEB site in some cases. The
most up-to-date information about Recoll packages can
usually be found on the <a class="ulink" href=
"http://www.recoll.org/download.html" target=
"_top"><span class="application">Recoll</span> WEB site
downloads page</a></p>
<p>There used to exist another form of binary install, as
pre-compiled source trees, but these are just less
convenient than the packages and don't exist any more.</p>
<p>The package management tools will usually automatically
deal with hard dependancies for packages obtained from a
proper package repository. You will have to deal with them
by hand for downloaded packages (for example, when
<span class="command"><strong>dpkg</strong></span>
complains about missing dependancies).</p>
<p>In all cases, you will have to check or install
<a class="link" href="#RCL.INSTALL.EXTERNAL" title=
"6.2.&nbsp;Supporting packages">supporting applications</a>
for the file types that you want to index beyond those that
are natively processed by <span class=
"application">Recoll</span> (text, HTML, email files, and a
few others).</p>
<p>You should also maybe have a look at the <a class="link"
href="#RCL.INSTALL.CONFIG" title=
"6.4.&nbsp;Configuration overview">configuration
section</a> (but this may not be necessary for a quick test
with default parameters). Most parameters can be more
conveniently set from the GUI interface.</p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INSTALL.EXTERNAL" id=
"RCL.INSTALL.EXTERNAL"></a>6.2.&nbsp;Supporting
packages</h2>
</div>
</div>
</div>
<div class="note" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>The <span class="application">Windows</span>
installation of <span class="application">Recoll</span>
is self-contained, and only needs Python 2.7 to be
externally installed. <span class=
"application">Windows</span> users can skip this
section.</p>
</div>
<p><span class="application">Recoll</span> uses external
applications to index some file types. You need to install
them for the file types that you wish to have indexed
(these are run-time optional dependencies. None is needed
for building or running <span class=
"application">Recoll</span> except for indexing their
specific file type).</p>
<p>After an indexing pass, the commands that were found
missing can be displayed from the <span class=
"command"><strong>recoll</strong></span> <span class=
"guilabel">File</span> menu. The list is stored in the
<code class="filename">missing</code> text file inside the
configuration directory.</p>
<p>A list of common file types which need external commands
follows. Many of the handlers need the <span class=
"command"><strong>iconv</strong></span> command, which is
not always listed as a dependancy.</p>
<p>Please note that, due to the relatively dynamic nature
of this information, the most up to date version is now
kept on <a class="ulink" href=
"http://www.recoll.org/features.html#doctypes" target=
"_top">http://www.recoll.org/features.html</a> along with
links to the home pages or best source/patches pages, and
misc tips. The list below is not updated often and may be
quite stale.</p>
<p>For many Linux distributions, most of the commands
listed can be installed from the package repositories.
However, the packages are sometimes outdated, or not the
best version for <span class="application">Recoll</span>,
so you should take a look at <a class="ulink" href=
"http://www.recoll.org/features.html#doctypes" target=
"_top">http://www.recoll.org/features.html</a> if a file
type is important to you.</p>
<p>As of <span class="application">Recoll</span> release
1.14, a number of XML-based formats that were handled by ad
hoc handler code now use the <span class=
"command"><strong>xsltproc</strong></span> command, which
usually comes with <span class=
"application">libxslt</span>. These are: abiword, fb2
(ebooks), kword, openoffice, svg.</p>
<p>Now for the list:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>Openoffice files need <span class=
"command"><strong>unzip</strong></span> and
<span class=
"command"><strong>xsltproc</strong></span>.</p>
</li>
<li class="listitem">
<p>PDF files need <span class=
"command"><strong>pdftotext</strong></span> which is
part of <span class="application">Poppler</span>
(usually comes with the <code class=
"literal">poppler-utils</code> package). Avoid the
original one from <span class=
"application">Xpdf</span>.</p>
</li>
<li class="listitem">
<p>Postscript files need <span class=
"command"><strong>pstotext</strong></span>. The
original version has an issue with shell character in
file names, which is corrected in recent packages.
See <a class="ulink" href=
"http://www.recoll.org/features.html#doctypes"
target="_top">http://www.recoll.org/features.html</a>
for more detail.</p>
</li>
<li class="listitem">
<p>MS Word needs <span class=
"command"><strong>antiword</strong></span>. It is
also useful to have <span class=
"command"><strong>wvWare</strong></span> installed as
it may be be used as a fallback for some files which
<span class=
"command"><strong>antiword</strong></span> does not
handle.</p>
</li>
<li class="listitem">
<p>MS Excel and PowerPoint are processed by internal
<span class="command"><strong>Python</strong></span>
handlers.</p>
</li>
<li class="listitem">
<p>MS Open XML (docx) needs <span class=
"command"><strong>xsltproc</strong></span>.</p>
</li>
<li class="listitem">
<p>Wordperfect files need <span class=
"command"><strong>wpd2html</strong></span> from the
<span class="application">libwpd</span> (or
<span class="application">libwpd-tools</span> on
Ubuntu) package.</p>
</li>
<li class="listitem">
<p>RTF files need <span class=
"command"><strong>unrtf</strong></span>, which, in
its older versions, has much trouble with non-western
character sets. Many Linux distributions carry
outdated <span class=
"command"><strong>unrtf</strong></span> versions.
Check <a class="ulink" href=
"http://www.recoll.org/features.html#doctypes"
target="_top">http://www.recoll.org/features.html</a>
for details.</p>
</li>
<li class="listitem">
<p>TeX files need <span class=
"command"><strong>untex</strong></span> or
<span class="command"><strong>detex</strong></span>.
Check <a class="ulink" href=
"http://www.recoll.org/features.html#doctypes"
target="_top">http://www.recoll.org/features.html</a>
for sources if it's not packaged for your
distribution.</p>
</li>
<li class="listitem">
<p>dvi files need <span class=
"command"><strong>dvips</strong></span>.</p>
</li>
<li class="listitem">
<p>djvu files need <span class=
"command"><strong>djvutxt</strong></span> and
<span class="command"><strong>djvused</strong></span>
from the <span class="application">DjVuLibre</span>
package.</p>
</li>
<li class="listitem">
<p>Audio files: <span class=
"application">Recoll</span> releases 1.14 and later
use a single <span class="application">Python</span>
handler based on <span class=
"application">mutagen</span> for all audio file
types.</p>
</li>
<li class="listitem">
<p>Pictures: <span class="application">Recoll</span>
uses the <span class="application">Exiftool</span>
<span class="application">Perl</span> package to
extract tag information. Most image file formats are
supported. Note that there may not be much interest
in indexing the technical tags (image size, aperture,
etc.). This is only of interest if you store personal
tags or textual descriptions inside the image
files.</p>
</li>
<li class="listitem">
<p>chm: files in Microsoft help format need Python
and the <span class="application">pychm</span> module
(which needs <span class=
"application">chmlib</span>).</p>
</li>
<li class="listitem">
<p>ICS: up to <span class="application">Recoll</span>
1.13, iCalendar files need <span class=
"application">Python</span> and the <span class=
"application">icalendar</span> module. <span class=
"application">icalendar</span> is not needed for
newer versions, which use internal code.</p>
</li>
<li class="listitem">
<p>Zip archives need <span class=
"application">Python</span> (and the standard zipfile
module).</p>
</li>
<li class="listitem">
<p>Rar archives need <span class=
"application">Python</span>, the <span class=
"application">rarfile</span> Python module and the
<span class="command"><strong>unrar</strong></span>
utility.</p>
</li>
<li class="listitem">
<p>Midi karaoke files need <span class=
"application">Python</span> and the <a class="ulink"
href="http://pypi.python.org/pypi/midi/0.2.1" target=
"_top"><span class="application">Midi
module</span></a></p>
</li>
<li class="listitem">
<p>Konqueror webarchive format with Python (uses the
Tarfile module).</p>
</li>
<li class="listitem">
<p>Mimehtml web archive format (support based on the
email handler, which introduces some mild weirdness,
but still usable).</p>
</li>
</ul>
</div>
<p>Text, HTML, email folders, and Scribus files are
processed internally. <span class="application">Lyx</span>
is used to index Lyx files. Many handlers need <span class=
"command"><strong>iconv</strong></span> and the standard
<span class="command"><strong>sed</strong></span> and
<span class="command"><strong>awk</strong></span>.</p>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INSTALL.BUILDING" id=
"RCL.INSTALL.BUILDING"></a>6.3.&nbsp;Building from
source</h2>
</div>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.BUILDING.PREREQS" id=
"RCL.INSTALL.BUILDING.PREREQS"></a>6.3.1.&nbsp;Prerequisites</h3>
</div>
</div>
</div>
<p>The following prerequisites are described in broad
terms and not as specific package names (which will
depend on the exact platform). The dependancies should be
available as packages on most common Unix derivatives,
and it should be quite uncommon that you would have to
build one of them.</p>
<p>The shopping list:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>The <span class=
"command"><strong>autoconf</strong></span>,
<span class=
"command"><strong>automake</strong></span> and
<span class=
"command"><strong>libtool</strong></span> triad.
Only <span class=
"command"><strong>autoconf</strong></span> is
needed for <span class="application">Recoll</span>
1.21 and earlier.</p>
</li>
<li class="listitem">
<p>C++ compiler. Recent versions require C++11
compatibility (1.23 and later).</p>
</li>
<li class="listitem">
<p><span class=
"command"><strong>bison</strong></span> command
(for <span class="application">Recoll</span> 1.21
and later).</p>
</li>
<li class="listitem">
<p><span class=
"command"><strong>xsltproc</strong></span> command.
For building the documentation (for <span class=
"application">Recoll</span> 1.21 and later). This
sometimes comes with the <span class=
"application">libxslt</span> package. And also the
Docbook XML and style sheet files.</p>
</li>
<li class="listitem">
<p>Development files for <a class="ulink" href=
"http://www.xapian.org" target="_top"><span class=
"application">Xapian core</span></a>.</p>
<div class="important" style=
"margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Important</h3>
<p>If you are building Xapian for an older CPU
(before Pentium 4 or Athlon 64), you need to add
the <code class="option">--disable-sse</code>
flag to the configure command. Else all Xapian
application will crash with an <code class=
"literal">illegal instruction</code> error.</p>
</div>
</li>
<li class="listitem">
<p>Development files for <a class="ulink" href=
"http://qt-project.org/downloads" target=
"_top"><span class="application">Qt 4 or Qt
5</span></a> . <span class=
"application">Recoll</span> 1.15.9 was the last
version to support <span class="application">Qt
3</span>. If you do not want to install or build
the <span class="application">Qt Webkit</span>
module, <span class="application">Recoll</span> has
a configuration option to disable its use (see
further in the configuration section).</p>
</li>
<li class="listitem">
<p>Development files for <span class=
"application">X11</span> and <span class=
"application">zlib</span>.</p>
</li>
<li class="listitem">
<p>Development files for <span class=
"application">Python</span> (or use <code class=
"literal">--disable-python-module</code>).</p>
</li>
<li class="listitem">
<p>You may also need <a class="ulink" href=
"http://www.gnu.org/software/libiconv/" target=
"_top">libiconv</a>. On <span class=
"application">Linux</span> systems, the iconv
interface is part of libc and you should not need
to do anything special.</p>
</li>
</ul>
</div>
<p>Check the <a class="ulink" href=
"http://www.recoll.org/download.html" target=
"_top"><span class="application">Recoll</span> download
page</a> for up to date version information.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.BUILDING.BUILDING" id=
"RCL.INSTALL.BUILDING.BUILDING"></a>6.3.2.&nbsp;Building</h3>
</div>
</div>
</div>
<p><span class="application">Recoll</span> has been built
on Linux, FreeBSD, Mac OS X, and Solaris, most versions
after 2005 should be ok, maybe some older ones too
(Solaris 8 is ok). If you build on another system, and
need to modify things, <a class="ulink" href=
"mailto:jfd@recoll.org" target="_top">I would very much
welcome patches</a>.</p>
<p><b>Configure options:&nbsp;</b></p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><code class="option">--without-aspell</code>
will disable the code for phonetic matching of
search terms.</p>
</li>
<li class="listitem">
<p><code class="option">--with-fam</code> or
<code class="option">--with-inotify</code> will
enable the code for real time indexing. Inotify
support is enabled by default on recent Linux
systems.</p>
</li>
<li class="listitem">
<p><code class="option">--with-qzeitgeist</code>
will enable sending <span class=
"application">Zeitgeist</span> events about the
visited search results, and needs the <span class=
"application">qzeitgeist</span> package.</p>
</li>
<li class="listitem">
<p><code class="option">--disable-webkit</code> is
available from version 1.17 to implement the result
list with a <span class="application">Qt</span>
QTextBrowser instead of a WebKit widget if you do
not or can't depend on the latter.</p>
</li>
<li class="listitem">
<p><code class="option">--disable-idxthreads</code>
is available from version 1.19 to suppress
multithreading inside the indexing process. You can
also use the run-time configuration to restrict
<span class=
"command"><strong>recollindex</strong></span> to
using a single thread, but the compile-time option
may disable a few more unused locks. This only
applies to the use of multithreading for the core
index processing (data input). The <span class=
"application">Recoll</span> monitor mode always
uses at least two threads of execution.</p>
</li>
<li class="listitem">
<p><code class=
"option">--disable-python-module</code> will avoid
building the <span class=
"application">Python</span> module.</p>
</li>
<li class="listitem">
<p><code class="option">--disable-xattr</code> will
prevent fetching data from file extended
attributes. Beyond a few standard attributes,
fetching extended attributes data can only be
useful is some application stores data in there,
and also needs some simple configuration (see
comments in the <code class=
"filename">fields</code> configuration file).</p>
</li>
<li class="listitem">
<p><code class="option">--enable-camelcase</code>
will enable splitting <em class=
"replaceable"><code>camelCase</code></em> words.
This is not enabled by default as it has the
unfortunate side-effect of making some phrase
searches quite confusing: ie, <code class=
"literal">"MySQL manual"</code> would be matched by
<code class="literal">"MySQL manual"</code> and
<code class="literal">"my sql manual"</code> but
not <code class="literal">"mysql manual"</code>
(only inside phrase searches).</p>
</li>
<li class="listitem">
<p><code class="option">--with-file-command</code>
Specify the version of the 'file' command to use
(ie: --with-file-command=/usr/local/bin/file). Can
be useful to enable the gnu version on systems
where the native one is bad.</p>
</li>
<li class="listitem">
<p><code class="option">--disable-qtgui</code>
Disable the Qt interface. Will allow building the
indexer and the command line search program in
absence of a Qt environment.</p>
</li>
<li class="listitem">
<p><code class="option">--disable-x11mon</code>
Disable <span class="application">X11</span>
connection monitoring inside recollindex. Together
with --disable-qtgui, this allows building recoll
without <span class="application">Qt</span> and
<span class="application">X11</span>.</p>
</li>
<li class="listitem">
<p><code class="option">--disable-userdoc</code>
will avoid building the user manual. This avoids
having to install the Docbook XML/XSL files and the
TeX toolchain used for translating the manual to
PDF.</p>
</li>
<li class="listitem">
<p><code class="option">--disable-pic</code>
(<span class="application">Recoll</span> versions
up to 1.21 only) will compile <span class=
"application">Recoll</span> with position-dependant
code. This is incompatible with building the KIO or
the <span class="application">Python</span> or
<span class="application">PHP</span> extensions,
but might yield very marginally faster code.</p>
</li>
<li class="listitem">
<p>Of course the usual <span class=
"application">autoconf</span> <span class=
"command"><strong>configure</strong></span>
options, like <code class="option">--prefix</code>
apply.</p>
</li>
</ul>
</div>
<p>Normal procedure (for source extracted from a tar
distribution):</p>
<pre class="screen">
<strong class=
"userinput"><code>cd recoll-xxx</code></strong>
<strong class=
"userinput"><code>./configure</code></strong>
<strong class="userinput"><code>make</code></strong>
<strong class=
"userinput"><code>(practices usual hardship-repelling invocations)</code></strong>
</pre>
<p>When building from source cloned from the git
repository, you also need to install <span class=
"application">autoconf</span>, <span class=
"application">automake</span>, and <span class=
"application">libtool</span> and you must execute
<code class="literal">sh autogen.sh</code> in the top
source directory before running <code class=
"literal">configure</code>.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.BUILDING.INSTALL" id=
"RCL.INSTALL.BUILDING.INSTALL"></a>6.3.3.&nbsp;Installing</h3>
</div>
</div>
</div>
<p>Use <strong class="userinput"><code>make
install</code></strong> in the root of the source tree.
This will copy the commands to <code class=
"filename"><em class=
"replaceable"><code>prefix</code></em>/bin</code> and the
sample configuration files, scripts and other shared data
to <code class="filename"><em class=
"replaceable"><code>prefix</code></em>/share/recoll</code>.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.BUILDING.PYTHON" id=
"RCL.INSTALL.BUILDING.PYTHON"></a>6.3.4.&nbsp;Python
API package</h3>
</div>
</div>
</div>
<p>The Python interface can be found in the source tree,
under the <code class="filename">python/recoll</code>
directory.</p>
<p>As of <span class="application">Recoll</span> 1.19,
the module can be compiled for Python3.</p>
<p>The normal <span class="application">Recoll</span>
build procedure (see above) installs the API package for
the default system version (python) along with the main
code. The package for other Python versions (e.g. python3
if the system default is python2) must be explicitely
built and installed.</p>
<p>The <code class="filename">python/recoll/</code>
directory contains the usual <code class=
"filename">setup.py</code>. After configuring and
building the main <span class="application">Recoll</span>
code, you can use the script to build and install the
Python module:</p>
<pre class="screen">
<strong class=
"userinput"><code>cd recoll-xxx/python/recoll</code></strong>
<strong class=
"userinput"><code>pythonX setup.py build</code></strong>
<strong class=
"userinput"><code>sudo pythonX setup.py install</code></strong>
</pre>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.BUILDING.SOLARIS" id=
"RCL.INSTALL.BUILDING.SOLARIS"></a>6.3.5.&nbsp;Building
on Solaris</h3>
</div>
</div>
</div>
<p>We did not test building the GUI on Solaris for recent
versions. You will need at least Qt 4.4. There are some
hints on <a class="ulink" href=
"http://www.recoll.org/download-1.14.html" target=
"_top">an old web site page</a>, they may still be
valid.</p>
<p>Someone did test the 1.19 indexer and Python module
build, they do work, with a few minor glitches. Be sure
to use GNU <span class=
"command"><strong>make</strong></span> and <span class=
"command"><strong>install</strong></span>.</p>
</div>
</div>
<div class="sect1">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name=
"RCL.INSTALL.CONFIG" id=
"RCL.INSTALL.CONFIG"></a>6.4.&nbsp;Configuration
overview</h2>
</div>
</div>
</div>
<p>Most of the parameters specific to the <span class=
"command"><strong>recoll</strong></span> GUI are set
through the <span class="guilabel">Preferences</span> menu
and stored in the standard Qt place (<code class=
"filename">$HOME/.config/Recoll.org/recoll.conf</code>).
You probably do not want to edit this by hand.</p>
<p><span class="application">Recoll</span> indexing options
are set inside text configuration files located in a
configuration directory. There can be several such
directories, each of which defines the parameters for one
index.</p>
<p>The configuration files can be edited by hand or through
the <span class="guilabel">Index configuration</span>
dialog (<span class="guilabel">Preferences</span> menu).
The GUI tool will try to respect your formatting and
comments as much as possible, so it is quite possible to
use both approaches on the same configuration.</p>
<p>The most accurate documentation for the configuration
parameters is given by comments inside the default files,
and we will just give a general overview here.</p>
<p>For each index, there are at least two sets of
configuration files. System-wide configuration files are
kept in a directory named like <code class=
"filename">/usr/share/recoll/examples</code>, and define
default values, shared by all indexes. For each index, a
parallel set of files defines the customized
parameters.</p>
<p>The default location of the customized configuration is
the <code class="filename">.recoll</code> directory in your
home. Most people will only use this directory.</p>
<p>This location can be changed, or others can be added
with the <code class="envar">RECOLL_CONFDIR</code>
environment variable or the <code class="option">-c</code>
option parameter to <span class=
"command"><strong>recoll</strong></span> and <span class=
"command"><strong>recollindex</strong></span>.</p>
<p>In addition (as of <span class=
"application">Recoll</span> version 1.19.7), it is possible
to specify two additional configuration directories which
will be stacked before and after the user configuration
directory. These are defined by the <code class=
"envar">RECOLL_CONFTOP</code> and <code class=
"envar">RECOLL_CONFMID</code> environment variables. Values
from configuration files inside the top directory will
override user ones, values from configuration files inside
the middle directory will override system ones and be
overriden by user ones. These two variables may be of use
to applications which augment <span class=
"application">Recoll</span> functionality, and need to add
configuration data without disturbing the user's files.
Please note that the two, currently single, values will
probably be interpreted as colon-separated lists in the
future: do not use colon characters inside the directory
paths.</p>
<p>If the <code class="filename">.recoll</code> directory
does not exist when <span class=
"command"><strong>recoll</strong></span> or <span class=
"command"><strong>recollindex</strong></span> are started,
it will be created with a set of empty configuration files.
<span class="command"><strong>recoll</strong></span> will
give you a chance to edit the configuration file before
starting indexing. <span class=
"command"><strong>recollindex</strong></span> will proceed
immediately. To avoid mistakes, the automatic directory
creation will only occur for the default location, not if
<code class="option">-c</code> or <code class=
"envar">RECOLL_CONFDIR</code> were used (in the latter
cases, you will have to create the directory).</p>
<p>All configuration files share the same format. For
example, a short extract of the main configuration file
might look as follows:</p>
<pre class="programlisting">
# Space-separated list of files and directories to index.
topdirs = ~/docs /usr/share/doc
[~/somedirectory-with-utf8-txt-files]
defaultcharset = utf-8
</pre>
<p>There are three kinds of lines:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>Comment (starts with <span class=
"emphasis"><em>#</em></span>) or empty.</p>
</li>
<li class="listitem">
<p>Parameter affectation (<span class=
"emphasis"><em>name = value</em></span>).</p>
</li>
<li class="listitem">
<p>Section definition ([<span class=
"emphasis"><em>somedirname</em></span>]).</p>
</li>
</ul>
</div>
<p>Long lines can be broken by ending each incomplete part
with a backslash (<code class="literal">\</code>).</p>
<p>Depending on the type of configuration file, section
definitions either separate groups of parameters or allow
redefining some parameters for a directory sub-tree. They
stay in effect until another section definition, or the end
of file, is encountered. Some of the parameters used for
indexing are looked up hierarchically from the current
directory location upwards. Not all parameters can be
meaningfully redefined, this is specified for each in the
next section.</p>
<p>When found at the beginning of a file path, the tilde
character (~) is expanded to the name of the user's home
directory, as a shell would do.</p>
<p>Some parameters are lists of strings. White space is
used for separation. List elements with embedded spaces can
be quoted using double-quotes. Double quotes inside these
elements can be escaped with a backslash.</p>
<p>No value inside a configuration file can contain a
newline character. Long lines can be continued by escaping
the physical newline with backslash, even inside quoted
strings.</p>
<pre class="programlisting">
astringlist = "some string \
with spaces"
thesame = "some string with spaces"
</pre>
<p>Parameters which are not part of string lists can't be
quoted, and leading and trailing space characters are
stripped before the value is used.</p>
<p><b>Encoding issues.&nbsp;</b>Most of the configuration
parameters are plain ASCII. Two particular sets of values
may cause encoding issues:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">
<p>File path parameters may contain non-ascii
characters and should use the exact same byte values
as found in the file system directory. Usually, this
means that the configuration file should use the
system default locale encoding.</p>
</li>
<li class="listitem">
<p>The <code class="envar">unac_except_trans</code>
parameter should be encoded in UTF-8. If your system
locale is not UTF-8, and you need to also specify
non-ascii file paths, this poses a difficulty because
common text editors cannot handle multiple encodings
in a single file. In this relatively unlikely case,
you can edit the configuration file as two separate
text files with appropriate encodings, and
concatenate them to create the complete
configuration.</p>
</li>
</ul>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.CONFIG.ENVIR" id=
"RCL.INSTALL.CONFIG.ENVIR"></a>6.4.1.&nbsp;Environment
variables</h3>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term"><code class=
"varname">RECOLL_CONFDIR</code></span></dt>
<dd>
<p>Defines the main configuration directory.</p>
</dd>
<dt><span class="term"><code class=
"varname">RECOLL_TMPDIR, TMPDIR</code></span></dt>
<dd>
<p>Locations for temporary files, in this order of
priority. The default if none of these is set is to
use <code class="filename">/tmp</code>. Big
temporary files may be created during indexing,
mostly for decompressing, and also for processing,
e.g. email attachments.</p>
</dd>
<dt><span class="term"><code class=
"varname">RECOLL_CONFTOP,
RECOLL_CONFMID</code></span></dt>
<dd>
<p>Allow adding configuration directories with
priorities below and above the user directory (see
above the Configuration overview section for
details).</p>
</dd>
<dt><span class="term"><code class=
"varname">RECOLL_EXTRA_DBS,
RECOLL_ACTIVE_EXTRA_DBS</code></span></dt>
<dd>
<p>Help for setting up external indexes. See
<a class="link" href="#RCL.SEARCH.GUI.MULTIDB"
title="3.1.10.&nbsp;Multiple indexes">this
paragraph</a> for explanations.</p>
</dd>
<dt><span class="term"><code class=
"varname">RECOLL_DATADIR</code></span></dt>
<dd>
<p>Defines replacement for the default location of
Recoll data files, normally found in, e.g.,
<code class=
"filename">/usr/share/recoll</code>).</p>
</dd>
<dt><span class="term"><code class=
"varname">RECOLL_FILTERSDIR</code></span></dt>
<dd>
<p>Defines replacement for the default location of
Recoll filters, normally found in, e.g.,
<code class=
"filename">/usr/share/recoll/filters</code>).</p>
</dd>
<dt><span class="term"><code class=
"varname">ASPELL_PROG</code></span></dt>
<dd>
<p><span class=
"command"><strong>aspell</strong></span> program to
use for creating the spelling dictionary. The
result has to be compatible with the <code class=
"filename">libaspell</code> which <span class=
"application">Recoll</span> is using.</p>
</dd>
<dt><span class="term"><code class=
"varname">VARNAME</code></span></dt>
<dd>
<p>Blabla</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF" id=
"RCL.INSTALL.CONFIG.RECOLLCONF"></a>6.4.2.&nbsp;Recoll
main configuration file, recoll.conf</h3>
</div>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.WHATDOCS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.WHATDOCS"></a>6.4.2.1.&nbsp;Parameters
affecting what documents we index</h4>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><a name="RCL.INSTALL.CONFIG.RECOLLCONF.TOPDIRS"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.TOPDIRS"></a><span class="term"><code class="varname">topdirs</code></span></dt>
<dd>
<p>Space-separated list of files or directories
to recursively index. Default to ~ (indexes
$HOME). You can use symbolic links in the list,
they will be followed, independantly of the value
of the followLinks variable.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONITORDIRS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONITORDIRS"></a><span class="term"><code class="varname">monitordirs</code></span></dt>
<dd>
<p>(1.25) Space-separated list of files or
directories to monitor for updates. When running
the real-time indexer, this allows monitoring
only a subset of the whole indexed area. The
elements must be included in the tree defined by
the 'topdirs' members.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDNAMES" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDNAMES"></a><span class="term"><code class="varname">skippedNames</code></span></dt>
<dd>
<p>Files and directories which should be ignored.
White space separated list of wildcard patterns
(simple ones, not paths, must contain no / ),
which will be tested against file and directory
names. The list in the default configuration does
not exclude hidden directories (names beginning
with a dot), which means that it may index quite
a few things that you do not want. On the other
hand, email user agents like Thunderbird usually
store messages in hidden directories, and you
probably want this indexed. One possible solution
is to have ".*" in "skippedNames", and add things
like "~/.thunderbird" "~/.evolution" to
"topdirs". Not even the file names are indexed
for patterns in this list, see the
"noContentSuffixes" variable for an alternative
approach which indexes the file names. Can be
redefined for any subtree.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDNAMES-" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDNAMES-"></a><span class="term"><code class="varname">skippedNames-</code></span></dt>
<dd>
<p>List of name endings to remove from the
default skippedNames list.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDNAMES+" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDNAMES+"></a><span class="term"><code class="varname">skippedNames+</code></span></dt>
<dd>
<p>List of name endings to add to the default
skippedNames list.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOCONTENTSUFFIXES"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOCONTENTSUFFIXES"></a><span class="term"><code class="varname">noContentSuffixes</code></span></dt>
<dd>
<p>List of name endings (not necessarily
dot-separated suffixes) for which we don't try
MIME type identification, and don't uncompress or
index content. Only the names will be indexed.
This complements the now obsoleted recoll_noindex
list from the mimemap file, which will go away in
a future release (the move from mimemap to
recoll.conf allows editing the list through the
GUI). This is different from skippedNames because
these are name ending matches only (not wildcard
patterns), and the file name itself gets indexed
normally. This can be redefined for
subdirectories.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOCONTENTSUFFIXES-"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOCONTENTSUFFIXES-"></a><span class="term"><code class="varname">noContentSuffixes-</code></span></dt>
<dd>
<p>List of name endings to remove from the
default noContentSuffixes list.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOCONTENTSUFFIXES+"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOCONTENTSUFFIXES+"></a><span class="term"><code class="varname">noContentSuffixes+</code></span></dt>
<dd>
<p>List of name endings to add to the default
noContentSuffixes list.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDPATHS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDPATHS"></a><span class="term"><code class="varname">skippedPaths</code></span></dt>
<dd>
<p>Paths we should not go into. Space-separated
list of wildcard expressions for filesystem
paths. Can contain files and directories. The
database and configuration directories will
automatically be added. The expressions are
matched using 'fnmatch(3)' with the FNM_PATHNAME
flag set by default. This means that '/'
characters must be matched explicitely. You can
set 'skippedPathsFnmPathname' to 0 to disable the
use of FNM_PATHNAME (meaning that '/*/dir3' will
match '/dir1/dir2/dir3'). The default value
contains the usual mount point for removable
media to remind you that it is a bad idea to have
Recoll work on these (esp. with the monitor:
media gets indexed on mount, all data gets erased
on unmount). Explicitely adding '/media/xxx' to
the topdirs will override this.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDPATHSFNMPATHNAME"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.SKIPPEDPATHSFNMPATHNAME">
</a><span class="term"><code class=
"varname">skippedPathsFnmPathname</code></span></dt>
<dd>
<p>Set to 0 to override use of FNM_PATHNAME for
matching skipped paths.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.DAEMSKIPPEDPATHS"
id="RCL.INSTALL.CONFIG.RECOLLCONF.DAEMSKIPPEDPATHS">
</a><span class="term"><code class=
"varname">daemSkippedPaths</code></span></dt>
<dd>
<p>skippedPaths equivalent specific to real time
indexing. This enables having parts of the tree
which are initially indexed but not monitored. If
daemSkippedPaths is not set, the daemon uses
skippedPaths.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.ZIPSKIPPEDNAMES" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.ZIPSKIPPEDNAMES"></a><span class="term"><code class="varname">zipSkippedNames</code></span></dt>
<dd>
<p>Space-separated list of wildcard expressions
for names that should be ignored inside zip
archives. This is used directly by the zip
handler, and has a function similar to
skippedNames, but works independantly. Can be
redefined for subdirectories. Supported by recoll
1.20 and newer. See
https://www.lesbonscomptes.com/recoll/faqsandhowtos/FilteringOutZipArchiveMembers.html</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.FOLLOWLINKS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.FOLLOWLINKS"></a><span class="term"><code class="varname">followLinks</code></span></dt>
<dd>
<p>Follow symbolic links during indexing. The
default is to ignore symbolic links to avoid
multiple indexing of linked files. No effort is
made to avoid duplication when this option is set
to true. This option can be set individually for
each of the 'topdirs' members by using sections.
It can not be changed below the 'topdirs' level.
Links in the 'topdirs' list itself are always
followed.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.INDEXEDMIMETYPES"
id="RCL.INSTALL.CONFIG.RECOLLCONF.INDEXEDMIMETYPES">
</a><span class="term"><code class=
"varname">indexedmimetypes</code></span></dt>
<dd>
<p>Restrictive list of indexed mime types.
Normally not set (in which case all supported
types are indexed). If it is set, only the types
from the list will have their contents indexed.
The names will be indexed anyway if
indexallfilenames is set (default). MIME type
names should be taken from the mimemap file (the
values may be different from xdg-mime or file -i
output in some cases). Can be redefined for
subtrees.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.EXCLUDEDMIMETYPES"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.EXCLUDEDMIMETYPES"></a><span class="term"><code class="varname">excludedmimetypes</code></span></dt>
<dd>
<p>List of excluded MIME types. Lets you exclude
some types from indexing. MIME type names should
be taken from the mimemap file (the values may be
different from xdg-mime or file -i output in some
cases) Can be redefined for subtrees.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOMD5MIMETYPES" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOMD5MIMETYPES"></a><span class="term"><code class="varname">nomd5mimetypes</code></span></dt>
<dd>
<p>Don't compute md5 for these types. md5
checksums are used only for deduplicating
results, and can be very expensive to compute on
multimedia or other big files. This list lets you
turn off md5 computation for selected types. It
is global (no redefinition for subtrees). At the
moment, it only has an effect for external
handlers (exec and execm). The file types can be
specified by listing either MIME types (e.g.
audio/mpeg) or handler names (e.g. rclaudio).</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.COMPRESSEDFILEMAXKBS"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.COMPRESSEDFILEMAXKBS">
</a><span class="term"><code class=
"varname">compressedfilemaxkbs</code></span></dt>
<dd>
<p>Size limit for compressed files. We need to
decompress these in a temporary directory for
identification, which can be wasteful in some
cases. Limit the waste. Negative means no limit.
0 results in no processing of any compressed
file. Default 50 MB.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.TEXTFILEMAXMBS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.TEXTFILEMAXMBS"></a><span class="term"><code class="varname">textfilemaxmbs</code></span></dt>
<dd>
<p>Size limit for text files. Mostly for skipping
monster logs. Default 20 MB.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.INDEXALLFILENAMES"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.INDEXALLFILENAMES"></a><span class="term"><code class="varname">indexallfilenames</code></span></dt>
<dd>
<p>Index the file names of unprocessed files
Index the names of files the contents of which we
don't index because of an excluded or unsupported
MIME type.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.USESYSTEMFILECOMMAND"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.USESYSTEMFILECOMMAND">
</a><span class="term"><code class=
"varname">usesystemfilecommand</code></span></dt>
<dd>
<p>Use a system command for file MIME type
guessing as a final step in file type
identification This is generally useful, but will
usually cause the indexing of many bogus 'text'
files. See 'systemfilecommand' for the command
used.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.SYSTEMFILECOMMAND"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.SYSTEMFILECOMMAND"></a><span class="term"><code class="varname">systemfilecommand</code></span></dt>
<dd>
<p>Command used to guess MIME types if the
internal methods fails This should be a "file -i"
workalike. The file path will be added as a last
parameter to the command line. 'xdg-mime' works
better than the traditional 'file' command, and
is now the configured default (with a hard-coded
fallback to 'file')</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.PROCESSWEBQUEUE" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.PROCESSWEBQUEUE"></a><span class="term"><code class="varname">processwebqueue</code></span></dt>
<dd>
<p>Decide if we process the Web queue. The queue
is a directory where the Recoll Web browser
plugins create the copies of visited pages.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.TEXTFILEPAGEKBS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.TEXTFILEPAGEKBS"></a><span class="term"><code class="varname">textfilepagekbs</code></span></dt>
<dd>
<p>Page size for text files. If this is set,
text/plain files will be divided into documents
of approximately this size. Will reduce memory
usage at index time and help with loading data in
the preview window at query time. Particularly
useful with very big files, such as application
or system logs. Also see textfilemaxmbs and
compressedfilemaxkbs.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MEMBERMAXKBS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MEMBERMAXKBS"></a><span class="term"><code class="varname">membermaxkbs</code></span></dt>
<dd>
<p>Size limit for archive members. This is passed
to the filters in the environment as
RECOLL_FILTER_MAXMEMBERKB.</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.TERMS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.TERMS"></a>6.4.2.2.&nbsp;Parameters
affecting how we generate terms and organize the
index</h4>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.INDEXSTRIPCHARS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.INDEXSTRIPCHARS"></a><span class="term"><code class="varname">indexStripChars</code></span></dt>
<dd>
<p>Decide if we store character case and
diacritics in the index. If we do, searches
sensitive to case and diacritics can be
performed, but the index will be bigger, and some
marginal weirdness may sometimes occur. The
default is a stripped index. When using multiple
indexes for a search, this parameter must be
defined identically for all. Changing the value
implies an index reset.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.INDEXSTOREDOCTEXT"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.INDEXSTOREDOCTEXT"></a><span class="term"><code class="varname">indexStoreDocText</code></span></dt>
<dd>
<p>Decide if we store the documents' text content
in the index. Storing the text allows extracting
snippets from it at query time, instead of
building them from index position data. Newer
Xapian index formats have rendered our use of
positions list unacceptably slow in some cases.
The last Xapian index format with good
performance for the old method is Chert, which is
default for 1.2, still supported but not default
in 1.4 and will be dropped in 1.6. The stored
document text is translated from its original
format to UTF-8 plain text, but not stripped of
upper-case, diacritics, or punctuation signs.
Storing it increases the index size by 10-20%
typically, but also allows for nicer snippets, so
it may be worth enabling it even if not strictly
needed for performance if you can afford the
space. The variable only has an effect when
creating an index, meaning that the xapiandb
directory must not exist yet. Its exact effect
depends on the Xapian version. For Xapian 1.4, if
the variable is set to 0, the Chert format will
be used, and the text will not be stored. If the
variable is 1, Glass will be used, and the text
stored. For Xapian 1.2, and for versions after
1.5 and newer, the index format is always the
default, but the variable controls if the text is
stored or not, and the abstract generation
method. With Xapian 1.5 and later, and the
variable set to 0, abstract generation may be
very slow, but this setting may still be useful
to save space if you do not use abstract
generation at all.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.NONUMBERS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.NONUMBERS"></a><span class="term"><code class="varname">nonumbers</code></span></dt>
<dd>
<p>Decides if terms will be generated for
numbers. For example "123", "1.5e6", 192.168.1.4,
would not be indexed if nonumbers is set
("value123" would still be). Numbers are often
quite interesting to search for, and this should
probably not be set except for special
situations, ie, scientific documents with huge
amounts of numbers in them, where setting
nonumbers will reduce the index size. This can
only be set for a whole index, not for a
subtree.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.DEHYPHENATE" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.DEHYPHENATE"></a><span class="term"><code class="varname">dehyphenate</code></span></dt>
<dd>
<p>Determines if we index 'coworker' also when
the input is 'co-worker'. This is new in version
1.22, and on by default. Setting the variable to
off allows restoring the previous behaviour.</p>
</dd>
<dt><a name="RCL.INSTALL.CONFIG.RECOLLCONF.NOCJK"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOCJK"></a><span class="term"><code class="varname">nocjk</code></span></dt>
<dd>
<p>Decides if specific East Asian (Chinese Korean
Japanese) characters/word splitting is turned
off. This will save a small amount of CPU if you
have no CJK documents. If your document base does
include such text but you are not interested in
searching it, setting nocjk may be a significant
time and space saver.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.CJKNGRAMLEN" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.CJKNGRAMLEN"></a><span class="term"><code class="varname">cjkngramlen</code></span></dt>
<dd>
<p>This lets you adjust the size of n-grams used
for indexing CJK text. The default value of 2 is
probably appropriate in most cases. A value of 3
would allow more precision and efficiency on
longer words, but the index will be approximately
twice as large.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.INDEXSTEMMINGLANGUAGES"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.INDEXSTEMMINGLANGUAGES">
</a><span class="term"><code class=
"varname">indexstemminglanguages</code></span></dt>
<dd>
<p>Languages for which to create stemming
expansion data. Stemmer names can be found by
executing 'recollindex -l', or this can also be
set from a list in the GUI.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.DEFAULTCHARSET" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.DEFAULTCHARSET"></a><span class="term"><code class="varname">defaultcharset</code></span></dt>
<dd>
<p>Default character set. This is used for files
which do not contain a character set definition
(e.g.: text/plain). Values found inside files,
e.g. a 'charset' tag in HTML documents, will
override it. If this is not set, the default
character set is the one defined by the NLS
environment ($LC_ALL, $LC_CTYPE, $LANG), or
ultimately iso-8859-1 (cp-1252 in fact). If for
some reason you want a general default which does
not match your LANG and is not 8859-1, use this
variable. This can be redefined for any
sub-directory.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.UNAC_EXCEPT_TRANS"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.UNAC_EXCEPT_TRANS"></a><span class="term"><code class="varname">unac_except_trans</code></span></dt>
<dd>
<p>A list of characters, encoded in UTF-8, which
should be handled specially when converting text
to unaccented lowercase. For example, in Swedish,
the letter a with diaeresis has full alphabet
citizenship and should not be turned into an a.
Each element in the space-separated list has the
special character as first element and the
translation following. The handling of both the
lowercase and upper-case versions of a character
should be specified, as appartenance to the list
will turn-off both standard accent and case
processing. The value is global and affects both
indexing and querying. Examples: Swedish:
unac_except_trans = ���� ���� ���� ���� ���� ���� ��ss ��oe ��oe
��ae ��ae ���ff ���fi ���fl ���� ���� . German:
unac_except_trans = ���� ���� ���� ���� ���� ���� ��ss ��oe ��oe
��ae ��ae ���ff ���fi ���fl In French, you probably want
to decompose oe and ae and nobody would type a
German �� unac_except_trans = ��ss ��oe ��oe ��ae ��ae
���ff ���fi ���fl . The default for all until someone
protests follows. These decompositions are not
performed by unac, but it is unlikely that
someone would type the composed forms in a
search. unac_except_trans = ��ss ��oe ��oe ��ae ��ae
���ff ���fi ���fl</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MAILDEFCHARSET" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MAILDEFCHARSET"></a><span class="term"><code class="varname">maildefcharset</code></span></dt>
<dd>
<p>Overrides the default character set for email
messages which don't specify one. This is mainly
useful for readpst (libpst) dumps, which are
utf-8 but do not say so.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.LOCALFIELDS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.LOCALFIELDS"></a><span class="term"><code class="varname">localfields</code></span></dt>
<dd>
<p>Set fields on all files (usually of a specific
fs area). Syntax is the usual: name = value ;
attr1 = val1 ; [...] value is empty so this needs
an initial semi-colon. This is useful, e.g., for
setting the rclaptg field for application
selection inside mimeview.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.TESTMODIFUSEMTIME"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.TESTMODIFUSEMTIME"></a><span class="term"><code class="varname">testmodifusemtime</code></span></dt>
<dd>
<p>Use mtime instead of ctime to test if a file
has been modified. The time is used in addition
to the size, which is always used. Setting this
can reduce re-indexing on systems where extended
attributes are used (by some other application),
but not indexed, because changing extended
attributes only affects ctime. Notes: - This may
prevent detection of change in some marginal file
rename cases (the target would need to have the
same size and mtime). - You should probably also
set noxattrfields to 1 in this case, except if
you still prefer to perform xattr indexing, for
example if the local file update pattern makes it
of value (as in general, there is a risk for pure
extended attributes updates without file
modification to go undetected). Perform a full
index reset after changing this.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOXATTRFIELDS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOXATTRFIELDS"></a><span class="term"><code class="varname">noxattrfields</code></span></dt>
<dd>
<p>Disable extended attributes conversion to
metadata fields. This probably needs to be set if
testmodifusemtime is set.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.METADATACMDS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.METADATACMDS"></a><span class="term"><code class="varname">metadatacmds</code></span></dt>
<dd>
<p>Define commands to gather external metadata,
e.g. tmsu tags. There can be several entries,
separated by semi-colons, each defining which
field name the data goes into and the command to
use. Don't forget the initial semi-colon. All the
field names must be different. You can use
aliases in the "field" file if necessary. As a
not too pretty hack conceded to convenience, any
field name beginning with "rclmulti" will be
taken as an indication that the command returns
multiple field values inside a text blob
formatted as a recoll configuration file
("fieldname = fieldvalue" lines). The rclmultixx
name will be ignored, and field names and values
will be parsed from the data. Example:
metadatacmds = ; tags = tmsu tags %f; rclmulti1 =
cmdOutputsConf %f</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.STORE" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.STORE"></a>6.4.2.3.&nbsp;Parameters
affecting where and how we store things</h4>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.CACHEDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.CACHEDIR"></a><span class="term"><code class="varname">cachedir</code></span></dt>
<dd>
<p>Top directory for Recoll data. Recoll data
directories are normally located relative to the
configuration directory (e.g. ~/.recoll/xapiandb,
~/.recoll/mboxcache). If 'cachedir' is set, the
directories are stored under the specified value
instead (e.g. if cachedir is ~/.cache/recoll, the
default dbdir would be ~/.cache/recoll/xapiandb).
This affects dbdir, webcachedir, mboxcachedir,
aspellDicDir, which can still be individually
specified to override cachedir. Note that if you
have multiple configurations, each must have a
different cachedir, there is no automatic
computation of a subpath under cachedir.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MAXFSOCCUPPC" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MAXFSOCCUPPC"></a><span class="term"><code class="varname">maxfsoccuppc</code></span></dt>
<dd>
<p>Maximum file system occupation over which we
stop indexing. The value is a percentage,
corresponding to what the "Capacity" df output
column shows. The default value is 0, meaning no
checking.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.XAPIANDB" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.XAPIANDB"></a><span class="term"><code class="varname">xapiandb</code></span></dt>
<dd>
<p>Xapian database directory location. This will
be created on first indexing. If the value is not
an absolute path, it will be interpreted as
relative to cachedir if set, or the configuration
directory (-c argument or $RECOLL_CONFDIR). If
nothing is specified, the default is then
~/.recoll/xapiandb/</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXSTATUSFILE" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXSTATUSFILE"></a><span class="term"><code class="varname">idxstatusfile</code></span></dt>
<dd>
<p>Name of the scratch file where the indexer
process updates its status. Default:
idxstatus.txt inside the configuration
directory.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MBOXCACHEDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MBOXCACHEDIR"></a><span class="term"><code class="varname">mboxcachedir</code></span></dt>
<dd>
<p>Directory location for storing mbox message
offsets cache files. This is normally 'mboxcache'
under cachedir if set, or else under the
configuration directory, but it may be useful to
share a directory between different
configurations.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MBOXCACHEMINMBS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MBOXCACHEMINMBS"></a><span class="term"><code class="varname">mboxcacheminmbs</code></span></dt>
<dd>
<p>Minimum mbox file size over which we cache the
offsets. There is really no sense in caching
offsets for small files. The default is 5 MB.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.WEBCACHEDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.WEBCACHEDIR"></a><span class="term"><code class="varname">webcachedir</code></span></dt>
<dd>
<p>Directory where we store the archived web
pages. This is only used by the web history
indexing code Default: cachedir/webcache if
cachedir is set, else
$RECOLL_CONFDIR/webcache</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.WEBCACHEMAXMBS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.WEBCACHEMAXMBS"></a><span class="term"><code class="varname">webcachemaxmbs</code></span></dt>
<dd>
<p>Maximum size in MB of the Web archive. This is
only used by the web history indexing code.
Default: 40 MB. Reducing the size will not
physically truncate the file.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.WEBQUEUEDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.WEBQUEUEDIR"></a><span class="term"><code class="varname">webqueuedir</code></span></dt>
<dd>
<p>The path to the Web indexing queue. This used
to be hard-coded in the old plugin as
~/.recollweb/ToIndex so there would be no need or
possibility to change it, but the WebExtensions
plugin now downloads the files to the user
Downloads directory, and a script moves them to
webqueuedir. The script reads this value from the
config so it has become possible to change
it.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.WEBDOWNLOADSDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.WEBDOWNLOADSDIR"></a><span class="term"><code class="varname">webdownloadsdir</code></span></dt>
<dd>
<p>The path to browser downloads directory. This
is where the new browser add-on extension has to
create the files. They are then moved by a script
to webqueuedir.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.ASPELLDICDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.ASPELLDICDIR"></a><span class="term"><code class="varname">aspellDicDir</code></span></dt>
<dd>
<p>Aspell dictionary storage directory location.
The aspell dictionary (aspdict.(lang).rws) is
normally stored in the directory specified by
cachedir if set, or under the configuration
directory.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.FILTERSDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.FILTERSDIR"></a><span class="term"><code class="varname">filtersdir</code></span></dt>
<dd>
<p>Directory location for executable input
handlers. If RECOLL_FILTERSDIR is set in the
environment, we use it instead. Defaults to
$prefix/share/recoll/filters. Can be redefined
for subdirectories.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.ICONSDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.ICONSDIR"></a><span class="term"><code class="varname">iconsdir</code></span></dt>
<dd>
<p>Directory location for icons. The only reason
to change this would be if you want to change the
icons displayed in the result list. Defaults to
$prefix/share/recoll/images</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.PERFS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.PERFS"></a>6.4.2.4.&nbsp;Parameters
affecting indexing performance and resource
usage</h4>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXFLUSHMB" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXFLUSHMB"></a><span class="term"><code class="varname">idxflushmb</code></span></dt>
<dd>
<p>Threshold (megabytes of new data) where we
flush from memory to disk index. Setting this
allows some control over memory usage by the
indexer process. A value of 0 means no explicit
flushing, which lets Xapian perform its own
thing, meaning flushing every
$XAPIAN_FLUSH_THRESHOLD documents created,
modified or deleted: as memory usage depends on
average document size, not only document count,
the Xapian approach is is not very useful, and
you should let Recoll manage the flushes. The
program compiled value is 0. The configured
default value (from this file) is 10 MB, and will
be too low in many cases (it is chosen to
conserve memory). If you are looking for maximum
speed, you may want to experiment with values
between 20 and 200. In my experience, values
beyond this are always counterproductive. If you
find otherwise, please drop me a note.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.FILTERMAXSECONDS"
id="RCL.INSTALL.CONFIG.RECOLLCONF.FILTERMAXSECONDS">
</a><span class="term"><code class=
"varname">filtermaxseconds</code></span></dt>
<dd>
<p>Maximum external filter execution time in
seconds. Default 1200 (20mn). Set to 0 for no
limit. This is mainly to avoid infinite loops in
postscript files (loop.ps)</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.FILTERMAXMBYTES" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.FILTERMAXMBYTES"></a><span class="term"><code class="varname">filtermaxmbytes</code></span></dt>
<dd>
<p>Maximum virtual memory space for filter
processes (setrlimit(RLIMIT_AS)), in megabytes.
Note that this includes any mapped libs (there is
no reliable Linux way to limit the data space
only), so we need to be a bit generous here.
Anything over 2000 will be ignored on 32 bits
machines.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.THRQSIZES" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.THRQSIZES"></a><span class="term"><code class="varname">thrQSizes</code></span></dt>
<dd>
<p>Stage input queues configuration. There are
three internal queues in the indexing pipeline
stages (file data extraction, terms generation,
index update). This parameter defines the queue
depths for each stage (three integer values). If
a value of -1 is given for a given stage, no
queue is used, and the thread will go on
performing the next stage. In practise, deep
queues have not been shown to increase
performance. Default: a value of 0 for the first
queue tells Recoll to perform autoconfiguration
based on the detected number of CPUs (no need for
the two other values in this case). Use thrQSizes
= -1 -1 -1 to disable multithreading
entirely.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.THRTCOUNTS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.THRTCOUNTS"></a><span class="term"><code class="varname">thrTCounts</code></span></dt>
<dd>
<p>Number of threads used for each indexing
stage. The three stages are: file data
extraction, terms generation, index update). The
use of the counts is also controlled by some
special values in thrQSizes: if the first queue
depth is 0, all counts are ignored
(autoconfigured); if a value of -1 is used for a
queue depth, the corresponding thread count is
ignored. It makes no sense to use a value other
than 1 for the last stage because updating the
Xapian index is necessarily single-threaded (and
protected by a mutex).</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MISC" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MISC"></a>6.4.2.5.&nbsp;Miscellaneous
parameters</h4>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.LOGLEVEL" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.LOGLEVEL"></a><span class="term"><code class="varname">loglevel</code></span></dt>
<dd>
<p>Log file verbosity 1-6. A value of 2 will
print only errors and warnings. 3 will print
information like document updates, 4 is quite
verbose and 6 very verbose.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.LOGFILENAME" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.LOGFILENAME"></a><span class="term"><code class="varname">logfilename</code></span></dt>
<dd>
<p>Log file destination. Use 'stderr' (default)
to write to the console.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXLOGLEVEL" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXLOGLEVEL"></a><span class="term"><code class="varname">idxloglevel</code></span></dt>
<dd>
<p>Override loglevel for the indexer.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXLOGFILENAME" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXLOGFILENAME"></a><span class="term"><code class="varname">idxlogfilename</code></span></dt>
<dd>
<p>Override logfilename for the indexer.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.DAEMLOGLEVEL" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.DAEMLOGLEVEL"></a><span class="term"><code class="varname">daemloglevel</code></span></dt>
<dd>
<p>Override loglevel for the indexer in real time
mode. The default is to use the idx... values if
set, else the log... values.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.DAEMLOGFILENAME" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.DAEMLOGFILENAME"></a><span class="term"><code class="varname">daemlogfilename</code></span></dt>
<dd>
<p>Override logfilename for the indexer in real
time mode. The default is to use the idx...
values if set, else the log... values.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.ORGIDXCONFDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.ORGIDXCONFDIR"></a><span class="term"><code class="varname">orgidxconfdir</code></span></dt>
<dd>
<p>Original location of the configuration
directory. This is used exclusively for movable
datasets. Locating the configuration directory
inside the directory tree makes it possible to
provide automatic query time path translations
once the data set has moved (for example, because
it has been mounted on another location).</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.CURIDXCONFDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.CURIDXCONFDIR"></a><span class="term"><code class="varname">curidxconfdir</code></span></dt>
<dd>
<p>Current location of the configuration
directory. Complement orgidxconfdir for movable
datasets. This should be used if the
configuration directory has been copied from the
dataset to another location, either because the
dataset is readonly and an r/w copy is desired,
or for performance reasons. This records the
original moved location before copy, to allow
path translation computations. For example if a
dataset originally indexed as
'/home/me/mydata/config' has been mounted to
'/media/me/mydata', and the GUI is running from a
copied configuration, orgidxconfdir would be
'/home/me/mydata/config', and curidxconfdir (as
set in the copied configuration) would be
'/media/me/mydata/config'.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXRUNDIR" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXRUNDIR"></a><span class="term"><code class="varname">idxrundir</code></span></dt>
<dd>
<p>Indexing process current directory. The input
handlers sometimes leave temporary files in the
current directory, so it makes sense to have
recollindex chdir to some temporary directory. If
the value is empty, the current directory is not
changed. If the value is (literal) tmp, we use
the temporary directory as set by the environment
(RECOLL_TMPDIR else TMPDIR else /tmp). If the
value is an absolute path to a directory, we go
there.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.CHECKNEEDRETRYINDEXSCRIPT"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.CHECKNEEDRETRYINDEXSCRIPT">
</a><span class="term"><code class=
"varname">checkneedretryindexscript</code></span></dt>
<dd>
<p>Script used to heuristically check if we need
to retry indexing files which previously failed.
The default script checks the modified dates on
/usr/bin and /usr/local/bin. A relative path will
be looked up in the filters dirs, then in the
path. Use an absolute path to do otherwise.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.RECOLLHELPERPATH"
id="RCL.INSTALL.CONFIG.RECOLLCONF.RECOLLHELPERPATH">
</a><span class="term"><code class=
"varname">recollhelperpath</code></span></dt>
<dd>
<p>Additional places to search for helper
executables. This is only used on Windows for
now.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXABSMLEN" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXABSMLEN"></a><span class="term"><code class="varname">idxabsmlen</code></span></dt>
<dd>
<p>Length of abstracts we store while indexing.
Recoll stores an abstract for each indexed file.
The text can come from an actual 'abstract'
section in the document or will just be the
beginning of the document. It is stored in the
index so that it can be displayed inside the
result lists without decoding the original file.
The idxabsmlen parameter defines the size of the
stored abstract. The default value is 250 bytes.
The search interface gives you the choice to
display this stored text or a synthetic abstract
built by extracting text around the search terms.
If you always prefer the synthetic abstract, you
can reduce this value and save a little
space.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXMETASTOREDLEN"
id="RCL.INSTALL.CONFIG.RECOLLCONF.IDXMETASTOREDLEN">
</a><span class="term"><code class=
"varname">idxmetastoredlen</code></span></dt>
<dd>
<p>Truncation length of stored metadata fields.
This does not affect indexing (the whole field is
processed anyway), just the amount of data stored
in the index for the purpose of displaying fields
inside result lists or previews. The default
value is 150 bytes which may be too low if you
have custom fields.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXTEXTTRUNCATELEN"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.IDXTEXTTRUNCATELEN"></a><span class="term"><code class="varname">idxtexttruncatelen</code></span></dt>
<dd>
<p>Truncation length for all document texts. Only
index the beginning of documents. This is not
recommended except if you are sure that the
interesting keywords are at the top and have
severe disk space issues.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.ASPELLLANGUAGE" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.ASPELLLANGUAGE"></a><span class="term"><code class="varname">aspellLanguage</code></span></dt>
<dd>
<p>Language definitions to use when creating the
aspell dictionary. The value must match a set of
aspell language definition files. You can type
"aspell dicts" to see a list The default if this
is not set is to use the NLS environment to guess
the value.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.ASPELLADDCREATEPARAM"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.ASPELLADDCREATEPARAM">
</a><span class="term"><code class=
"varname">aspellAddCreateParam</code></span></dt>
<dd>
<p>Additional option and parameter to aspell
dictionary creation command. Some aspell packages
may need an additional option (e.g. on Debian
Jessie: --local-data-dir=/usr/lib/aspell). See
Debian bug 772415.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.ASPELLKEEPSTDERR"
id="RCL.INSTALL.CONFIG.RECOLLCONF.ASPELLKEEPSTDERR">
</a><span class="term"><code class=
"varname">aspellKeepStderr</code></span></dt>
<dd>
<p>Set this to have a look at aspell dictionary
creation errors. There are always many, so this
is mostly for debugging.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOASPELL" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.NOASPELL"></a><span class="term"><code class="varname">noaspell</code></span></dt>
<dd>
<p>Disable aspell use. The aspell dictionary
generation takes time, and some combinations of
aspell version, language, and local terms, result
in aspell crashing, so it sometimes makes sense
to just disable the thing.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONAUXINTERVAL" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONAUXINTERVAL"></a><span class="term"><code class="varname">monauxinterval</code></span></dt>
<dd>
<p>Auxiliary database update interval. The real
time indexer only updates the auxiliary databases
(stemdb, aspell) periodically, because it would
be too costly to do it for every document change.
The default period is one hour.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONIXINTERVAL" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONIXINTERVAL"></a><span class="term"><code class="varname">monixinterval</code></span></dt>
<dd>
<p>Minimum interval (seconds) between processings
of the indexing queue. The real time indexer does
not process each event when it comes in, but lets
the queue accumulate, to diminish overhead and to
aggregate multiple events affecting the same
file. Default 30 S.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONDELAYPATTERNS"
id="RCL.INSTALL.CONFIG.RECOLLCONF.MONDELAYPATTERNS">
</a><span class="term"><code class=
"varname">mondelaypatterns</code></span></dt>
<dd>
<p>Timing parameters for the real time indexing.
Definitions for files which get a longer delay
before reindexing is allowed. This is for
fast-changing files, that should only be
reindexed once in a while. A list of
wildcardPattern:seconds pairs. The patterns are
matched with fnmatch(pattern, path, 0) You can
quote entries containing white space with double
quotes (quote the whole entry, not the pattern).
The default is empty. Example: mondelaypatterns =
*.log:20 "*with spaces.*:30"</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONIONICECLASS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONIONICECLASS"></a><span class="term"><code class="varname">monioniceclass</code></span></dt>
<dd>
<p>ionice class for the real time indexing
process On platforms where this is supported. The
default value is 3.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONIONICECLASSDATA"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MONIONICECLASSDATA"></a><span class="term"><code class="varname">monioniceclassdata</code></span></dt>
<dd>
<p>ionice class parameter for the real time
indexing process. On platforms where this is
supported. The default is empty.</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.QUERY" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.QUERY"></a>6.4.2.6.&nbsp;Query-time
parameters (no impact on the index)</h4>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.AUTODIACSENS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.AUTODIACSENS"></a><span class="term"><code class="varname">autodiacsens</code></span></dt>
<dd>
<p>auto-trigger diacritics sensitivity (raw index
only). IF the index is not stripped, decide if we
automatically trigger diacritics sensitivity if
the search term has accented characters (not in
unac_except_trans). Else you need to use the
query language and the "D" modifier to specify
diacritics sensitivity. Default is no.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.AUTOCASESENS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.AUTOCASESENS"></a><span class="term"><code class="varname">autocasesens</code></span></dt>
<dd>
<p>auto-trigger case sensitivity (raw index
only). IF the index is not stripped (see
indexStripChars), decide if we automatically
trigger character case sensitivity if the search
term has upper-case characters in any but the
first position. Else you need to use the query
language and the "C" modifier to specify
character-case sensitivity. Default is yes.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MAXTERMEXPAND" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MAXTERMEXPAND"></a><span class="term"><code class="varname">maxTermExpand</code></span></dt>
<dd>
<p>Maximum query expansion count for a single
term (e.g.: when using wildcards). This only
affects queries, not indexing. We used to not
limit this at all (except for filenames where the
limit was too low at 1000), but it is
unreasonable with a big index. Default 10000.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MAXXAPIANCLAUSES"
id="RCL.INSTALL.CONFIG.RECOLLCONF.MAXXAPIANCLAUSES">
</a><span class="term"><code class=
"varname">maxXapianClauses</code></span></dt>
<dd>
<p>Maximum number of clauses we add to a single
Xapian query. This only affects queries, not
indexing. In some cases, the result of term
expansion can be multiplicative, and we want to
avoid eating all the memory. Default 50000.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.SNIPPETMAXPOSWALK"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.SNIPPETMAXPOSWALK"></a><span class="term"><code class="varname">snippetMaxPosWalk</code></span></dt>
<dd>
<p>Maximum number of positions we walk while
populating a snippet for the result list. The
default of 1,000,000 may be insufficient for very
big documents, the consequence would be snippets
with possibly meaning-altering missing words.</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.PDF" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.PDF"></a>6.4.2.7.&nbsp;Parameters
for the PDF input script</h4>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><a name="RCL.INSTALL.CONFIG.RECOLLCONF.PDFOCR"
id=
"RCL.INSTALL.CONFIG.RECOLLCONF.PDFOCR"></a><span class="term"><code class="varname">pdfocr</code></span></dt>
<dd>
<p>Attempt OCR of PDF files with no text content
if both tesseract and pdftoppm are installed. The
default is off because OCR is so very slow.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.PDFATTACH" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.PDFATTACH"></a><span class="term"><code class="varname">pdfattach</code></span></dt>
<dd>
<p>Enable PDF attachment extraction by executing
pdftk (if available). This is normally disabled,
because it does slow down PDF indexing a bit even
if not one attachment is ever found.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.PDFEXTRAMETA" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.PDFEXTRAMETA"></a><span class="term"><code class="varname">pdfextrameta</code></span></dt>
<dd>
<p>Extract text from selected XMP metadata tags.
This is a space-separated list of qualified XMP
tag names. Each element can also include a
translation to a Recoll field name, separated by
a '|' character. If the second element is absent,
the tag name is used as the Recoll field names.
You will also need to add specifications to the
'fields' file to direct processing of the
extracted data.</p>
</dd>
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.PDFEXTRAMETAFIX" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.PDFEXTRAMETAFIX"></a><span class="term"><code class="varname">pdfextrametafix</code></span></dt>
<dd>
<p>Define name of XMP field editing script. This
defines the name of a script to be loaded for
editing XMP field values. The script should
define a 'MetaFixer' class with a metafix()
method which will be called with the qualified
tag name and value of each selected field, for
editing or erasing. A new instance is created for
each document, so that the object can keep state
for, e.g. eliminating duplicate values.</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.SPECLOCATIONS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.SPECLOCATIONS"></a>6.4.2.8.&nbsp;Parameters
set for specific locations</h4>
</div>
</div>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt><a name=
"RCL.INSTALL.CONFIG.RECOLLCONF.MHMBOXQUIRKS" id=
"RCL.INSTALL.CONFIG.RECOLLCONF.MHMBOXQUIRKS"></a><span class="term"><code class="varname">mhmboxquirks</code></span></dt>
<dd>
<p>Enable thunderbird/mozilla-seamonkey mbox
format quirks Set this for the directory where
the email mbox files are stored.</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.CONFIG.FIELDS" id=
"RCL.INSTALL.CONFIG.FIELDS"></a>6.4.3.&nbsp;The
fields file</h3>
</div>
</div>
</div>
<p>This file contains information about dynamic fields
handling in <span class="application">Recoll</span>. Some
very basic fields have hard-wired behaviour, and, mostly,
you should not change the original data inside the
<code class="filename">fields</code> file. But you can
create custom fields fitting your data and handle them
just like they were native ones.</p>
<p>The <code class="filename">fields</code> file has
several sections, which each define an aspect of fields
processing. Quite often, you'll have to modify several
sections to obtain the desired behaviour.</p>
<p>We will only give a short description here, you should
refer to the comments inside the default file for more
detailed information.</p>
<p>Field names should be lowercase alphabetic ASCII.</p>
<div class="variablelist">
<dl class="variablelist">
<dt><span class="term">[prefixes]</span></dt>
<dd>
<p>A field becomes indexed (searchable) by having a
prefix defined in this section. There is a more
complete explanation of what prefixes are in used
by a standard recoll installation. In a nutshell:
extension prefixes should be all caps, begin with
XY, and short. E.g. XYMFLD.</p>
</dd>
<dt><span class="term">[values]</span></dt>
<dd>
<p>Fields listed in this section will be stored as
<span class="application">Xapian</span>
<code class="literal">values</code> inside the
index. This makes them available for range queries,
allowing to filter results according to the field
value. This feature currently supports string and
integer data. See the comments in the file for more
detail</p>
</dd>
<dt><span class="term">[stored]</span></dt>
<dd>
<p>A field becomes stored (displayable inside
results) by having its name listed in this section
(typically with an empty value).</p>
</dd>
<dt><span class="term">[aliases]</span></dt>
<dd>
<p>This section defines lists of synonyms for the
canonical names used inside the <code class=
"literal">[prefixes]</code> and <code class=
"literal">[stored]</code> sections</p>
</dd>
<dt><span class="term">[queryaliases]</span></dt>
<dd>
<p>This section also defines aliases for the
canonic field names, with the difference that the
substitution will only be used at query time,
avoiding any possibility that the value would
pick-up random metadata from documents.</p>
</dd>
<dt><span class="term">handler-specific
sections</span></dt>
<dd>
<p>Some input handlers may need specific
configuration for handling fields. Only the email
message handler currently has such a section (named
<code class="literal">[mail]</code>). It allows
indexing arbitrary email headers in addition to the
ones indexed by default. Other such sections may
appear in the future.</p>
</dd>
</dl>
</div>
<p>Here follows a small example of a personal
<code class="filename">fields</code> file. This would
extract a specific email header and use it as a
searchable field, with data displayable inside result
lists. (Side note: as the email handler does no decoding
on the values, only plain ascii headers can be indexed,
and only the first occurrence will be used for headers
that occur several times).</p>
<pre class="programlisting">[prefixes]
# Index mailmytag contents (with the given prefix)
mailmytag = XMTAG
[stored]
# Store mailmytag inside the document data record (so that it can be
# displayed - as %(mailmytag) - in result lists).
mailmytag =
[queryaliases]
filename = fn
containerfilename = cfn
[mail]
# Extract the X-My-Tag mail header, and use it internally with the
# mailmytag field name
x-my-tag = mailmytag
</pre>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.FIELDS.XATTR" id=
"RCL.INSTALL.CONFIG.FIELDS.XATTR"></a>6.4.3.1.&nbsp;Extended
attributes in the fields file</h4>
</div>
</div>
</div>
<p><span class="application">Recoll</span> versions
1.19 and later process user extended file attributes as
documents fields by default.</p>
<p>Attributes are processed as fields of the same name,
after removing the <code class="literal">user</code>
prefix on Linux.</p>
<p>The <code class="literal">[xattrtofields]</code>
section of the <code class="filename">fields</code>
file allows specifying translations from extended
attributes names to <span class=
"application">Recoll</span> field names. An empty
translation disables use of the corresponding attribute
data.</p>
</div>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.CONFIG.MIMEMAP" id=
"RCL.INSTALL.CONFIG.MIMEMAP"></a>6.4.4.&nbsp;The
mimemap file</h3>
</div>
</div>
</div>
<p><code class="filename">mimemap</code> specifies the
file name extension to MIME type mappings.</p>
<p>For file names without an extension, or with an
unknown one, a system command (<span class=
"command"><strong>file</strong></span> <code class=
"option">-i</code>, or <span class=
"command"><strong>xdg-mime</strong></span>) will be
executed to determine the MIME type (this can be switched
off, or the command changed inside the main configuration
file).</p>
<p>All extension values in <code class=
"filename">mimemap</code> must be entered in lower case.
File names extensions are lower-cased for comparison
during indexing, meaning that an upper case <code class=
"filename">mimemap</code> entry will never be
matched.</p>
<p>The mappings can be specified on a per-subtree basis,
which may be useful in some cases. Example: <span class=
"application">okular</span> notes have a <code class=
"filename">.xml</code> extension but should be handled
specially, which is possible because they are usually all
located in one place. Example:</p>
<pre class="programlisting">
[~/.kde/share/apps/okular/docdata]
.xml = application/x-okular-notes</pre>
<p>The <code class="varname">recoll_noindex</code>
<code class="filename">mimemap</code> variable has been
moved to <code class="filename">recoll.conf</code> and
renamed to <code class=
"varname">noContentSuffixes</code>, while keeping the
same function, as of <span class=
"application">Recoll</span> version 1.21. For older
<span class="application">Recoll</span> versions, see the
documentation for <code class=
"varname">noContentSuffixes</code> but use <code class=
"varname">recoll_noindex</code> in <code class=
"filename">mimemap</code>.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.CONFIG.MIMECONF" id=
"RCL.INSTALL.CONFIG.MIMECONF"></a>6.4.5.&nbsp;The
mimeconf file</h3>
</div>
</div>
</div>
<p><code class="filename">mimeconf</code> specifies how
the different MIME types are handled for indexing, and
which icons are displayed in the <span class=
"command"><strong>recoll</strong></span> result
lists.</p>
<p>Changing the parameters in the [index] section is
probably not a good idea except if you are a <span class=
"application">Recoll</span> developer.</p>
<p>The [icons] section allows you to change the icons
which are displayed by <span class=
"command"><strong>recoll</strong></span> in the result
lists (the values are the basenames of the png images
inside the <code class="filename">iconsdir</code>
directory (specified in <code class=
"filename">recoll.conf</code>).</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.CONFIG.MIMEVIEW" id=
"RCL.INSTALL.CONFIG.MIMEVIEW"></a>6.4.6.&nbsp;The
mimeview file</h3>
</div>
</div>
</div>
<p><code class="filename">mimeview</code> specifies which
programs are started when you click on an <span class=
"guilabel">Open</span> link in a result list. Ie: HTML is
normally displayed using <span class=
"application">firefox</span>, but you may prefer
<span class="application">Konqueror</span>, your
<span class="application">openoffice.org</span> program
might be named <span class=
"command"><strong>oofice</strong></span> instead of
<span class="command"><strong>openoffice</strong></span>
etc.</p>
<p>Changes to this file can be done by direct editing, or
through the <span class=
"command"><strong>recoll</strong></span> GUI preferences
dialog.</p>
<p>If <span class="guilabel">Use desktop preferences to
choose document editor</span> is checked in the
<span class="application">Recoll</span> GUI preferences,
all <code class="filename">mimeview</code> entries will
be ignored except the one labelled <code class=
"literal">application/x-all</code> (which is set to use
<span class="command"><strong>xdg-open</strong></span> by
default).</p>
<p>In this case, the <code class=
"literal">xallexcepts</code> top level variable defines a
list of MIME type exceptions which will be processed
according to the local entries instead of being passed to
the desktop. This is so that specific <span class=
"application">Recoll</span> options such as a page number
or a search string can be passed to applications that
support them, such as the <span class=
"application">evince</span> viewer.</p>
<p>As for the other configuration files, the normal usage
is to have a <code class="filename">mimeview</code>
inside your own configuration directory, with just the
non-default entries, which will override those from the
central configuration file.</p>
<p>All viewer definition entries must be placed under a
<code class="literal">[view]</code> section.</p>
<p>The keys in the file are normally MIME types. You can
add an application tag to specialize the choice for an
area of the filesystem (using a <code class=
"varname">localfields</code> specification in
<code class="filename">mimeconf</code>). The syntax for
the key is <em class=
"replaceable"><code>mimetype</code></em><code class=
"literal">|</code><em class=
"replaceable"><code>tag</code></em></p>
<p>The <code class="varname">nouncompforviewmts</code>
entry, (placed at the top level, outside of the
<code class="literal">[view]</code> section), holds a
list of MIME types that should not be uncompressed before
starting the viewer (if they are found compressed, ie:
<em class=
"replaceable"><code>mydoc.doc.gz</code></em>).</p>
<p>The right side of each assignment holds a command to
be executed for opening the file. The following
substitutions are performed:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p><b>%D.&nbsp;</b>Document date</p>
</li>
<li class="listitem">
<p><b>%f.&nbsp;</b>File name. This may be the name
of a temporary file if it was necessary to create
one (ie: to extract a subdocument from a
container).</p>
</li>
<li class="listitem">
<p><b>%i.&nbsp;</b>Internal path, for subdocuments
of containers. The format depends on the container
type. If this appears in the command line,
<span class="application">Recoll</span> will not
create a temporary file to extract the subdocument,
expecting the called application (possibly a
script) to be able to handle it.</p>
</li>
<li class="listitem">
<p><b>%M.&nbsp;</b>MIME type</p>
</li>
<li class="listitem">
<p><b>%p.&nbsp;</b>Page index. Only significant for
a subset of document types, currently only PDF,
Postscript and DVI files. Can be used to start the
editor at the right page for a match or
snippet.</p>
</li>
<li class="listitem">
<p><b>%s.&nbsp;</b>Search term. The value will only
be set for documents with indexed page numbers (ie:
PDF). The value will be one of the matched search
terms. It would allow pre-setting the value in the
"Find" entry inside Evince for example, for easy
highlighting of the term.</p>
</li>
<li class="listitem">
<p><b>%u.&nbsp;</b>Url.</p>
</li>
</ul>
</div>
<p>In addition to the predefined values above, all
strings like <code class="literal">%(fieldname)</code>
will be replaced by the value of the field named
<code class="literal">fieldname</code> for the document.
This could be used in combination with field
customisation to help with opening the document.</p>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.CONFIG.PTRANS" id=
"RCL.INSTALL.CONFIG.PTRANS"></a>6.4.7.&nbsp;The
<code class="filename">ptrans</code> file</h3>
</div>
</div>
</div>
<p><code class="filename">ptrans</code> specifies
query-time path translations. These can be useful in
<a class="link" href="#RCL.SEARCH.PTRANS" title=
"3.5.&nbsp;Path translations">multiple cases</a>.</p>
<p>The file has a section for any index which needs
translations, either the main one or additional query
indexes. The sections are named with the <span class=
"application">Xapian</span> index directory names. No
slash character should exist at the end of the paths (all
comparisons are textual). An exemple should make things
sufficiently clear</p>
<pre class="programlisting">
[/home/me/.recoll/xapiandb]
/this/directory/moved = /to/this/place
[/path/to/additional/xapiandb]
/server/volume1/docdir = /net/server/volume1/docdir
/server/volume2/docdir = /net/server/volume2/docdir
</pre>
</div>
<div class="sect2">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name=
"RCL.INSTALL.CONFIG.EXAMPLES" id=
"RCL.INSTALL.CONFIG.EXAMPLES"></a>6.4.8.&nbsp;Examples
of configuration adjustments</h3>
</div>
</div>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.EXAMPLES.ADDVIEW" id=
"RCL.INSTALL.CONFIG.EXAMPLES.ADDVIEW"></a>6.4.8.1.&nbsp;Adding
an external viewer for an non-indexed type</h4>
</div>
</div>
</div>
<p>Imagine that you have some kind of file which does
not have indexable content, but for which you would
like to have a functional <span class=
"guilabel">Open</span> link in the result list (when
found by file name). The file names end in <em class=
"replaceable"><code>.blob</code></em> and can be
displayed by application <em class=
"replaceable"><code>blobviewer</code></em>.</p>
<p>You need two entries in the configuration files for
this to work:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>In <code class=
"filename">$RECOLL_CONFDIR/mimemap</code>
(typically <code class=
"filename">~/.recoll/mimemap</code>), add the
following line:</p>
<pre class="programlisting">
.blob = application/x-blobapp
</pre>
<p>Note that the MIME type is made up here, and
you could call it <em class=
"replaceable"><code>diesel/oil</code></em> just
the same.</p>
</li>
<li class="listitem">
<p>In <code class=
"filename">$RECOLL_CONFDIR/mimeview</code> under
the <code class="literal">[view]</code> section,
add:</p>
<pre class="programlisting">
application/x-blobapp = blobviewer %f
</pre>
<p>We are supposing that <em class=
"replaceable"><code>blobviewer</code></em> wants
a file name parameter here, you would use
<code class="literal">%u</code> if it liked URLs
better.</p>
</li>
</ul>
</div>
<p>If you just wanted to change the application used by
<span class="application">Recoll</span> to display a
MIME type which it already knows, you would just need
to edit <code class="filename">mimeview</code>. The
entries you add in your personal file override those in
the central configuration, which you do not need to
alter. <code class="filename">mimeview</code> can also
be modified from the Gui.</p>
</div>
<div class="sect3">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name=
"RCL.INSTALL.CONFIG.EXAMPLES.ADDINDEX" id=
"RCL.INSTALL.CONFIG.EXAMPLES.ADDINDEX"></a>6.4.8.2.&nbsp;Adding
indexing support for a new file type</h4>
</div>
</div>
</div>
<p>Let us now imagine that the above <em class=
"replaceable"><code>.blob</code></em> files actually
contain indexable text and that you know how to extract
it with a command line program. Getting <span class=
"application">Recoll</span> to index the files is easy.
You need to perform the above alteration, and also to
add data to the <code class="filename">mimeconf</code>
file (typically in <code class=
"filename">~/.recoll/mimeconf</code>):</p>
<div class="itemizedlist">
<ul class="itemizedlist" style=
"list-style-type: disc;">
<li class="listitem">
<p>Under the <code class="literal">[index]</code>
section, add the following line (more about the
<em class="replaceable"><code>rclblob</code></em>
indexing script later):</p>
<pre class="programlisting">
application/x-blobapp = exec rclblob</pre>
<p>Or if the files are mostly text and you don't
need to process them for indexing:</p>
<pre class="programlisting">
application/x-blobapp = internal text/plain</pre>
</li>
<li class="listitem">
<p>Under the <code class="literal">[icons]</code>
section, you should choose an icon to be
displayed for the files inside the result lists.
Icons are normally 64x64 pixels PNG files which
live in <code class=
"filename">/usr/share/recoll/images</code>.</p>
</li>
<li class="listitem">
<p>Under the <code class=
"literal">[categories]</code> section, you should
add the MIME type where it makes sense (you can
also create a category). Categories may be used
for filtering in advanced search.</p>
</li>
</ul>
</div>
<p>The <em class=
"replaceable"><code>rclblob</code></em> handler should
be an executable program or script which exists inside
<code class=
"filename">/usr/share/recoll/filters</code>. It will be
given a file name as argument and should output the
text or html contents on the standard output.</p>
<p>The <a class="link" href="#RCL.PROGRAM.FILTERS"
title=
"5.1.&nbsp;Writing a document input handler">filter
programming</a> section describes in more detail how to
write an input handler.</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>