File: SWISH-CONFIG.pod

package info (click to toggle)
swish-e 2.4.3-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,308 kB
  • ctags: 7,642
  • sloc: ansic: 47,402; sh: 8,508; perl: 5,281; makefile: 723; xml: 9
file content (2762 lines) | stat: -rw-r--r-- 86,754 bytes parent folder | download | duplicates (2)
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
=head1 NAME

SWISH-CONFIG - Configuration File Directives

=head1 Swish-e CONFIGURATION FILE

What files Swish-e indexes and how they are indexed, and where the index
is written can be controlled by a configuration file.

The configuration file is a text file composed of comments, blank
lines, and B<configuration directives>.  The order of the directives
is not important.  Some directives may be used more than once in the
configuration file, while others can only be used once (e.g. additional
directives will overwrite preceding directives).  Case of the directive
is not important -- you may use upper, lower, or mixed case.

Comments are any line that begin with a "#".

    # This is a comment

As of 2.4.3 lines may be continued by placing a backslas as the last character
on the line:

    IgnoreWords \
        am \
        the \
        foo


Directives may take more than one parameter.  Enclose single parameters
that include whitespace in quotes (single or double).  Inside of quotes
the backslash escapes the next character.

    ReplaceRules append "foo bar"   <- define "foo bar" as a single parameter

If you need to include a quote character in the value either use a
backslash to escape it, or enclose it in quotes of the other type.

For example, under unix you can use quotes to include white space in a
single parameter.  Here, to protect against path names (%p) that might
have white space embedded use single quotes (this also protects against
shell expansion or metacharacters):

    FileFilter .foo foofilter "'%p'"  <- parameter passed through the shell in single quotes
    FileFilter .foo foofilter '"%p"'  <- windows uses double-quotes
    FileFilter .foo foofilter '\'%p\''<- silly example


Backslashes also have special meaning in regular expressions.

    FileFilterMatch pdftotext "'%p' -" /\.pdf$/

This says that the dot is a real dot (instead of matching any character).
If you place the regular expression in quotes then you must use
double-backslashes.

    FileFilterMatch pdftotext "'%p' -" "/\\.pdf$/"

Swish-e will convert the double backslash into a single backslash before
passing the parameter to the regular expression compiler.

Commented example configuration files are included in the F<conf>
directory of the Swish-e distribution.

Some command line arguments can override directives specified in the
configuration file.  Please see also the L<SWISH-RUN|SWISH-RUN> for
instructions on running Swish-e, and the L<SWISH-SEARCH|SWISH-SEARCH> page for
information and examples on how to search your index.

The configuration file is specified to Swish-e by the C<-c> switch.  For
example,

    swish-e -c myconfig.conf

You may also split your directives up into different configuration files.  This
allows you to have a master configuration file used for many different indexes,
and smaller configuration files for each separate index.  You can specify the
different configuration files when running from the command line with the C<-c>
switch (see L<SWISH-RUN|SWISH-RUN>), or you may include other Configuration
file with the B<IncludeConfigFile> directive below.

Typically, in a configuration file the directives are grouped together in
some logical order -- that is, directives that control the source of the
documents would be grouped together first, and directives that control
how each document is filtered or its words index in another group of
directives. (The directives listed below are grouped in this order).

The configuration file directives are listed below in these groups:    

=over 4

=item *

L<"Administrative Headers Directives"> -- You may add administrative
information to the header of the index file.

=item *

L<"Document Source Directives"> -- Directives for selecting the source
documents and the location of the index file.

=item *

L<"Document Contents Directives"> -- Directives that control how a document
content is indexed.

=item *

L<"Directives for the File Access method only"> -- These directives are only
applicable to the File Access indexing method.

=item *

L<"Directives for the HTTP Access Method Only"> -- Likewise, these only apply
to the HTTP Access method.

=item *

L<"Directives for the prog Access Method Only"> -- These only apply to the prog
Access method.

=item *

L<"Document Filter Directives"> -- This is a special section that describes
using document filters with Swish-e.

=back

=head2 Alphabetical Listing of Directives

=over 4

=item *

C<AbsoluteLinks> [yes|NO]

=item *

C<BeginCharacters> *string of characters*

=item *

C<BumpPositionCounterCharacters> *string*

=item *

C<Buzzwords> [*list of buzzwords*|File: path]


=item *

C<ConvertHTMLEntities> [YES|no]

=item *

C<DefaultContents> [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]

=item *

C<Delay> *seconds*

=item *

C<DontBumpPositionOnEndTags> *list of names*

=item *

C<DontBumpPositionOnStartTags> *list of names*

=item *

C<EnableAltSearchSyntax>  [yes|NO]

=item *

C<EndCharacters> *string of characters*

=item *

C<EquivalentServer> *server alias*

=item *

C<ExtractPath> *metaname* [replace|remove|prepend|append|regex]

=item *

C<FileFilter> *suffix* *program* [options]

=item *

C<FileFilterMatch> *program* *options* *regex* [*regex* ...]

=item *

C<FileInfoCompression> [yes|NO]

=item *

C<FileMatch> [contains|is|regex] *regular expression*

=item *

C<FileRules> [contains|is|regex] *regular expression*

=item *

C<FuzzyIndexingMode> [NONE|Stemming|Soundex|Metaphone|DoubleMetaphone]

=item *

C<FollowSymLinks> [yes|NO]

=item *

C<HTMLLinksMetaName> *metaname*

=item *

C<IgnoreFirstChar> *string of characters*

=item *

C<IgnoreLastChar> *string of characters*

=item *

C<IgnoreLimit> *integer integer*

=item *

C<IgnoreMetaTags> *list of names*

=item *

C<IgnoreNumberChars> *list of characters*

=item *

C<IgnoreTotalWordCountWhenRanking> [YES|no]

=item *

C<IgnoreWords> [*list of stop words*|File: path]

=item *

C<ImageLinksMetaName> *metaname*

=item *

C<IncludeConfigFile>

=item *

C<IndexAdmin> *text*

=item *

C<IndexAltTagMetaName> *tagname*|as-text

=item *

C<IndexComments> [yes|NO]

=item *

C<IndexContents> [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]  *file
extensions*

=item *

C<IndexDescription> *text*

=item *

C<IndexDir> [URL|directories or files]

=item *

C<IndexFile> *path*

=item *

C<IndexName> *text*

=item *

C<IndexOnly> *list of file suffixes*

=item *

C<IndexPointer> *text*

=item *

C<IndexReport> [0|1|2|3]

=item *

C<MaxDepth> *integer*

=item *

C<MaxWordLimit> *integer*

=item *

C<MetaNameAlias> *meta name* *list of aliases*

=item *

C<MetaNames> *list of names*

=item *

C<MinWordLimit> *integer*

=item *

C<NoContents> *list of file suffixes*

=item *

C<obeyRobotsNoIndex> [yes|NO]

=item *

C<ParserWarnLevel> [0|1|2|3]

=item *

C<PreSortedIndex> *list of property names*

=item *

C<PropCompressionLevel> [0-9]

=item *

C<PropertyNameAlias> *property name* *list of aliases*

=item *

C<PropertyNames> *list of meta names*

=item *

C<PropertyNamesCompareCase> *list of meta names*

=item *

C<PropertyNamesIgnoreCase> *list of meta names*

=item *

C<PropertyNamesNoStripChars> *list of meta names*

=item *

C<PropertyNamesDate> *list of meta names*

=item *

C<PropertyNamesNumeric> *list of meta names*

=item *

C<PropertyNamesMaxLength> integer *list of meta names*

=item *

C<PropertyNamesSortKeyLength> integer *list of meta names*

=item *

C<ReplaceRules> [replace|remove|prepend|append|regex]

=item *

C<ResultExtFormatName>  name -x format string

=item *

C<SpiderDirectory> *path*

=item *

C<StoreDescription> [XML <tag>|HTML <meta>|TXT size]

=item *

C<"SwishProgParameters> *list of parameters*

=item *

C<SwishSearchDefaultRule>   [<AND-WORD>|<or-word>]

=item *

C<SwishSearchOperators> <and-word> <or-word> <not-word>

=item *

C<TmpDir> *path*

=item *

C<TranslateCharacters> [*string1 string2*|:ascii7:]

=item *

C<TruncateDocSize> *number of characters*

=item * 

C<UndefinedMetaTags> [error|ignore|INDEX|auto]

=item *

C<UndefinedXMLAttributes> [DISABLE|error|ignore|index|auto]

=item *

C<UseStemming> [yes|NO]

=item *

C<UseSoundex> [yes|NO]

=item *

C<UseWords> [*list of words*|File: path]

=item *

C<WordCharacters> *string of characters*

=item *

C<XMLClassAttributes> *list of XML attribute names*

=back

=head2 Directives that Control Swish

These configuration directives control the general behavior of Swish-e.

=over 4

=item IncludeConfigFile *path to config file*

This directive can be used to include configuration directives located
in another file.

    IncludeConfigFile /usr/local/swish/conf/site_config.config

=item IndexReport [0|1|2|3]

This is how detailed you want reporting while indexing. You can specify
numbers 0 to 3.  0 is totally silent, 3 is the most verbose.   The default
is 1.

This may be overridden from the command line via the C<-v> switch (see
L<SWISH-RUN|SWISH-RUN>).

=item ParserWarnLevel [0|1|2|3]

Sets the error level when using the libxml2 parser for XML and HTML.
libxml2 will point out structural errors in your documents.

    0 = no report
    1 = fatal errors
    2 = errors
    3 = warnings

The exception to this is UTF-8 to Latin-1 conversion errors are reported at
level 1.  This is because words may be indexed incorrectly in these cases.

Note that unlike other errors generated by Swish-e, these errors are
sent to stderr.

=item IndexFile *path*

Index file specifies the location of the generated index file.  If not
specified, Swish-e will create the file F<index.swish-e> in the current
directory.

    IndexFile /usr/local/swish/site.index

=item obeyRobotsNoIndex [yes|NO]

When enabled, Swish-e will not index any HTML file that contains:

    <meta name="robots" content="noindex">

The default is to ignore these meta tags and index the document.
This tag is described at http://www.robotstxt.org/wc/exclusion.html.

Note: This feature is only available with the libxml2 HTML parser.

Also, if you are using the libxml2 parser (HTML2 and XML2) then you can use the following
comments in your documents to prevent indexing:

       <!-- SwishCommand noindex -->
       <!-- SwishCommand index -->

and/or these may be used also:

       <!-- noindex -->
       <!-- index -->

For example, these are very helpful to prevent indexing of common headers, footers, and menus.


=back

B<NOTE>: This following items are currently not available.  These items
require Swish-e to parse the configuration file while searching.


=over 4

=item EnableAltSearchSyntax [yes|NO]

B<NOTE>: This following item is currently not available.

Enable alternate search syntax.  Allows the usage of a basic
"Altavista(c)", "Lycos(c)", etc. like search syntax.  This means a search
query can contain "+" and "-" as syntax parameter.

Example:

    swish-e -w "+word1 +word2 -word3  word4 word5"
    "+"  = following word has to be in all found documents
    "-"  = following word may not be in any document found
    " "  = following word will be searched in documents

=item SwishSearchOperators <and-word> <or-word> <not-word>

B<NOTE>: This following item is currently not available.

Using this config directive you can change the boolean search operators of
Swish-e, e.g. to adapt these to your language.
The default is:    AND  OR  NOT

Example (german):

    SwishSearchOperators   UND  ODER  NICHT

=item SwishSearchDefaultRule   [<AND-WORD>|<or-word>]

B<NOTE>: This following item is currently not available.

C<SwishSearchDefaultRule> defines the default Boolean operator to use if none
is specified between words or phrases.  The default is C<AND>.

The word you specify must match one of the available C<SwishSearchOperators>.

Example:

    SwishSearchOperators   UND  ODER  NICHT
    # Make it act like a web search engine
    SwishSearchDefaultRule ODER

=item ResultExtFormatName name -x format string

B<NOTE>: This following item is currently not available.

The output of Swish-e can be defined by specifying a format string with the
C<-x> command line argument.  Using C<ResultExtFormatName> you can assign a
predefined format string to a name.

Examples:

    ResultExtFormatName  moreinfo   "%c|%r|%t|%p|<author>|<publishyear>\n"

Then when searching you can specify the format string's name

    swish-e   ...  -x moreinfo  ...

See the C<-x> switch in L<SWISH-RUN|SWISH-RUN> for more information about
output formats.

=back


=head2 Administrative Headers Directives

Swish-e stores configuration information in the header of the index file.
This information can be retrieved while searching or by functions in
the Swish-e C library.  There are a number of fields available for your
own use.  None of these fields are required:

=over 4

=item IndexName *text*

=item IndexDescription *text*

=item IndexPointer *text*

=item IndexAdmin *text*

These variables specify information that goes into index files to help
users and administrators.  IndexName should be the name of your index,
like a book title.  IndexDescription is a short description of the index
or a URL pointing to a more full description.  IndexPointer should be
a pointer to the original information, most likely a URL.  IndexAdmin
should be the name of the index maintainer and can include name and email
information.  These values should not be more than 70 or so characters
and should be contained in quotes.  Note that the automatically generated
date in index files is in D/M/Y and 24-hour format.

Examples:

    IndexName "Linux Documentation"
    IndexDescription "This is an index of /usr/doc on our Linux machine." 
    IndexPointer http://localhost/swish/linux/index.html
    IndexAdmin webmaster


=back

=head2 Document Source Directives

These directives control I<what> documents are indexed and I<how> they are
accessed.  See also L<Directives for the File Access method only|/"Directives
for the File Access method only"> and L<Directives for the HTTP Access Method
Only|/"Directives for the HTTP Access Method Only"> for directives that are
specific to those access methods.


=over 4

=item IndexDir [directories or files|URL|external program]

IndexDir defines the source of the documents for Swish-e.  Swish-e
currently supports three file access methods: B<File system>, B<HTTP>
(also called B<spidering>), and B<prog> for reading files from an
external program.

The C<-S> command line argument is used to select the file access method.

    swish-e -c swish.config -S fs    - file system
    swish-e -c swish.config -S http  - internal http spider
    swish-e -c swish.config -S prog  - external program of any type

For the B<fs> method of access B<IndexDir> is a space-separated
list of files and directories to index.  Use a forward slash as the path
separator in MS Windows.

For the B<http> method the B<IndexDir> setting is a list of space-separated
URLs.

For the B<prog> method the B<IndexDir> setting is a list of space-separated
programs to run (which generate documents for swish to index).

You may specify more than one B<IndexDir> directive.

Any sub-directories of any listed directory will also be indexed.

Note: While I<processing> directories, Swish-e will ignore any files or
directories that begin with a dot (".").  You may index files or directories
that begin with a dot by specifying their name with C<IndexDir> or C<-i>.

Examples:

    # Index this directory an any subdirectories
    IndexDir /usr/local/home/http

    # Index the docs directory in current directory
    IndexDir ./docs

    # Index these files in the current directory
    IndexDir ./index.html ./page1.html ./page2.html
    # and index this directory, too
    IndexDir ../public_html

For the B<HTTP> method of access specify the URL's from which
you want the spidering to begin.

Example:

    IndexDir http://www.my-site.com/index.html
    IndexDir http://localhost/index.html

Obviously, using the B<HTTP> method to index is B<much> slower than indexing
local files.  Be well aware that some sites do not appreciate spidering and may
block your IP address.  You may wish to contact the remote site before
spidering their web site.  More information about spidering can be found in
L<Directives for the HTTP Access Method Only|/"Directives for the HTTP Access
Method Only"> below.

For the L<prog|SWISH-RUN/"item_prog"> method of access B<IndexDir> specifies
the path to the program(s) to execute.  The external program must correctly
format the documents being passed back to Swish-e.  Examples of external
programs are provided in the F<prog-bin> directory.

    IndexDir ./myprogram.pl

See L<prog|SWISH-RUN/"item_prog"> for details.


Note: Not all directives work with all methods.

=item NoContents *list of file suffixes*

Files with these suffixes will B<not> have their contents indexed,
but will have their path name (file name) indexed instead.

If the file's type is HTML or HTML2 (as set by C<IndexContents> or
C<DefaultContents>) then the file will be parsed for a HTML title and that
title will be indexed.  Note that you must set the file's type with
C<IndexContents> or C<DefaultContents>: C<.html> and C<.htm> are NOT type HTML
by default.  For example:

   IndexContents HTML* .htm .html

If a title is found, it will still be checked for C<FileRules title>, and the
file will be skipped if a match is found.  See C<FileRules>.

If the file's type is not HTML, or it is HTML and no title is found,
then the file's path will be indexed.

For example, this will allow searching by image file name.

    NoContents .gif .xbm .au .mov .mpg .pdf .ps

Note: Using this directive will B<not> cause files with those suffixes to be
indexed.  That is, if you use C<IndexOnly> to limit the types of files that are
indexed, then you must specify in C<IndexOnly> the same suffixes listed in
C<NoContents>.

This does B<not> work:

    # Wrong!
    IndexOnly .htm .html
    NoContents .gif .xbm .au .mov .mpg .pdf .ps

A C<-S prog> program may set the C<No-Contents:> header to enable this feature
for a specific document (although it would be smarter for the C<-S prog>
program to simply only send the pathname or title to be indexed.

=item ReplaceRules [replace|remove|prepend|append|regex]

ReplaceRules allows you to make changes to file pathnames before
they're indexed.  These changed file names or URLs will be returned in
search results.

For example, you may index your files locally (with the File system
indexing method), yet return a URL in search results.  This directive can
be used to map the file names to their respective URLs on your web server.

There are five operations you can specify: B<replace>, B<append>,
B<remove>, B<prepend>, and B<regex> They will parse the pathname in the
order you've typed these commands.

This directive uses C library regex.h regular expressions.

   replace "the string you want replaced" "what to change it to"
   remove "a string to remove"   
   prepend "a string to add before the result"
   append "a string to add after the result"
   regex  "/search string/replace string/options"

Remember, quotes are needed if an expression contains white space,
and backslashes have special meaning.

Regex is an Extended Regular Expression.  The first character found is 
the delimiter (but it's not smart enough to use matched chars such as [],
(), and {}).

The B<replace> string may use substitution variables:

    $0      the entire matched (sub)string
    $1-$9   returns patterns captured in "(" ")" pairs
    $`      the string before the matched pattern
    $'      the string after the matched pattern

The B<options> change the behavior of expression:

    i       ignore the case when matching
    g       repeat the substitution for the entire pattern

Examples:

    ReplaceRules replace testdir/ anotherdir/
    ReplaceRules replace [a-z_0-9]*_m.*\.html index.html

    ReplaceRules remove testdir/

    ReplaceRules prepend http://localhost/
    ReplaceRules append .html

    ReplaceRules regex  !^/web/(.+)/!http://$1.domain.com/!
    replaces a file path:
        /web/search/foo/index.html
    with
        http://search.domain.com/foo/index.html

    ReplaceRules regex  #^#http://localhost/www#
    ReplaceRules prepend http://localhost/www  (same thing)

    # Remove all extensions from C source files
    ReplaceRules remove .c     # ERROR! That "." is *any char*
    ReplaceRules remove \.c    # much better...

    ReplaceRules remove "\\.c" # if in quotes you need double-backslash!  
    ReplaceRules remove "\.c"  # ERROR! "\." -> "." and is *any char*


=item IndexContents [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]  *file extensions*

The C<IndexContents> directive assigns one of Swish-e's document parsers to a
document, based on the its extension.  Swish-e currently knows how to parse
TXT, HTML, and XML documents.

The XML2, HTML2, and TXT2 parsers are currently only available when
Swish-e is configured to use libxml2.

You may use XML*, HTML*, and TXT* to select the parser automatically.
If libxml2 is installed then it will be used to parse the content.  Otherwise,
Swish-e's internal parsers will be used.

Documents that are not assigned a parser with C<IndexContents> will, by
default, use the HTML2 parser if libxml2 is installed, otherwise will use
Swish-e's internal HTML parser.  The C<DefaultContents> directive may be used
to assign a parser to documents that do not match a file extension defined with
the C<IndexContents> directive.

Example:

    IndexContents HTML* .htm .html .shtml
    IndexContents TXT*  .txt .log .text
    IndexContents XML*  .xml

HTML* is the default type for all files, unless otherwise specified (and this
default can be changed by the B<DefaultContents> directive.  Swish-e parses
titles from HTML files, if available, and keeps track of the context of the
text for context searching (see C<-t> in L<SWISH-RUN|SWISH-RUN>).

If using filters (with the C<FileFilter> directive) to convert documents you
should include those extensions, too.  For example, if using a filter to
convert .pdf to .html, you need to tell Swish-e that .pdf should be indexed by
the internal HTML parser:

    FileFilter  .pdf   pdf2html
    IndexContent  HTML  .pdf

See also L<Document Filter Directives|/"Document Filter Directives">.

B<Note:> Some of this may be changed in the future to use content-types instead
of file extensions.  See L<SWISH-3.0|SWISH-3.0>

=item DefaultContents [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]

This sets the default parser for documents that are not specified in
B<IndexContents>. If not specified the default is HTML.

The XML2, HTML2, and TXT2 parsers are currently only available when
Swish-e is configured to use libxml2.

You may use XML*, HTML*, and TXT* to select the parser automatically.
If libxml2 is installed then it will be used to parse the content.  Otherwise,
Swish-e's internal parsers will be used.


Example:

    DefaultContents HTML

The C<DefaultContents> directive I<should> be used when spidering, as HTML
files may be returned without a file extension (such as when requesting a
directory and the default index.html is returned).


=item FileInfoCompression [yes|NO]

** This directive is currently not supported **

Setting B<FileInfoCompression> to C<yes> will compress the index file to save
disk space.  This may result in longer indexing times.  The default is C<no>.

Also see the C<-e> switch in L<SWISH-RUN|SWISH-RUN> for saving RAM during
indexing.


=back

=head2 Document Contents Directives

These directives control what information is extracted from your source
documents, and how that information is made available during searching.

=over 4

=item ConvertHTMLEntities [YES|no]

ASCII I<entities> can be converted automatically while indexing documents of
type HTML (not for HTML2).  For performance reasons you may wish to set this to
C<no> if your documents do not contain HTML entities.  The default is C<yes>.

If C<ConvertHTMLEntities> is set C<no> the entities will be indexed without
conversion.

B<NOTE:> Entities within XML files and files parsed with libxml2 (HTML2) are
converted regardless of this setting.

=item MetaNames *list of names*

META names are a way to define "fields" in your XML and HTML documents.  You
can use the META names in your queries to limit the search to just the words
contained in that META name of your document.  For example, you might have a
META tagged field in your documents called C<subjects> and then you can search
your documents for the word "foo" but only return documents where "foo" is
within the C<subjects> META tag.

    swish-e -w subjects=foo

(See also the C<-t> switch in L<SWISH-RUN|SWISH-RUN> for information about
I<context> searching in HTML documents.)

The B<MetaNames> directive is a space separated list.  For example:

    MetaNames meta1 meta2 keywords subjects

You may also use C<UndefinedMetaTags> to specify automatic extraction of meta
names from your HTML and XML documents, and also to ignore indexing content of
meta tags.

META tags can have two formats in your B<HTML> source documents:

    <META NAME="meta1" CONTENT="some content">

and (if using the HTML2/libxml2 parser)

    <meta1>
        some content
    </meta1>

But this second version is invalid HTML, and will generate a warning if
ParserWarningLevel is set (libxml2 only).

And in B<XML> documents, use the format:

    <meta1>
        Some Content
    </meta1>

Then you can limit your search to just META B<meta1> like this:

    swish-e -w 'meta1=(apples or oranges)'

You may nest the XML and the start/end tag versions:

    <keywords>
        <tag1>
            some content
        </tag1>
        <tag2>
            some other content
        </tag2>
    <keywords>

Then you can search in both tag2 and tag2 with:

    swish-e -w 'keywords=(query words)'

Swish-e indexes all text as some metaname.  The default is C<swishdefault>, so
these two queries are the same:

    swish-e -w foo
    swish-e -w swishdefault=foo

When indexing HTML Swish-e indexes the HTML title as default text, so
when searching Swish-e will find matches in both the HTML body and the
HTML title.  Swish also, by default, indexes content of meta tags.  So:

    swish-e -w foo

will find "foo" in the body, the title, or any meta tags.

Currently, there's no way to prevent Swish-e from indexing the title contents
along with the body contents, but see C<UndefinedMetaTags> for how to control
the indexing of meta tags.

If you would like to search just the title text, you may use:

    MetaNames swishtitle

This will index the title text separately under the built-in swish
internal meta name "swishtitle".  You may then search like

    swish-e -w foo  -- search for "foo" in title, body (and undefined meta tags)
    swish-e -w swishtitle=foo -- search for "foo" in title only

In addition to swishtitle, you can limit searches to documents' path with:

   MetaNames swishdocpath

Then to search for "foo" but also limit searches to documents that include
"manual" or "tutorial" in their path:

   swish-e -w foo swishdocpath=(manual or tutorial)

See also C<ExtractPath>.


=item MetaNameAlias *meta name* *list of aliases*

MetaNameAlias assigns aliases for a meta name.  For example, if your
documents contain meta tags "description", "summary", and "overview"
that all give a summary of your documents you could do this:

    MetaNames summary
    MetaNameAlias summary description overview

Then all three tags will get indexed as meta tag "summary".  You can
then search all the fields as:

    -w summary=foo

The Alias work at search time, too.  So these will also limit the search
to the "summary" meta name.

    -w description=foo
    -w overview=foo

=item MetaNamesRank integer *list of meta names*

You can assign a bias to metanames that will affect how ranking is
calculated.  The range of values is from -10 to +10, with zero being
no bias.

    MetaNamesRank 4 subject
    MetaNamesRank 3 swishdefault
    MetaNamesRank 2 author publisher
    MetaNamesRank -5 wrongwords

This feature is still considered experimental. If you use it, please send feedback
to the discussion list.

=item HTMLLinksMetaName *metaname*

Allows indexing of HTML links.  Normally, HTML links (href tags) are
not indexed by Swish-e.  This directive defines a metaname, and links
will be indexed under this meta name.

Example:

    HTMLLinksMetaName links

Now, to limit searches to files with a link to "home.html" do this:

    -w links='"home.html"'

The double quotes force a phrase search.    

To make Swish-e index links as normal text, you may use:

    HTMLLinksMetaName swishdefault

This feature is only available with the libxml2 HTML parser.    

=item ImageLinksMetaName *metaname*

Allows indexing of image links under a metaname.  Normally, image URLs
are not indexed.

Example:

    ImagesLinksMetaName images

Now, if you would like to find pages that include a nice image of a beach:

    -w images='beach'

To make Swish-e index links as normal text, you may use:

    ImageLinksMetaName swishdefault

This feature is only available with the libxml2 HTML parser.


=item IndexAltTagMetaName *tagname*|as-text

Allows indexing of images <IMG> ALT tag text.  Specify either a tag name which will be
used as a metaname, or the special text "as-text" which says to index the ALT text as
if it were plain text at the current location.

For example, by specifying a tag name:

   IndexAltTagMetaName bar

would make this markup:   

    <foo>
        <img src="/someimage.png" alt="Alt text here">
    </foo>

appear like

    <foo>
        <bar>Alt text here</bar>
    </foo>

Then the normal rules (C<MetaNames> and C<PropertyNames>) apply to how that
text is indexed.

If you use the special tag "as-text" then

    <foo>
        <img src="/someimage.png" alt="Alt text here">
    </foo>

simply becomes

    <foo>
        Alt text here
    </foo>

This feature is only available when using the libxml2 parser (HTML2 and XML2).    


=item AbsoluteLinks [yes|NO]

If this is set true then Swish-e will attempt to convert relative URIs
extracted from HTML documents for use with C<HTMLLinksMetaName> and
C<ImageLinksMetaName> into absolute URIs.  Swish-e will use any <BASE> tag
found in the document, otherwise it will use the file's pathname.  The pathname
used will be the pathname *after* C<ReplaceRules> has been applied to the
document's pathname.

For example, say you wish to index image links under the metaname
"images".

    ImageLinksMetaName images

If an image is located in http://localhost/vacations/france/index.html and
C<AbsoluteLinks> is set to no, then a image within that document:

     <img src="beach.jpeg">

will only index "beach.jpeg".

But, if you want more detail when searching, you can enable C<AbsoluteLinks>
and Swish-e will index "http://localhost/vacations/france/beach.jpeg".  You can
then look for images of beaches, but only in France:

    -w images=(beach and france)

This also means you can search for any images within France:

    -w images=(france)

This feature is only available with the libxml2 HTML parser.    

=item UndefinedMetaTags [error|ignore|INDEX|auto]

This directive defines the behavior of Swish-e during indexing when a
meta name is found but is B<not> listed in B<MetaNames>.  There are
four choices:


=over 2

=item UndefinedMetaTags error

If a meta name is found that is not listed in B<MetaNames>
then indexing will be halted and an error reported.

=item UndefinedMetaTags ignore

The contents of the meta tag are ignored and B<not> indexed unless a metaname
has been defined with the C<MetaNames> directive.

=item UndefinedMetaTags index

The contents of the meta tag are indexed, but placed in the
main index unless there's an enclosing metatag already in force. This
is the default.

=item UndefinedMetaTags auto

This method create meta tags automatically for HTML meta names
and XML elements.  Using this is the same as specifying all the meta
names explicitly in a B<MetaNames> directive.

=back

=item UndefinedXMLAttributes [DISABLE|error|ignore|index|auto]

This is similar to C<UndefinedMetaTags>, but only applies to XML documents
(parsed with libxml2).  This allows indexing of attribute content, and provides
a way to index the content under a metaname.  For example,
C<UndefinedXMLAttributes> can make

    <person age="23">
          John Doe
    </person>

look like the following to swish:

    <person>
        <person.age>
            23
        </person.age>
        John Doe
    </person>

What happens to the text "23" will depend on the setting of
C<UndefinedXMLAttributes>:    

=over 2

=item disable

XML attributes are not parsed and not indexed.  This is the default.

=item error

If the concatenated meta name (e.g. person.age) is not listed in
B<MetaNames> then indexing will be halted and an error reported.

=item ignore

The contents of the meta tag are ignored and B<not> indexed unless a metaname
has been defined with the C<MetaNames> directive.

=item index

The contents of the meta tag are indexed, but placed in the main index
unless there's an enclosing metatag already in force.

=item auto

This method will create meta tags from the combined element and attributes
(and XML Class name) This options should be used with caution as it can
generate a lot of metaname entries.

See also the example below C<XMLClassAttribues>.


=back

=item XMLClassAttributes *list of XML attribute names*

Combines an XML class name with the element name to make up a metaname.
For example:

    XMLClassAttributes class

    <person class="first">
        John
    </person>
    <person class="last">
        Doe
    </person>

Will appear to Swish-e as:

    <person>
        <person.first>
        John
        </person.first>
    </person>
    <person>
        <person.last>
        Doe
        </person.last>
    </person>

How the data is indexed depends on C<MetaNames> and C<UndefinedMetaTags>.

Here's an example using the following configuration which combines the two
directives C<XMLClassAttributes> and C<UndefinedXMLAttributes>.

    XMLClassAttributes class
    UndefinedMetaTags auto
    UndefinedXMLAttributes auto
    IndexContents XML2 .xml

The source XML file looks like:    

    <xml> <person class="student" phone="555-1212" age="102"> John </person>
    <person greeting="howdy">Bill</person> </xml>

Swish-e parses as:

    ./swish-e -c 2 -i 1.xml -T parsed_tags  parsed_text  -v 0
    Indexing Data Source: "File-System"

    <xml> (MetaName)

        <person> (MetaName)
            <person.student> (MetaName)
                <person.student.phone> (MetaName)
                    555-1212
                </person.student.phone> 
                <person.student.age> (MetaName)
                    102
                </person.student.age> 
                John
        </person> 

        <person> (MetaName)
            <person.greeting> (MetaName)
                howdy
            </person.greeting> 
            Bill
        </person> 

    </xml> 
    Indexing done!

One thing to note is that the first <person> block finds a class name
"student" so all metanames that are created from attributes use the
combined name "person.student".  The second <person> block doesn't contain
a "class" so, the attribute name is combined directly with the element
name (e.g. "person.greeting").

=item ExtractPath *metaname* [replace|remove|prepend|append|regex]

This directive can be used to index extracted parts of a document's path.
A common use would be to limit searches to specific areas of your
file tree.

The extracted string will be indexed under the specified meta name.

See C<ReplaceRules> for a description of the various pattern replacement
methods, but you will use the I<regex> method.

For example, say your file system (or web tree) was organized into departments:

    /web/sales/foo...
    /web/parts/foo...
    /web/accounting/foo...

And you wanted a way to limit searches to just documents under "sales".

    ExtractPath department regex !^/web/([^/]+)/.*$!$1!

Which says, extract out the department name (as substring $1) and index it as
meta name C<department>.  Then to limit a search to the sales department:

    swish-e -w foo AND department=sales

Note that the C<regex> method uses a substitution pattern, so to index only a
sub-string match the I<entire> document path in the regular expression, as
shown above.  Otherwise any part that is not matched will end up in the
substitution pattern.

See the C<ExtractPathDefault> option for a way to set a value if not patterns
match.

Although unlikely, you may use more than one C<ExtractPath> directive.  More
than one directive of the I<same> meta name will operate successively (in order
listed in the configuration file) on the path.  This allows you to use regular
expressions on the results of the previous pattern substitution (as if piping
the output from one expression to the patter of the next).

    ExtractPath foo regex !^(...).+$!$1!
    ExtractPath foo regex !^.+(.)$!$1!

So, the third letter is indexed as meta name "foo" if both patterns match.    

    ExtractPath foo regex !^X(...).+$!$1!
    ExtractPath foo regex !^.+(.)$!$1!

Now (not the "X"), if the first pattern doesn't match, the last character of
the path name is indexed.  You must be clear on this behavior if you are using
more than one C<ExtractPath> directive with the same metaname.

The document path operated on is the real path swish used to access the
document.  That is, the C<ReplaceRules> directive has no effect on the path
used with C<ExtractPath>.

The full path is used for each meta name if more than one C<ExtractPath>
directive is used.  That is, changes to the path used in C<ExtractPath foo> do
not affect the path used by C<ExtractPath bar>.

=item ExtractPathDefault *metaname* default_value

This can be used with C<ExtractPath> to set a default string to index under the
given metaname if none of the C<ExtractPath> patterns match.

For example, say your want to index each document with a metaname
"department" based on the following path examples:

    /web/sales/foo...
    /web/parts/foo...
    /web/accounting/foo...

But you are also indexing documents that do not follow that pattern and you want to search those
separately, too.

    ExtractPath department regex !^/web/([^/]+)/.*$!$1!
    ExtractPathDefault department other

Now, you may search like this:

    -w foo department=(sales)      - limit searches to the sales documents
    -w foo department=(parts)      - limit searches to the parts documents
    -w foo department=(accounting) - limit searches to the accounting documents
    -w foo department=(other)      - everything but sales, parts, and accounting.

This basically is a shortcut for:

    -w foo not department=(sales or parts or accounting)

but you don't need to keep track of what was extracted.    

=item PropertyNames *list of meta names*

=item PropertyNamesCompareCase *list of meta names*

=item PropertyNamesIgnoreCase *list of meta names*

Swish-e allows you to specify certain META tags that can be used as B<document
properties>.  The contents of any META tag that has been identified as a
document property can be returned as part of the search results along with the
rank, file name, title, and document size (see the C<-p> and C<-x> switches in
L<SWISH-RUN|SWISH-RUN>).

Properties are useful for returning additional data from documents in
search results -- this saves the effort of reading and parsing the source
files while reading Swish-e search results, and is especially useful
when the source documents are no longer available or slow to access
(e.g. over http).

Another feature of properties is that Swish-e can use the PropertyNames for
sorting the search results (see the C<-s> switch).

    PropertyNames author subjects

Two variations are available.  C<PropertyNamesCompareCase> and
C<PropertyNamesIgnoreCase>.  These tell Swish-e to either ignore or compare
case when sorting results.  The default for C<PropertyNames> is to ignore the
case.

    PropertyNamesIgnoreCase subject
    PropertyNamesCompareCase keyword

The defaults for "internal" properties are:

    swishtitle          --  ignore the case
    swishdocpath        --  compare case
    swishdescription    --  compare case

These can be overridden with C<PropertyNamesCompareCase> and
C<PropertyNamesIgnoreCase>.

    PropertyNamesCompareCase swishtitle    

Use of PropertyNames will increase the size of your index files, sometimes
significantly.  Properties will be compressed if Swish-e is compiled with zlib
as described in the L<INSTALL|INSTALL> manual page.

If Swish-e finds more than one property of the same name in a document
the property's contents will be concatinated for strings, and a warning
issues for numeric (or date) properties.

=item PropertyNamesNoStripChars

PropertyNamesNoStripChars specifies that the listed properties should not
have strings of low ASCII characters replaced with a space character.
Properties will be stored as found in the document.

When printing properties with the swish-e binary newlines are replaced with
a space character.  Use the swish-e library (or SWISH::API perl module) to
fetch properties without newlines replaced.


=item PropertyNamesNumeric

This directive is similar to C<PropertyNames>, but it flags the property as
being a string of digits (integer value) that will be stored as binary data
instead of a string.  This allows sorting with C<-s> and limiting with C<-L> to
sort and limit the property correctly.

Swish-e uses C<strtoul(3)> to convert the string into an unsigned long integer.
Therefore, only positive integers can be stored.

Future versions of Swish-e may be able to store different property types
(such as negative integers and real numbers).  This directive may change
in future releases of Swish.

=item PropertyNamesDate

This directive is exactly like C<PropertyNamesNumeric>, but it also flags the
number as a machine timestamp (seconds since Epoch), and will print a formatted
date when returning this property.  See C<-x> in L<SWISH-RUN|SWISH-RUN>.

Swish-e will not parse dates when indexing; you must use a timestamp.

=item PropertyNameAlias  *property name* *list of aliases*

This allows aliases for a property name.  For example, if you are indexing
HTML files, plus XML files that are written in English, German, and
Spanish and thus use the tags "title", "titel", and "ttulo" you can use:

    PropertyNameAlias swishtitle title titel ttulo titulo

Note that "swishtitle" is the built-in property used to store the title of
a document, and therefore you do not need to specify it as a PropertyName
before use.

=item PropertyNamesMaxLength  integer *list of meta names*

This option will set the max length of the text stored in a property.
You must specify a number between 0 and the max integer size on your
platform, and a list of properties.  The properties specified must not
be aliases.

If any of the property names do not exist they will be created (e.g. you
do not need to define the property with PropertyNames first).

In general, this feature will only be useful when parsing HTML or XML
with the libxml2 parser.

For example:

    PropertyNamesMaxLength 1000 swishdescription
    PropertyNameAlias swishdescription body

Is somewhat like

    StoreDescription HTML <body> 1000
    StoreDescription XML <body> 1000
    StoreDescription HTML2 <body> 1000
    StoreDescription XML2 <body> 1000

but StoreDescription allows setting the tag for each parser type.

    PropertyNamesMaxLength 1000 headings
    PropertyNameAlias headings h1 h2 h3 h4

collects all the heading text into a single property called "headings", not
to exceed 1000 characters.

=item PropertyNamesSortKeyLength  integer *list of meta names*

Sets the length of the string used when sorting.
The default is 100 characters.  The -T metanames debugging option will
list the current values for an index.

This setting is used when sorting during indexing, and perhaps when sorting
while searching.  It also effects the order when limiting to a range of values
with the -L option.

=item PreSortedIndex *list of property names*

By default Swish-e generates presorted tables while indexing for each
property name.  This allows faster sorting when generating results.
On large document collections this presorting may add to the indexing
time, and also adds to the total size of the index.  This directive can
be used to customize exactly which properties will be presorted.

If C<PreSortedIndex> it is I<not> present in the config file (default action),
all the properties will be presorted at indexing time.  If it is present
without any parameter, no properties will be presorted.  Otherwise, only the
property names specified will be presorted.

For example, if you only wish to sort results by a property called C<title>:

    PropertyNames title age time
    PreSortedIndex  title


=item StoreDescription [XML <tag> size|HTML <meta> size|TXT size]

B<StoreDescription> allows you to store a document description in the index
file.  This description can be returned in your search results when the C<-x>
switch is used to include the I<swishdescription> for extended results, or by
using C<-p swishdescription>.

The document type (XML, HTML and TXT) must match the document type currently
being indexed as set by C<IndexContents> or C<DefaultContents>.  See those
directives for possible values.  A common problem is using C<StoreDescription>
yet not setting the document's type with C<IndexContents> or
C<DefaultContents>.  Another problem is different types:

    IndexContents HTML2 .html
    StoreDescription HTML <body>

Then .html documents are assigned a type of HTML2 (and parsed by the libxml2 parser), but the
description will not be stored since it is type HTML instead of HTML2.

For text documents you specify the type TXT (or TXT2 or TXT*) and the number of I<characters> to capture.

    StoreDescription TXT 20

The above stores only the first twenty characters from the text file in the Swish-e index
file.

For HTML, and XML file types, specify the tag to use for the
description, and optionally the number of characters to capture.  If not
specified will capture the entire contents of the tag.

    StoreDescription HTML <body> 20000
    StoreDescription XML  <desc> 40

Again, note that documents must be assigned a document type with
C<IndexContents> or C<DefaultContents> to use this feature.

Swish-e will compress the descriptions (or any other large property) if
compiled to use zlib (see L<INSTALL|INSTALL>).  This is recommended when using
StoreDescription and a large number of documents.  Compression of 30% to 50% is
not uncommon with HTML files.

=item PropCompressionLevel [0-9]

This directive sets the compression level used when storing properties
to disk.  A setting of zero is no compression, and a setting of nine is
the most compression.

The default depends on the default setting compiled with zlib, but is
typically six.

This option is useful when using C<StoreDescription> to store a large amount
text in properties (or if using C<PropertyNames> with large property sizes).

Properties must be over a value defined in F<config.h> (100 is the
default) before compression will be attempted.  Swish-e will never store
the results of the compression if the compressed data is larger than
the original data.

This option is only available when Swish-e is compiled with zlib support.


=item TruncateDocSize *number of characters*

TruncateDocSize limits the size of a document while indexing documents
and/or using filters.  This config directive truncates the numbers of
read bytes of a document to the specified size.  This means: if a document
is larger, read only the specified numbers of bytes of the document.

Example:

    TruncateDocSize    10000000

The default is zero, which means read all data.


Warning: If you use TruncateDocSize, use it with care!  TruncateDocSize
is a safety belt only, to limit e.g.  filteroutput, when accessing
databases, or to limit "runnaway" filters.  Truncating doc input may
destroy document structures for Swish-e (e.g.  swish may miss closing
tags for XML or HTML documents).

TruncateDocSize does not currently work with the C<prog> input source method.

=item FuzzyIndexingMode NONE|Stemming|Soundex|Metaphone|DoubleMetaphone

Selects the type of index to create.  Only one type of index may be created.

It's a good idea to create both a normal index and a fuzzy index and
allow your search interface select which index to use.  Many people find the
fuzzy searches to be too fuzzy.

The available fuzzy indexing options can be displayed by running

   swish-e -T LIST_FUZZY_MODES

Available options include:

=over 4

=item None

Words are stored in the index without any conversion.  This is the default.

=item Stemming_*

This options uses one of the installed Snowball stemmers (http://snowball.tartarus.org/).

The installed stemmers can be viewed by running

   swish-e -T LIST_FUZZY_MODES

For example, to use the Spanish stemming module:

   FuzzyIndexingMode Stemming_es


=item Stem or Stemming_en

Selects the legacy Swish-e English stemmer.

This is deprecated in favor of the Snowball English stemmers (Stemming_en1, Stemming_en2). 
Future versions of Swish-e will likely use the Stemming_en2 stemmer by default.

Words are converted using the Porter stemming algorithm.

From: http://www.tartarus.org/~martin/PorterStemmer/

    The Porter stemming algorithm (or Porter stemmer) is a
    process for removing the commoner morphological and inflexional
    endings from words in English. Its main use is as part of a
    term normalisation process that is usually done when setting up
    Information Retrieval systems.


This will help a search for "running" to also find "run" and "runs", for example.

The stemming function does not convert words to their root, rather
programmatically removes endings on words in an attempt to make similar
words with different endings stem to the same string of characters.
It's not a perfect system, and searches on stemmed indexes often return
curious results.  For example, two entirely different words may stem to
the same word.

Stemming also can be confusing when used with a wildcard (truncation).
For example, you might expect to find the word "running" by searching for
"runn*".  But this fails when using a stemmed index, as "running" stems to
"run", yet searching for "runn*" looks for words that start with "runn".

=item Soundex

Soundex was developed in the 1880s so records for people with similar
sounding names could be found more readily.  Soundex is a coded surname
based on the way a surname sounds rather than spelling.  Surnames that
sound similar, like Smith and Smyth, are filed together under the same
Soundex code.  This is mostly useful for US English.

Soundex should not be used to search for sound-alike words.  Metaphone
would be more appropriate for generic sound matching of words.  Soundex
should only be used where you need to search multiple documents for
proper names which sound similar.  This is primarily used for indexing
genealogical records.  This may be useful for indexing other collections
of data consisting mostly of names.  Many common name variations are
matched by Soundex.  The only notable exception is the first letter of
the name.  The first letter is not matched for sound.

=item Metaphone and DoubleMetaphone

Words are transformed into a short series of letters representing the sound of the word (in English).
Metaphone algorithms are often used for looking up mis-spelled words in dictionary programs.

From: http://aspell.sourceforge.net/metaphone/

    Lawrence Philips' Metaphone Algorithm is an algorithm which returns
    the rough approximation of how an English word sounds.

The C<DoubleMetaphone> mode will sometimes generate two different metaphones
for the same word.  This is supposed to be useful when a word may be pronounced
more than one way.

A metaphone index should give results somewhere in between Soundex and Stemming.    

=back

=item UseStemming [yes|NO]

Put yes to apply word stemming algorithm during indexing, else no.

    UseStemming no
    UseStemming yes

When UseStemming is set to C<yes> every word is stemmed before placing it in to
the index.

This option is deprecated.  It has been superceded by C<FuzzyIndexingMode>.

=item UseSoundex [yes|NO]

When UseSoundex is set to C<yes> every word is converted to a Soundex code
before placing it in to the index.

This option is deprecated.  It has been superceded by C<FuzzyIndexingMode>.

=item IgnoreTotalWordCountWhenRanking [YES|no]

Put yes to ignore the total number of words in the file when calculating
ranking. Often better with merges and small files. Default is yes.

    IgnoreTotalWordCountWhenRanking no

The default was changed from no to yes in version 2.2.

B<NOTE:> must be set to B<no> if you intend to use the -R 1 option when
searching.

=item MinWordLimit *integer*

Set the minimum length of an word. Shorter words will not be indexed.
The default is 1 (as defined in F<src/config.h>).

    MinWordLimit 5

=item MaxWordLimit *integer*

Set the maximum length of an indexable word. Every longer word will not
be indexed.  The Default is 40 (as defined in F<src/config.h>).

=item WordCharacters *string of characters*

=item IgnoreFirstChar *string of characters*

=item IgnoreLastChar *string of characters*

=item BeginCharacters *string of characters*

=item EndCharacters *string of characters*


These settings define what a word consists of to the Swish-e indexing engine.
Compiled in defaults are in F<src/config.h>.

When indexing Swish-e uses B<WordCharacters> to split up the document
into words.  Words are defined by any string of non-blank characters
that contain only the characters listed in WordCharacters.  If a string
of characters includes a character that is not in WordCharacters then
the word will be spit into two or more separate words.

For example:

    WordCharacters abde

Would turn "abcde" into two words "ab" and "de".

Next, of these words, any characters defined in B<IgnoreFirstChar> are
stripped off the start of the word, and B<IgnoreLastChar> characters
are stripped off the end of the word.  This allows, for example,
periods within a word (www.slashdot.com), but not at the end of
a word.  Characters in IgnoreFirstChar and IgnoreLastChar must be in
WordCharacters.

Finally, the resulting words MUST begin with one of the characters
listed in B<BeginCharacters> and end with one of the characters listed in
B<EndCharacters>.  BeginCharacters and EndCharacters must be a subset of
the characters in WordCharacters.  Often, WordCharacters, BeginCharacters
and EndCharacters will all be the same.

Note that the same process applies to the query while searching.

Getting these settings correct will take careful consideration and practice.
It's helpful to create an index of a single test file, and then look at the
words that are placed in the index (see the C<-v 4>, C<-D> and C<-k> searching
switches).

Currently there is only support for eight-bit characters.

Example:

    WordCharacters  .abcdefghijklmnopqrstuvwxyz
    BeginCharacters abcdefghijklmnopqrstuvwxyz
    EndCharacters   abcdefghijklmnopqrstuvwxyz
    IgnoreFirstChar .
    IgnoreLastChar  .

So the string

    Please visit http://www.example.com/path/to/file.html.

will be indexed as the following words:

    please
    visit
    http
    www.example.com
    path
    to
    file.html

Which means that you can search for C<www.example.com> as a single word, but
searching for just C<example> will not find the document.

Note: when indexing HTML documents HTML entities are converted to their
character equivalents before being processed with these directives.  This is a
change from previous versions of Swish-e where you were required to include the
characters C<0123456789&#;> to index entities.  See also C<ConvertHTMLEntities>

=item Buzzwords [*list of buzzwords*|File: path]

The Buzzwords option allows you to specify words that will be indexed
regardless of WordCharacters, BeginCharacters, EndCharacters, stemming,
soundex and many of the other checks done on words while indexing.

Buzzwords are case insensitive.

Buzzwords should be separated by spaces and may span multiple directives.  If
the special format C<File:filename> is used then the Buzzwords will be read
from an external file during indexing.

Examples:

    Buzzwords C++ TCP/IP

    Buzzwords File: ./buzzwords.lst

If a Buzzword contains search operator characters they must be backslashed
when searching.  For example:

    Buzzwords C++ TCP/IP web=http

    ./swish-e -w 'web\=http'

Buzzwords are found by splitting the text on whitespace, removing
C<IgnoreFirstChar> and C<IgnoreLastChar> characters from the word, and then
comparing with the list of C<Buzzwords>.  Therefore, if adding C<Buzzwords> to
an index you will probably want to define C<IgnoreFirstChar> and
C<IgnoreLastChar> settings.

Note: Buzzwords specific settings for C<IgnoreFirstChar> and C<IgnoreLastChar>
may be used in the future.


=item IgnoreWords [*list of stop words*|File: path]

The IgnoreWords option allows you to specify words to ignore, called
I<stopwords>.  The default is to not use any stopwords.

Words should be separated by spaces and may span multiple directives.  If the
special format C<File:filename> is used then the stop words will be read from
an external file during indexing.

In previous versions of Swish-e you could use the directive

    IgnoreWords swishdefault - obsolete!

to include a default list of compiled in stopwords.  This keyword is no
longer supported.

Examples:

    IgnoreWords www http a an the of and or

    IgnoreWords File: ./stopwords.de

=item UseWords [*list of words*|File: path]

UseWords defines the words that Swish-e will index.  B<Only> the words
listed will be indexed.

You can specify a list of words following the directive (you may specify more
than one C<UseWords> directive in a config file), and/or use the C<File:> form
to specify a path to a file containing the words:

    UseWords perl python pascal fortran basic cobal php
    UseWords File: /path/to/my/wordlist

Please drop the Swish-e list a note if you actually use this feature.
It may be removed from future versions.

=item IgnoreLimit *integer integer*

This automatically omits words that appear too often in the files (these
words are called stopwords). Specify a whole percentage and a number,
such as "80 256". This omits words that occur in over 80% of the files
and appear in over 256 files. Comment out to turn off auto-stopwording.

    IgnoreLimit 50 1000

Swish-e must do extra processing to adjust the entire index when this
feature is used.  It is recommended that instead of using this feature
that you decided what words are stopwords and add them to B<IngoreWords>
in your configuration file.  To do this, use IgnoreLimit one time and
note the stop words that are found while indexing.  Add this list to
IgnoreWords, and then remove IgnoreLimit from the configuration file.

=item IgnoreMetaTags *list of names*

C<IgnoreMetaTags> defines a list of metatags to ignore while indexing XML files
(and HTML files if using libxml2 for parsing HTML).  All text within the tags
will be ignored -- both for indexing (C<MetaNames>) and properties
(C<PropertyNames>).  To still parse properties, yet do not index the text, see
C<UndefinedMetaTags>.

This option is useful to avoid indexing specific data from a file.
For example:

    <person>
        <first_name>
            William
        </first_name> <last_name>
            Shakespeare
        </last_name> <updated_date>
            April 25, 1999
        </updated_date>
    </person>

In the above example you might B<not> want to index the updated date,
and therefore prevent finding this record by searching

    -w 'person=(April)'

This is solved by:

    IgnoreMetaTags updated_date


See also C<UndefinedMetaTags>.

=item IgnoreNumberChars *list of characters*

Experimental Feature

This experimental feature can be used to define a set of characters that
describe a number.  If a word is found to contain only those characters it will
not be indexed.  The characters listed must be part of C<WordCharacters>
settings.  In other words, the "word" checked is a word that Swish-e would
otherwise index.

For example,

    IgnoreNumberChars 0123456789$.,

Then Swish-e would not index the following:

    123
    123,456.78
    $123.45

You might be tempted to avoid indexing hex numbers with:

    IgnoreNumberChars 0123456789abcdef

which will not index 0D31, but will also not index the word "bad".

This is an experimental feature that may change in future versions.
One possible change is to use regular expressions instead.


=item IndexComments [NO|yes]

This option allows the user decide if to index the contents of HTML
comments.  Default is no. Set to yes if comment indexing is required.

    IndexComments yes

Note: This is a change in the default behavior prior to version 2.2.

=item TranslateCharacters [*string1 string2*|:ascii7:]

The TranslateCharacters directive maps the characters in string1 to the
characters listed in string2.

For example:

    # This will index a_b as a-b and mo as amo
    TranslateCharacters _ -a

C<TranslateCharacters :ascii7:> is a predefined set of characters that will
translate eight bit characters to ascii7 characters.  Using the :ascii7: rule
will translate "" to "aac". This means: searching "elik", "elik" or
"celik" will all match the same word.

TranslateCharacters is done early in the indexing process, after
converting HTML entities but before splitting the input text into words
based on B<WordCharacters>.  So characters you are translating I<from>
do not need to be listed in word characters.

The same character translations take place when searching.

=item BumpPositionCounterCharacters *string*

When indexing Swish-e assigns a word position to each word.  This enables
phrase searching.  There may be cases where you would like to prevent
phrase matching.  The BumpPositionCounterCharacters directive allows
you to specify a set of characters that when found in the text will
increment the word position -- effectively preventing phrase matches
across that character.

For example, if you have a tag:

    <subjects>
        computer programming | apple computers
    </subjects>

You might want to prevent matching "programming apple" in that meta name.

    BumpPositionCounterCharacters |

There is no default, and you may list a string of characters.

=item DontBumpPositionOnEndTags *list of names*

=item DontBumpPositionOnStartTags *list of names*

Since metatags are typically separate data fields, the word position counter is
automatically bumped between metatags (actually, bumped when a start tag is
found and when an end tag is found).  This prevents matching a phrase that
spans more than one metaname.  C<DontBumpPositionOnEndTags> and
C<DontBumpPositionOnStartTags> disables this feature for the listed metanames.

For example,

    <person>
        <first_name>
            William
        </first_name>
        <last_name>
            Shakespeare
        </last_name>
        <updated_date>
            April 25, 1999
        </updated_date>
    </person>

In the configuration file:

    DontBumpPositionOnEndTags first_name
    DontBumpPositionOnStartTags last_name

This configuration allows this phrase search

    -w 'person=("william shakespeare")'

but this phrase search will fail

    -w 'person=("shakespeare april")'



=back


=head2 Directives for the File Access method only

Some directives have different uses depending on the source of the
documents.  These directives are only valid when using the B<File system>
method of indexing.

=over 4

=item IndexOnly *list of file suffixes*

This directive specifies the allowable file suffixes (extensions) while
indexing.  The default is to index all files specified in B<IndexDir>.

    # Only index .html .htm and .q files
    IndexOnly .html .htm .q

C<IndexOnly> checks that the file end in the characters listed.  It does not
check "extensions".  C<IndexOnly> is tested right before C<FileRules> is
processed.

=item FollowSymLinks [yes|NO]

Put "yes" to follow symbolic links in indexing, else "no".  Default is no.

    FollowSymLinks no
    FollowSymLinks yes

Note that when set to C<no> extra stat(2) system calls must be made for each
file.  For large number of files you may see a small reduction in indexing time
by setting this to C<yes>.

See also the C<-l> switch in L<SWISH-RUN|SWISH-RUN>.

=item FileRules [type] [contains|is|regex] *regular expression*

=item FileMatch [type] [contains|is|regex] *regular expression*

FileRules and FileMatch are used to, respectively, exclude and include files
and directories to index.  Since, by default, Swish-e indexes all files and
recurses all directories (but see also C<FollowSymLinks>) you will typically
only use C<FileRules> to exclude files or directories.  C<FileMatch> is useful
in a few cases, for example, to override the behavior of C<IndexOnly>.  Some
examples are included below.

Except for C<FileRules title ...>, this feature is only available for file
access method (-S fs), which is the default indexing mode.  Also, any pathname
modification with C<ReplaceRules> happens after the check for C<FileRules>.
(It's unlikely that you would exclude files with C<FileRules> based on text you
added with C<ReplaceRules>!)

The regular expression is a C regex.h extended regular expression.
You may supply more than one regular expression per line, or use
separate directives.  Preceding the regular expression with the word
"not" negates the match.

The regular expression is compared against B<[type]> as described below.

For historical reasons, you can specify C<contains> or C<is>.  C<is> simply
forces the regular expression to match at the start and end of the string (by
internally prepending "^" and appending "$" to the regular expression).

The C<regex> option requires delimiter characters:

    FileRules title regex /^private/i

The only advantage of C<regex> is if you want to do case insensitive matches,
or simply like your regular expressions to look like perl regular expressions.
You must use matching delimiters; (), {}, and [], are not currently supported
for no good reason other than laziness.

Use quotes (" or ') around a pattern if it contains any white space.
Note that the backslash character becomes the escape character within
quotes.

For example, these sets generate the same regular expressions.

    FileRules title is hello
    FileRules title contains ^hello$
    FileRules title regex /^hello$/

These all need quotes due to the included space character

    FileRules title is "hello there"
    FileRules title contains "^hello there$"
    FileRules title regex "!^hello there$!"

These show how the backslash must be doubled inside of quotes.
Swish-e converts a double-backslash into a single backslash, and then
passes that single onto the regular expression compiler.

    FileRules filename regex /\.pdf/
    FileRules filename regex "/\\.pdf/"

    FileRules filename regex !hello\\there!     # need double for real backslash 
    FileRules filename regex "!hello\\\\there!" # need double-double inside of quotes


B<Matching Types>

The following types of match strings my be supplied:

    FileRules pathname
    FileRules dirname
    FileRules filename
    FileRules directory
    FileRules title

    FileMatch pathname
    FileMatch filename
    FileMatch dirname
    FileMatch directory

B<pathname> matches the regular expression against the current pathname.  The
pathname may or may not be absolute depending on what you supplied to
C<IndexDir>.

Example:

    # Don't index paths that contain private or hidden
    FileRules pathname contains (private|hidden)

    # Same thing
    FileRules pathname regex /(private|hidden)/

    # Don't index exe files
    FileRules pathname contains \.exe$

B<dirname> and B<filename> split the path name by the last delimiter
character into a directory name, and a file name.  Then these are compared
against the patterns supplied.  Directory names do B<not> have a trailing
slash.  All path names use the forward slash as a delimiter within Swish-e.

Example:

    # Same as last example - don't index *.exe files.
    FileRules filename contains \.exe$

    # Don't index any file called test.html files
    FileRules filename contains ^test\.html$

    # Same thing
    FileRules filename is test\.html

    # Don't index any directories that contain "old"  (/usr/local/myold/docs)
    FileRules dirname contains old

    # Don't index any directories that contain the path segment "old" (/usr/local/old/foo)
    FileRules dirname contains /old/  

    # Index only .htm, .html, plus any all-digit file names
    IndexOnly .htm .html
    FileMatch filename contains ^\d+$

    # Same as previous, but maybe a little slower
    FileRules filename regex not !\.(htm|html)$!
    FileMatch filename contains ^\d+$

Swish-e checks these settings in the order of C<pathname>, C<dirname>, and
C<filename>, and C<FileMatch> patterns are checked before C<FileRules>, in
general.  This allows you to exclude most files with C<FileRules>, yet allow in
a few special cases with C<FileMatch>. For example:

    # Exclude all files of .exe, .bin, and .bat
    FileRules filename contains \.(exe|bin|bat)$
    # But, let these two in
    FileMatch filename is baseball\.bat incoming_mail\.bin

    # Same, but as a single pattern
    FileMatch filename is (baseball\.bat|incoming_mail\.bin)

The C<directory> type is somewhat unique. When Swish-e recurses into a
directory it will compare all the I<files> in the directory with the pattern
and then decide if that entire directory should or should not be indexed (or
recursed).  Note that you are matching against file names in a directory -- and
some of those names may be directory names.

A C<FileRules directory> match will cause Swish-e to ignore all files and
sub-directories in the current directory.

Warning: A match with C<FileMatch directory> says to index B<everything> in the
*current* directory and B<ignore> any FileRules for this directory.


Example:

    # Don't index any directories (and sub directories) that contain
    # a file (or sub-directory) called "index.skip"
    FileRules directory contains ^index\.skip$

    # Don't index directories that contain a .htaccess file.
    FileRules directory contains ^\.htaccess

Note: While I<processing> directories, Swish-e will ignore any files or
directories that begin with a dot (".").  You may index files or directories
that begin with a dot by specifying their name with C<IndexDir> or C<-i>.

C<title> checks for a pattern match in an HTML title.

Example:

    FileRules title contains construction example pointers

    # This example says to ignore case
    FileRules title regex "/^Internal document/i"

Note: C<FileRules title> works for any input method (fs, prog, or http) that is
parsed as HTML, and where a title was found in the document.

In case all this seems a bit confusing, processing a directory happens
in the following order.

First the directory name is checked:

    FileRules dirname - reject entire directory if matches

Next the directory is scanned and each file name (which might be the
name of a sub-directory) is checked:

    FileRules directory - reject entire dir if *any* files match
    FileMatch directory - accept entire dir if *any* files match

Then, unless C<FileMatch directory> matched, each file is tested with
FileMatch.  A match says to index the file without further testing (i.e.
overrides FileRules and IndexOnly):

    FileMatch pathname  \
    FileMatch dirname   - file is accepted if any match
    FileMatch filename  /

otherwise    

    IndexOnly - file is checked for the correct file extension

    FileRules pathname  \
    FileRules dirname   - file is rejected if any match
    FileRules filename  /

finally, the file is indexed.

Files (not directories) listed with C<IndexDir> or C<-i> are processed in a
similar way:

    FileMatch pathname  \
    FileMatch dirname   - file is accepted if any match
    FileMatch filename  /

otherwise, the file is rejected if it doesn't have the correct extension
or a FileRules matches.

    IndexOnly - file is checked for the correct file extension

    FileRules pathname  \
    FileRules dirname   - file is rejected if any match
    FileRules filename  /

Note:  If things are not indexing as you expect, create a directory with some
test files and use the C<-T regex> trace option to see how file names are
checked.  Start with very simple tests!


=back    

=head2 Directives for the HTTP Access Method Only

The HTTP Access method is enabled by the "-S http" switch when indexing.  It works by
running a Perl program called SwishSpider which fetches documents from a web server.

Only text files (content-type of "text/*") are indexed with the HTTP Access Method.
Other document types (e.g. PDF or MSWord) may be indexed as well.  The SwishSpider will
attempt to make use of the SWISH::Filter module (included with the Swish-e distribution) to
convert documents into a format that Swish-e can index.

Note: The -S prog method of spidering (using spider.pl) can be a replacement for the -S http method.
It offers more configuration options and better spidering speed.

These directives below are available when using the HTTP Access Method of indexing.

=over 4

=item MaxDepth *integer*

MaxDepth defines how many links the spider should follow before stopping.
A value of 0 configures the spider to traverse all links.  The default
is MaxDepth 0.

    MaxDepth 5

Note: The default was changed from 5 to 0 in release 2.4.0

=item Delay *seconds*

The number of seconds to wait between issuing requests to a server.
This setting allows for more friendly spidering of remote sites.
The default is 5 seconds.

    Delay 1

Note: The default was changed from 60 to 5 seconds in release 2.4.0

=item TmpDir *path*

The location of a writable temp directory on your system.  The HTTP access
method tells the Perl helper to place its files in this location, and the C<-e>
switch causes Swish-e to use this directory while indexing.  There is no
default.

    TmpDir /tmp/swish

If this directory does not exist or is not writable Swish-e will fail
with an error during indexing.

Note, the environment variables of C<TMPDIR>, C<TMP>, and C<TEMP> (in that
order) will B<override> this setting.

=item SpiderDirectory *path*

The location of the Perl helper script called F<swishspider>.  If you
use a relative directory, it is relative to your directory when you run
Swish-e, not to the directory that Swish-e is in.
The default is the location swishspider was installed.
Normally this does not need to be set.

    SpiderDirectory /usr/local/swish

=item EquivalentServer *server alias*

Often times the same site may be referred to by different names.
A common example is that often http://www.some-server.com and
http://some-server.com are the same.  Each line should have a list of
all the method/names that should be considered equivalent.  Multiple
EquivalentServer directives may be used.  Each directive defines its
own set of equivalent servers.

    EquivalentServer http://library.berkeley.edu http://www.lib.berkeley.edu
    EquivalentServer http://sunsite.berkeley.edu:2000 http://sunsite.berkeley.edu

=back

=head2 Directives for the prog Access Method Only

This section details the directives that are only available for the
"prog" document source feature of Swish-e.  The "prog" access method runs
an external program that "feeds" documents to Swish-e.  This allows indexing
and filtering of documents from any source.

See L<prog - general purpose access method|SWISH-RUN/"item_prog"> in the
SWISH-RUN man page for more information.


A number of example programs for use with the "prog" access method are
provided in the F<prog-bin> directory.  Please see those example if you
have questions about implementing a "prog" input program.

=over 4

=item SwishProgParameters *list of parameters*

This is a list of parameters that will be sent to the external program
when running with the "prog" document source method.

    SwishProgParameters /path/to/config hello there
    IndexDir /path/to/program.pl

Then running:

    swish-e -c config -S prog

Swish-e will execute C</path/to/program.pl> and pass C</path/to/config hello
there> as three command line arguments to the program.  This directive makes it
easy to pass settings from the Swish-e configuration file to the external
program.

For example, the C<spider.pl> program (included in the C<prog-bin> directory)
uses the C<SwishProgParameters> to specify what file to read for configuration
information.

    SwishProgParameters spider.config
    IndexDir ./spider.pl

The C<spider.pl> program also has a default action so you can avoid using a
configuration file:

    SwishProgParameters default http://www.swishe.org/ http://some.other.site/
    IndexDir ./spider.pl

And the spider program will use default settings for spidering those sites.

Swish-e can read documents from standard input, so another way to run an external program
with parameters is:

    ./spider.pl spider.conf | ./swish-e -S prog -i stdin

=back

B<Notes when using MS Windows>

You should use unix style path separators to specify your external program.
Swish will convert forward slashes to backslashes before calling the external
program.  This is only true for the program name specified with C<IndexDir> or
the C<-i> command line option.

In addition, Swish-e will make sure the program specified actually exists,
which means you need to use the full name of the program.

For example, to run the perl spider program F<spider.pl> you would need
a Swish-e configuration file such as:

    IndexDir e:/perl/bin/perl.exe
    SwishProgParameters prog-bin/spider.pl default http://swish-e.org

and run indexing with the command:

    swish-e -c swish.cfg -S prog -v 9

The C<IndexDir> command tells Swish-e the name of the program to run.  Under
unix you can just specify the name of the script, since unix will figure out
the program from the first line of the script.

The C<SwishProgParameters> are the parameters passed to the program specified
by C<IndexDir> (perl.exe in this case).  The first parameter is the perl script
to run (F<prog-bin/spider.pl>).  Perl passes the rest of the parameters
directly to the perl script.  The second parameter F<default> tells the
F<spider.pl> program to use default settings for spidering (or you could
specify a spider config file -- see C<perldoc spider.pl> for details), and
lastly, the URL is passed into the spider program.


=head2 Document Filter Directives

Internally, Swish-e knows how to parse only text, HTML, and XML documents.
With "filters" you can index other types of documents.  For example,
if all your web pages are in gzip format a filter can uncompress these
on the fly for indexing.

You may wish to read the Swish-e FAQ question on filtering before continuing
here.  L<How Do I filter documents?|SWISH-FAQ/"How Do I filter documents?">

There are two suggested methods for filtering.

=head3 Filtering with SWISH::Filter

The Swish-e distribution includes a Perl module called SWISH::Filter and individual
filters located in the F<filters> directory.  This system uses plug-in filters to
extend the types of documents that Swish-e can index.  The plug-in filters do not
actually do the filtering, but rather provide a standard interface for accessing programs that
can filter or convert documents.  The programs that do the filtering are not part of
the Swish-e distribution; they must be downloaded and installed separately.

The advantage of this method is that new filtering methods can be installed easily.

This system is designed to work with the -S http and -prog methods, but may
also be used with the C<FileFilter> feature and -S fs indexing method.  See
F<$prefix/share/doc/swish-e/examples/filter-bin/swish_filter.pl> for an
example.

See the F<filters/README> file for more information.

=head3 Filtering with the FileFilter feature

A filter is an external program that Swish-e executes while processing
a document of a given type.  Swish-e will execute the filter program
for each file that matches the file suffix (extension) set in the
B<FileFilter> or B<FileFilterMatch> directives.  B<FileFilterMatch>
matches using regular expressions and is described below.

Filters may be used with any type of input method (i.e. -S fs, -S http, or -S prog).
But because

Swish-e calls the external program passing as B<default> arguments:

=over 4

=item $0 

the name of the filter program

=item $1

the physical path name of the file to read.  This may be a temporary
file location if indexing by the http method.

=item $2

When indexing under the file system this will be the same as $1 (the
path to the source file), but when indexing under the http method this
will be the URL of the source document.

=back

Swish-e can also pass other parameters to the filter program.  These
parameters can be defined using the B<FileFilter> or B<FileFilterMatch>
directives.  See Filter Options below.

The filter program must open the file, process its contents, and return
it to Swish-e by printing to STDOUT.

Note that this can add a significant amount of time to the indexing
process if your external program is a perl or shell script.  If you
have many files to filter you should consider writing your filter in C
instead of a shell or perl script, or using the "prog" Access Method.

=over 4

=item FilterDir  *path-to-directory*

This is the path to a directory where the filter programs are stored.
Swish-e looks in this directory to find the filter specified in the
B<FileFilter> directive. If this directive is omitted, you have to
specify the full path to the filterscript on each FileFilter directive.

This feature does *not* apply to the C<FileFilterMatch> directive.

Example:

    FilterDir /usr/local/swish/filters

=item FileFilter   *suffix*   "filter-prog"   ["filter-options"]

This maps file suffix (extension) to a filter program.  If I<filter-prog>
starts with a directory delimiter (absolute path), Swish-e doesn't use
the FilterDir settings, but uses the given I<filter-prog> path directly.

Filter options:

Filter options are a string passed as arguments to the I<filter-prog>.
Filter options can contain variables, replaced by Swish-e.  If you omit
I<filter-options> Swish-e will use default parameters for the options
listed above.

    Default:      "'%p' '%P'"
    Which means:  pass   "workfile path" and "documentfile path" to filter (each quoted).

Variables in filter options:

    %%   =  %
    %P   =  Full document pathname (e.g. URL, or path on filesystem)  
    %p   =  Full pathname to work file (maybe a tmpfile or the real document path on filesystem)
    %F   =  Filename stripped from full document pathname
    %f   =  Filename stripped from "work" pathname
    %D   =  Directoryname stripped from full document pathname
    %d   =  Directoryname stripped from full "work" pathname

Examples of strings passed:

    %P =  document pathname:  http://myserver/path1/mydoc.txt
    %p =  work pathname:      /tmp/tmp.1234.mydoc.txt
    %F =     mydoc.txt
    %f =     tmp.1234.mydoc.txt
    %D =     http://myserver/path1
    %d =     /tmp

Important hint for security:

When using variable substitution, use quotes to ensure filename integrity.

        e.g. "'%f'"  -->  'file name with spaces.doc'.

If you don't use this, your system security may be compromised, or
filtering may not work for these files.

B<Notes when using MS Windows>

Windows uses double quotes to escape shell metacharacters, so reverse
the quotes in the examples above.  e.g.:

        '"%f"' --> "file name with spaced.doc"

You can specify the filter program using forward slashes (unix style).
Swish will convert the slashes to backslashes before running your program.

    FileFilter .mydoc     c:/some/path/mydocfilter.exe  '-d "%d" -example -url "%P" "%f"'


Examples of filters:

    FileFilter .doc       /usr/local/bin/catdoc "-s8859-1 -d8859-1 '%p'"
    FileFilter .pdf       pdftotext   "'%p' -"
    FileFilter .html.gz   gzip  "-c '%p'"
    FileFilter .mydoc     "/some/path/mydocfilter"  "-d '%d' -example -url '%P' '%f'"

The above examples are running a I<binary> filter program.  For more
complicated filtering needs you may use a scripting language such as
Perl or a shell script.  Here's some examples of calling a shell and
perl script:

    FileFilter .pdf       pdf2html.sh
    FileFilter .ps        ghostscript-filter.pl

Using a scripting language (or any language that has a large startup cost) can
B<greatly increase the indexing time>.  For small indexing jobs, this may not
be an issue, but for large collections of files that require processing by a
scripting language, you may be better off using the C<-S prog> access method
where the script will only be compiled once, instead of for each document.

Filters are probably easier to write than a C<-S prog> program.  Which you
decide to use depends on your requirements.  Examples of filter scripts can be
found in the F<filter-bin> directory, and examples of C<-S prog> programs can
be found in the F<prog-bin> directory.

=item FileFilterMatch   *filter-prog*   *filter-options*  *regex* [*regex* ...]

This is similar to C<FileMatch> except uses regular expressions to match
against the file name.  *filter-prog* is the path to the program.  Unlike
C<FileFilter> this does B<not> use the C<FilterDir> option.  Also unlike
C<FileFilter> you B<must> specify the *filter-options*.

Examples:

    FileFilterMatch ./pdftotext "'%p' -" /\.pdf$/

Note that will also match a file called ".pdf", so you may want to use
something that requires a filename that has more than just an extension.
For example:

    FileFilterMatch ./pdftotext "'%p' -" /.\.pdf$/

To specify more than one extension:

    FileFilterMatch ./check_title.pl "%p" /\.html$/  /\.htm$/

Or a few ways to do the same thing:

    FileFilterMatch ./check_title.pl %p /\.(html|html)$/
    FileFilterMatch ./check_title.pl %p /\.html?$/

And to ignore case:    

    FileFilterMatch ./check_title.pl %p /\.html?$/i

You may also precede an expression with "not" to negate regular expression
that follow.  For example, to match files that do not have an extension:

    FileFilterMatch ./convert "%p %P" not /\..+$/

=back

=head1 Document Info

$Id: SWISH-CONFIG.pod,v 1.81 2004/10/25 13:57:17 karman Exp $

.