1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>SWISH-Enhanced: SWISH-CONFIG - Configuration File Directives </title>
<link href="./style.css" rel=stylesheet type="text/css" title="refstyle">
</head>
<body>
<h1 class="banner">
<a href="http://swish-e.org"><img border=0 src="images/swish.gif" alt="Swish-E Logo"></a><br>
<img src="images/swishbanner1.gif"><br>
<img src="images/dotrule1.gif"><br>
SWISH-CONFIG - Configuration File Directives
</h1>
<hr>
<p>
<div class="navbar">
<a href="./CHANGES.html">Prev</a> |
<a href="./index.html">Contents</a> |
<a href="./SWISH-RUN.html">Next</a>
</div>
<p>
<div class="toc">
<A NAME="toc"></A>
<P><B>Table of Contents:</B></P>
<UL>
<LI><A HREF="#Swish_e_CONFIGURATION_FILE">Swish-e CONFIGURATION FILE</A>
<UL>
<LI><A HREF="#Alphabetical_Listing_of_Directives">Alphabetical Listing of Directives</A>
<LI><A HREF="#Directives_that_Control_Swish">Directives that Control Swish</A>
<LI><A HREF="#Administrative_Headers_Directives">Administrative Headers Directives</A>
<LI><A HREF="#Document_Source_Directives">Document Source Directives</A>
<LI><A HREF="#Document_Contents_Directives">Document Contents Directives</A>
<LI><A HREF="#Directives_for_the_File_Access_method_only">Directives for the File Access method only</A>
<LI><A HREF="#Directives_for_the_HTTP_Access_Method_Only">Directives for the HTTP Access Method Only</A>
<LI><A HREF="#Directives_for_the_prog_Access_Method_Only">Directives for the prog Access Method Only</A>
<LI><A HREF="#Document_Filter_Directives">Document Filter Directives</A>
<UL>
<LI><A HREF="#Filtering_with_SWISH_Filter">Filtering with SWISH::Filter</A>
<LI><A HREF="#Filtering_with_the_FileFilter_feature">Filtering with the FileFilter feature</A>
</UL>
</UL>
<LI><A HREF="#Document_Info">Document Info</A>
</UL>
</div>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<P>
<H1><A NAME="Swish_e_CONFIGURATION_FILE">Swish-e CONFIGURATION FILE</A></H1>
<P>
What files Swish-e indexes and how they are indexed, and where the index is
written can be controlled by a configuration file.
<P>
The configuration file is a text file composed of comments, blank lines,
and <STRONG>configuration directives</STRONG>. 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.
<P>
Comments are any line that begin with a "#".
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # This is a comment</pre>
</td>
</tr>
</table>
<P>
As of 2.4.3 lines may be continued by placing a backslas as the last
character on the line:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IgnoreWords \
am \
the \
foo</pre>
</td>
</tr>
</table>
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ReplaceRules append "foo bar" <- define "foo bar" as a single parameter</pre>
</td>
</tr>
</table>
<P>
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.
<P>
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):
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> 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</pre>
</td>
</tr>
</table>
<P>
Backslashes also have special meaning in regular expressions.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilterMatch pdftotext "'%p' -" /\.pdf$/</pre>
</td>
</tr>
</table>
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilterMatch pdftotext "'%p' -" "/\\.pdf$/"</pre>
</td>
</tr>
</table>
<P>
Swish-e will convert the double backslash into a single backslash before
passing the parameter to the regular expression compiler.
<P>
Commented example configuration files are included in the <EM>conf</EM>
directory of the Swish-e distribution.
<P>
Some command line arguments can override directives specified in the
configuration file. Please see also the <A HREF="././SWISH-RUN.html">SWISH-RUN</A> for instructions on running Swish-e, and the <A HREF="././SWISH-SEARCH.html">SWISH-SEARCH</A> page for information and examples on how to search your index.
<P>
The configuration file is specified to Swish-e by the <CODE>-c</CODE> switch. For example,
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -c myconfig.conf</pre>
</td>
</tr>
</table>
<P>
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 <CODE>-c</CODE>
switch (see <A HREF="././SWISH-RUN.html">SWISH-RUN</A>), or you may include other Configuration file with the <STRONG>IncludeConfigFile</STRONG> directive below.
<P>
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).
<P>
The configuration file directives are listed below in these groups:
<UL>
<P><LI>
<P>
<A HREF="#Administrative_Headers_Directives">Administrative Headers Directives</A> -- You may add administrative information to the header of the index file.
<P><LI>
<P>
<A HREF="#Document_Source_Directives">Document Source Directives</A> -- Directives for selecting the source documents and the location of the
index file.
<P><LI>
<P>
<A HREF="#Document_Contents_Directives">Document Contents Directives</A> -- Directives that control how a document content is indexed.
<P><LI>
<P>
<A HREF="#Directives_for_the_File_Access_method_only">Directives for the File Access method only</A> -- These directives are only applicable to the File Access indexing method.
<P><LI>
<P>
<A HREF="#Directives_for_the_HTTP_Access_Method_Only">Directives for the HTTP Access Method Only</A> -- Likewise, these only apply to the HTTP Access method.
<P><LI>
<P>
<A HREF="#Directives_for_the_prog_Access_Method_Only">Directives for the prog Access Method Only</A> -- These only apply to the prog Access method.
<P><LI>
<P>
<A HREF="#Document_Filter_Directives">Document Filter Directives</A> -- This is a special section that describes using document filters with
Swish-e.
</UL>
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H2><A NAME="Alphabetical_Listing_of_Directives">Alphabetical Listing of Directives</A></H2>
<UL>
<P><LI>
<P>
<A HREF="#item_AbsoluteLinks">AbsoluteLinks</A> [yes|NO]
<P><LI>
<P>
<A HREF="#item_BeginCharacters">BeginCharacters</A> <CODE>*string</CODE> of characters*
<P><LI>
<P>
<A HREF="#item_BumpPositionCounterCharacters">BumpPositionCounterCharacters</A> *string*
<P><LI>
<P>
<A HREF="#item_Buzzwords">Buzzwords</A> [*list of buzzwords*|File: path]
<P><LI>
<P>
<A HREF="#item_ConvertHTMLEntities">ConvertHTMLEntities</A> [YES|no]
<P><LI>
<P>
<A HREF="#item_DefaultContents">DefaultContents</A> [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]
<P><LI>
<P>
<A HREF="#item_Delay">Delay</A> *seconds*
<P><LI>
<P>
<A HREF="#item_DontBumpPositionOnEndTags">DontBumpPositionOnEndTags</A> <CODE>*list</CODE> of names*
<P><LI>
<P>
<A HREF="#item_DontBumpPositionOnStartTags">DontBumpPositionOnStartTags</A> <CODE>*list</CODE> of names*
<P><LI>
<P>
<A HREF="#item_EnableAltSearchSyntax">EnableAltSearchSyntax</A> [yes|NO]
<P><LI>
<P>
<A HREF="#item_EndCharacters">EndCharacters</A> <CODE>*string</CODE> of characters*
<P><LI>
<P>
<A HREF="#item_EquivalentServer">EquivalentServer</A> <CODE>*server</CODE> alias*
<P><LI>
<P>
<A HREF="#item_ExtractPath">ExtractPath</A> *metaname* [replace|remove|prepend|append|regex]
<P><LI>
<P>
<A HREF="#item_FileFilter">FileFilter</A> *suffix* *program* [options]
<P><LI>
<P>
<A HREF="#item_FileFilterMatch">FileFilterMatch</A> *program* *options* *regex* [*regex* ...]
<P><LI>
<P>
<A HREF="#item_FileInfoCompression">FileInfoCompression</A> [yes|NO]
<P><LI>
<P>
<A HREF="#item_FileMatch">FileMatch</A> [contains|is|regex] <CODE>*regular</CODE> expression*
<P><LI>
<P>
<A HREF="#item_FileRules">FileRules</A> [contains|is|regex] <CODE>*regular</CODE> expression*
<P><LI>
<P>
<A HREF="#item_FuzzyIndexingMode">FuzzyIndexingMode</A> [NONE|Stemming|Soundex|Metaphone|DoubleMetaphone]
<P><LI>
<P>
<A HREF="#item_FollowSymLinks">FollowSymLinks</A> [yes|NO]
<P><LI>
<P>
<A HREF="#item_HTMLLinksMetaName">HTMLLinksMetaName</A> *metaname*
<P><LI>
<P>
<A HREF="#item_IgnoreFirstChar">IgnoreFirstChar</A> <CODE>*string</CODE> of characters*
<P><LI>
<P>
<A HREF="#item_IgnoreLastChar">IgnoreLastChar</A> <CODE>*string</CODE> of characters*
<P><LI>
<P>
<A HREF="#item_IgnoreLimit">IgnoreLimit</A> <CODE>*integer</CODE> integer*
<P><LI>
<P>
<A HREF="#item_IgnoreMetaTags">IgnoreMetaTags</A> <CODE>*list</CODE> of names*
<P><LI>
<P>
<A HREF="#item_IgnoreNumberChars">IgnoreNumberChars</A> <CODE>*list</CODE> of characters*
<P><LI>
<P>
<A HREF="#item_IgnoreTotalWordCountWhenRanking">IgnoreTotalWordCountWhenRanking</A> [YES|no]
<P><LI>
<P>
<A HREF="#item_IgnoreWords">IgnoreWords</A> [*list of stop words*|File: path]
<P><LI>
<P>
<A HREF="#item_ImageLinksMetaName">ImageLinksMetaName</A> *metaname*
<P><LI>
<P>
<A HREF="#item_IncludeConfigFile">IncludeConfigFile</A>
<P><LI>
<P>
<A HREF="#item_IndexAdmin">IndexAdmin</A> *text*
<P><LI>
<P>
<A HREF="#item_IndexAltTagMetaName">IndexAltTagMetaName</A> *tagname*|as-text
<P><LI>
<P>
<A HREF="#item_IndexComments">IndexComments</A> [yes|NO]
<P><LI>
<P>
<A HREF="#item_IndexContents">IndexContents</A> [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*] <CODE>*file</CODE>
extensions*
<P><LI>
<P>
<A HREF="#item_IndexDescription">IndexDescription</A> *text*
<P><LI>
<P>
<A HREF="#item_IndexDir">IndexDir</A> [URL|directories or files]
<P><LI>
<P>
<A HREF="#item_IndexFile">IndexFile</A> *path*
<P><LI>
<P>
<A HREF="#item_IndexName">IndexName</A> *text*
<P><LI>
<P>
<A HREF="#item_IndexOnly">IndexOnly</A> <CODE>*list</CODE> of file suffixes*
<P><LI>
<P>
<A HREF="#item_IndexPointer">IndexPointer</A> *text*
<P><LI>
<P>
<A HREF="#item_IndexReport">IndexReport</A> [0|1|2|3]
<P><LI>
<P>
<A HREF="#item_MaxDepth">MaxDepth</A> *integer*
<P><LI>
<P>
<A HREF="#item_MaxWordLimit">MaxWordLimit</A> *integer*
<P><LI>
<P>
<A HREF="#item_MetaNameAlias">MetaNameAlias</A> <CODE>*meta</CODE> name* <CODE>*list</CODE> of aliases*
<P><LI>
<P>
<A HREF="#item_MetaNames">MetaNames</A> <CODE>*list</CODE> of names*
<P><LI>
<P>
<A HREF="#item_MinWordLimit">MinWordLimit</A> *integer*
<P><LI>
<P>
<A HREF="#item_NoContents">NoContents</A> <CODE>*list</CODE> of file suffixes*
<P><LI>
<P>
<A HREF="#item_obeyRobotsNoIndex">obeyRobotsNoIndex</A> [yes|NO]
<P><LI>
<P>
<A HREF="#item_ParserWarnLevel">ParserWarnLevel</A> [0|1|2|3]
<P><LI>
<P>
<A HREF="#item_PreSortedIndex">PreSortedIndex</A> <CODE>*list</CODE> of property names*
<P><LI>
<P>
<A HREF="#item_PropCompressionLevel">PropCompressionLevel</A> [0-9]
<P><LI>
<P>
<A HREF="#item_PropertyNameAlias">PropertyNameAlias</A> <CODE>*property</CODE> name* <CODE>*list</CODE> of aliases*
<P><LI>
<P>
<A HREF="#item_PropertyNames">PropertyNames</A> <CODE>*list</CODE> of meta names*
<P><LI>
<P>
<A HREF="#item_PropertyNamesCompareCase">PropertyNamesCompareCase</A> <CODE>*list</CODE> of meta names*
<P><LI>
<P>
<A HREF="#item_PropertyNamesIgnoreCase">PropertyNamesIgnoreCase</A> <CODE>*list</CODE> of meta names*
<P><LI>
<P>
<A HREF="#item_PropertyNamesNoStripChars">PropertyNamesNoStripChars</A> <CODE>*list</CODE> of meta names*
<P><LI>
<P>
<A HREF="#item_PropertyNamesDate">PropertyNamesDate</A> <CODE>*list</CODE> of meta names*
<P><LI>
<P>
<A HREF="#item_PropertyNamesNumeric">PropertyNamesNumeric</A> <CODE>*list</CODE> of meta names*
<P><LI>
<P>
<A HREF="#item_PropertyNamesMaxLength">PropertyNamesMaxLength</A> integer <CODE>*list</CODE> of meta names*
<P><LI>
<P>
<A HREF="#item_PropertyNamesSortKeyLength">PropertyNamesSortKeyLength</A> integer <CODE>*list</CODE> of meta names*
<P><LI>
<P>
<A HREF="#item_ReplaceRules">ReplaceRules</A> [replace|remove|prepend|append|regex]
<P><LI>
<P>
<A HREF="#item_ResultExtFormatName">ResultExtFormatName</A> name -x format string
<P><LI>
<P>
<A HREF="#item_SpiderDirectory">SpiderDirectory</A> *path*
<P><LI>
<P>
<A HREF="#item_StoreDescription">StoreDescription</A> [XML <tag>|HTML <meta>|TXT size]
<P><LI>
<P>
<A HREF="#item__SwishProgParameters">"SwishProgParameters</A> <CODE>*list</CODE> of parameters*
<P><LI>
<P>
<A HREF="#item_SwishSearchDefaultRule">SwishSearchDefaultRule</A> [<AND-WORD>|<or-word>]
<P><LI>
<P>
<A HREF="#item_SwishSearchOperators">SwishSearchOperators</A> <and-word> <or-word> <not-word>
<P><LI>
<P>
<A HREF="#item_TmpDir">TmpDir</A> *path*
<P><LI>
<P>
<A HREF="#item_TranslateCharacters">TranslateCharacters</A> [*string1 string2*|:ascii7:]
<P><LI>
<P>
<A HREF="#item_TruncateDocSize">TruncateDocSize</A> <CODE>*number</CODE> of characters*
<P><LI>
<P>
<A HREF="#item_UndefinedMetaTags">UndefinedMetaTags</A> [error|ignore|INDEX|auto]
<P><LI>
<P>
<A HREF="#item_UndefinedXMLAttributes">UndefinedXMLAttributes</A> [DISABLE|error|ignore|index|auto]
<P><LI>
<P>
<A HREF="#item_UseStemming">UseStemming</A> [yes|NO]
<P><LI>
<P>
<A HREF="#item_UseSoundex">UseSoundex</A> [yes|NO]
<P><LI>
<P>
<A HREF="#item_UseWords">UseWords</A> [*list of words*|File: path]
<P><LI>
<P>
<A HREF="#item_WordCharacters">WordCharacters</A> <CODE>*string</CODE> of characters*
<P><LI>
<P>
<A HREF="#item_XMLClassAttributes">XMLClassAttributes</A> <CODE>*list</CODE> of XML attribute names*
</UL>
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H2><A NAME="Directives_that_Control_Swish">Directives that Control Swish</A></H2>
<P>
These configuration directives control the general behavior of Swish-e.
<DL>
<P><DT><STRONG><A NAME="item_IncludeConfigFile">IncludeConfigFile *path to config file*</A></STRONG><DD>
<P>
This directive can be used to include configuration directives located in
another file.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IncludeConfigFile /usr/local/swish/conf/site_config.config</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_IndexReport">IndexReport [0|1|2|3]</A></STRONG><DD>
<P>
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.
<P>
This may be overridden from the command line via the <CODE>-v</CODE> switch (see
<A HREF="././SWISH-RUN.html">SWISH-RUN</A>).
<P><DT><STRONG><A NAME="item_ParserWarnLevel">ParserWarnLevel [0|1|2|3]</A></STRONG><DD>
<P>
Sets the error level when using the libxml2 parser for XML and HTML.
libxml2 will point out structural errors in your documents.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> 0 = no report
1 = fatal errors
2 = errors
3 = warnings</pre>
</td>
</tr>
</table>
<P>
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.
<P>
Note that unlike other errors generated by Swish-e, these errors are sent
to stderr.
<P><DT><STRONG><A NAME="item_IndexFile">IndexFile *path*</A></STRONG><DD>
<P>
Index file specifies the location of the generated index file. If not
specified, Swish-e will create the file <EM>index.swish-e</EM> in the current directory.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexFile /usr/local/swish/site.index</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_obeyRobotsNoIndex">obeyRobotsNoIndex [yes|NO]</A></STRONG><DD>
<P>
When enabled, Swish-e will not index any HTML file that contains:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <meta name="robots" content="noindex"></pre>
</td>
</tr>
</table>
<P>
The default is to ignore these meta tags and index the document. This tag
is described at <A
HREF="http://www.robotstxt.org/wc/exclusion.html.">http://www.robotstxt.org/wc/exclusion.html.</A>
<P>
Note: This feature is only available with the libxml2 HTML parser.
<P>
Also, if you are using the libxml2 parser (HTML2 and XML2) then you can use
the following comments in your documents to prevent indexing:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <!-- SwishCommand noindex -->
<!-- SwishCommand index --></pre>
</td>
</tr>
</table>
<P>
and/or these may be used also:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <!-- noindex -->
<!-- index --></pre>
</td>
</tr>
</table>
<P>
For example, these are very helpful to prevent indexing of common headers,
footers, and menus.
</DL>
<P>
<STRONG>NOTE</STRONG>: This following items are currently not available. These items require
Swish-e to parse the configuration file while searching.
<DL>
<P><DT><STRONG><A NAME="item_EnableAltSearchSyntax">EnableAltSearchSyntax [yes|NO]</A></STRONG><DD>
<P>
<STRONG>NOTE</STRONG>: This following item is currently not available.
<P>
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.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> 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</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_SwishSearchOperators">SwishSearchOperators <and-word> <or-word> <not-word></A></STRONG><DD>
<P>
<STRONG>NOTE</STRONG>: This following item is currently not available.
<P>
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
<P>
Example (german):
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> SwishSearchOperators UND ODER NICHT</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_SwishSearchDefaultRule">SwishSearchDefaultRule [<AND-WORD>|<or-word>]</A></STRONG><DD>
<P>
<STRONG>NOTE</STRONG>: This following item is currently not available.
<P>
<A HREF="#item_SwishSearchDefaultRule">SwishSearchDefaultRule</A> defines the default Boolean operator to use if none is specified between
words or phrases. The default is <CODE>AND</CODE>.
<P>
The word you specify must match one of the available <A HREF="#item_SwishSearchOperators">SwishSearchOperators</A>.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> SwishSearchOperators UND ODER NICHT
# Make it act like a web search engine
SwishSearchDefaultRule ODER</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_ResultExtFormatName">ResultExtFormatName name -x format string</A></STRONG><DD>
<P>
<STRONG>NOTE</STRONG>: This following item is currently not available.
<P>
The output of Swish-e can be defined by specifying a format string with the
<CODE>-x</CODE> command line argument. Using <A HREF="#item_ResultExtFormatName">ResultExtFormatName</A> you can assign a predefined format string to a name.
<P>
Examples:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ResultExtFormatName moreinfo "%c|%r|%t|%p|<author>|<publishyear>\n"</pre>
</td>
</tr>
</table>
<P>
Then when searching you can specify the format string's name
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e ... -x moreinfo ...</pre>
</td>
</tr>
</table>
<P>
See the <CODE>-x</CODE> switch in <A HREF="././SWISH-RUN.html">SWISH-RUN</A> for more information about output formats.
</DL>
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H2><A NAME="Administrative_Headers_Directives">Administrative Headers Directives</A></H2>
<P>
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:
<DL>
<P><DT><STRONG><A NAME="item_IndexName">IndexName *text*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_IndexDescription">IndexDescription *text*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_IndexPointer">IndexPointer *text*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_IndexAdmin">IndexAdmin *text*</A></STRONG><DD>
<P>
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.
<P>
Examples:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexName "Linux Documentation"
IndexDescription "This is an index of /usr/doc on our Linux machine."
IndexPointer <A HREF="http://localhost/swish/linux/index.html">http://localhost/swish/linux/index.html</A>
IndexAdmin webmaster</pre>
</td>
</tr>
</table>
</DL>
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H2><A NAME="Document_Source_Directives">Document Source Directives</A></H2>
<P>
These directives control <EM>what</EM> documents are indexed and <EM>how</EM> they are accessed. See also <A HREF="#Directives_for_the_File_Access_method_only">Directives for the File Access method only</A> and <A HREF="#Directives_for_the_HTTP_Access_Method_Only">Directives for the HTTP Access Method Only</A> for directives that are specific to those access methods.
<DL>
<P><DT><STRONG><A NAME="item_IndexDir">IndexDir [directories or files|URL|external program]</A></STRONG><DD>
<P>
IndexDir defines the source of the documents for Swish-e. Swish-e currently
supports three file access methods: <STRONG>File system</STRONG>, <STRONG>HTTP</STRONG>
(also called <STRONG>spidering</STRONG>), and <STRONG>prog</STRONG> for reading files from an external program.
<P>
The <CODE>-S</CODE> command line argument is used to select the file access method.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> 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</pre>
</td>
</tr>
</table>
<P>
For the <STRONG>fs</STRONG> method of access <STRONG>IndexDir</STRONG> is a space-separated list of files and directories to index. Use a forward
slash as the path separator in MS Windows.
<P>
For the <STRONG>http</STRONG> method the <STRONG>IndexDir</STRONG> setting is a list of space-separated URLs.
<P>
For the <STRONG>prog</STRONG> method the <STRONG>IndexDir</STRONG> setting is a list of space-separated programs to run (which generate
documents for swish to index).
<P>
You may specify more than one <STRONG>IndexDir</STRONG> directive.
<P>
Any sub-directories of any listed directory will also be indexed.
<P>
Note: While <EM>processing</EM> 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 <A HREF="#item_IndexDir">IndexDir</A> or <CODE>-i</CODE>.
<P>
Examples:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Index this directory an any subdirectories
IndexDir /usr/local/home/http</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Index the docs directory in current directory
IndexDir ./docs</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Index these files in the current directory
IndexDir ./index.html ./page1.html ./page2.html
# and index this directory, too
IndexDir ../public_html</pre>
</td>
</tr>
</table>
<P>
For the <STRONG>HTTP</STRONG> method of access specify the URL's from which you want the spidering to
begin.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexDir <A HREF="http://www.my-site.com/index.html">http://www.my-site.com/index.html</A>
IndexDir <A HREF="http://localhost/index.html">http://localhost/index.html</A></pre>
</td>
</tr>
</table>
<P>
Obviously, using the <STRONG>HTTP</STRONG> method to index is <STRONG>much</STRONG> 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
<A HREF="#Directives_for_the_HTTP_Access_Method_Only">Directives for the HTTP Access Method Only</A> below.
<P>
For the <A HREF="././SWISH-RUN.html#item_prog">prog</A> method of access <STRONG>IndexDir</STRONG> specifies the path to the <CODE>program(s)</CODE> to execute. The external
program must correctly format the documents being passed back to Swish-e.
Examples of external programs are provided in the <EM>prog-bin</EM> directory.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexDir ./myprogram.pl</pre>
</td>
</tr>
</table>
<P>
See <A HREF="././SWISH-RUN.html#item_prog">prog</A> for details.
<P>
Note: Not all directives work with all methods.
<P><DT><STRONG><A NAME="item_NoContents">NoContents *list of file suffixes*</A></STRONG><DD>
<P>
Files with these suffixes will <STRONG>not</STRONG> have their contents indexed, but will have their path name (file name)
indexed instead.
<P>
If the file's type is HTML or HTML2 (as set by <A HREF="#item_IndexContents">IndexContents</A> or
<A HREF="#item_DefaultContents">DefaultContents</A>) 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
<A HREF="#item_IndexContents">IndexContents</A> or <A HREF="#item_DefaultContents">DefaultContents</A>: <CODE>.html</CODE> and <CODE>.htm</CODE> are NOT type HTML by default. For example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexContents HTML* .htm .html</pre>
</td>
</tr>
</table>
<P>
If a title is found, it will still be checked for <CODE>FileRules title</CODE>, and the file will be skipped if a match is found. See <A HREF="#item_FileRules">FileRules</A>.
<P>
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.
<P>
For example, this will allow searching by image file name.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> NoContents .gif .xbm .au .mov .mpg .pdf .ps</pre>
</td>
</tr>
</table>
<P>
Note: Using this directive will <STRONG>not</STRONG> cause files with those suffixes to be indexed. That is, if you use <A HREF="#item_IndexOnly">IndexOnly</A> to limit the types of files that are indexed, then you must specify in <A HREF="#item_IndexOnly">IndexOnly</A> the same suffixes listed in
<A HREF="#item_NoContents">NoContents</A>.
<P>
This does <STRONG>not</STRONG> work:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Wrong!
IndexOnly .htm .html
NoContents .gif .xbm .au .mov .mpg .pdf .ps</pre>
</td>
</tr>
</table>
<P>
A <CODE>-S prog</CODE> program may set the <A HREF="#item_No_Contents_">No-Contents:</A> header to enable this feature for a specific document (although it would be
smarter for the <CODE>-S prog</CODE>
program to simply only send the pathname or title to be indexed.
<P><DT><STRONG><A NAME="item_ReplaceRules">ReplaceRules [replace|remove|prepend|append|regex]</A></STRONG><DD>
<P>
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.
<P>
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.
<P>
There are five operations you can specify: <STRONG>replace</STRONG>, <STRONG>append</STRONG>,
<STRONG>remove</STRONG>, <STRONG>prepend</STRONG>, and <STRONG>regex</STRONG> They will parse the pathname in the order you've typed these commands.
<P>
This directive uses C library regex.h regular expressions.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> 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"</pre>
</td>
</tr>
</table>
<P>
Remember, quotes are needed if an expression contains white space, and
backslashes have special meaning.
<P>
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 {}).
<P>
The <STRONG>replace</STRONG> string may use substitution variables:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> $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</pre>
</td>
</tr>
</table>
<P>
The <STRONG>options</STRONG> change the behavior of expression:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> i ignore the case when matching
g repeat the substitution for the entire pattern</pre>
</td>
</tr>
</table>
<P>
Examples:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ReplaceRules replace testdir/ anotherdir/
ReplaceRules replace [a-z_0-9]*_m.*\.html index.html</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ReplaceRules remove testdir/</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ReplaceRules prepend <A HREF="http://localhost/">http://localhost/</A>
ReplaceRules append .html</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ReplaceRules regex !^/web/(.+)/!<A HREF="http://">http://</A>$1.domain.com/!
replaces a file path:
/web/search/foo/index.html
with
<A HREF="http://search.domain.com/foo/index.html">http://search.domain.com/foo/index.html</A></pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ReplaceRules regex #^#<A HREF="http://localhost/www#">http://localhost/www#</A>
ReplaceRules prepend <A HREF="http://localhost/www">http://localhost/www</A> (same thing)</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Remove all extensions from C source files
ReplaceRules remove .c # ERROR! That "." is *any char*
ReplaceRules remove \.c # much better...</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ReplaceRules remove "\\.c" # if in quotes you need double-backslash!
ReplaceRules remove "\.c" # ERROR! "\." -> "." and is *any char*</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_IndexContents">IndexContents [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*] *file extensions*</A></STRONG><DD>
<P>
The <A HREF="#item_IndexContents">IndexContents</A> 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.
<P>
The XML2, HTML2, and TXT2 parsers are currently only available when Swish-e
is configured to use libxml2.
<P>
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.
<P>
Documents that are not assigned a parser with <A HREF="#item_IndexContents">IndexContents</A> will, by default, use the HTML2 parser if libxml2 is installed, otherwise
will use Swish-e's internal HTML parser. The <A HREF="#item_DefaultContents">DefaultContents</A> directive may be used to assign a parser to documents that do not match a
file extension defined with the <A HREF="#item_IndexContents">IndexContents</A> directive.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexContents HTML* .htm .html .shtml
IndexContents TXT* .txt .log .text
IndexContents XML* .xml</pre>
</td>
</tr>
</table>
<P>
HTML* is the default type for all files, unless otherwise specified (and
this default can be changed by the <STRONG>DefaultContents</STRONG> directive. Swish-e parses titles from HTML files, if available, and keeps
track of the context of the text for context searching (see <CODE>-t</CODE> in <A HREF="././SWISH-RUN.html">SWISH-RUN</A>).
<P>
If using filters (with the <A HREF="#item_FileFilter">FileFilter</A> 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:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilter .pdf pdf2html
IndexContent HTML .pdf</pre>
</td>
</tr>
</table>
<P>
See also <A HREF="#Document_Filter_Directives">Document Filter Directives</A>.
<P>
<STRONG>Note:</STRONG> Some of this may be changed in the future to use content-types instead of
file extensions. See <A HREF="././SWISH-3.0.html">SWISH-3.0</A>
<P><DT><STRONG><A NAME="item_DefaultContents">DefaultContents [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]</A></STRONG><DD>
<P>
This sets the default parser for documents that are not specified in
<STRONG>IndexContents</STRONG>. If not specified the default is HTML.
<P>
The XML2, HTML2, and TXT2 parsers are currently only available when Swish-e
is configured to use libxml2.
<P>
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.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> DefaultContents HTML</pre>
</td>
</tr>
</table>
<P>
The <A HREF="#item_DefaultContents">DefaultContents</A> directive <EM>should</EM> 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).
<P><DT><STRONG><A NAME="item_FileInfoCompression">FileInfoCompression [yes|NO]</A></STRONG><DD>
<P>
** This directive is currently not supported **
<P>
Setting <STRONG>FileInfoCompression</STRONG> to <CODE>yes</CODE> will compress the index file to save disk space. This may result in longer
indexing times. The default is <CODE>no</CODE>.
<P>
Also see the <CODE>-e</CODE> switch in <A HREF="././SWISH-RUN.html">SWISH-RUN</A> for saving RAM during indexing.
</DL>
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H2><A NAME="Document_Contents_Directives">Document Contents Directives</A></H2>
<P>
These directives control what information is extracted from your source
documents, and how that information is made available during searching.
<DL>
<P><DT><STRONG><A NAME="item_ConvertHTMLEntities">ConvertHTMLEntities [YES|no]</A></STRONG><DD>
<P>
ASCII <EM>entities</EM> can be converted automatically while indexing documents of type HTML (not
for HTML2). For performance reasons you may wish to set this to
<CODE>no</CODE> if your documents do not contain HTML entities. The default is <CODE>yes</CODE>.
<P>
If <A HREF="#item_ConvertHTMLEntities">ConvertHTMLEntities</A> is set <CODE>no</CODE> the entities will be indexed without conversion.
<P>
<STRONG>NOTE:</STRONG> Entities within XML files and files parsed with libxml2 (HTML2) are
converted regardless of this setting.
<P><DT><STRONG><A NAME="item_MetaNames">MetaNames *list of names*</A></STRONG><DD>
<P>
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 <CODE>subjects</CODE> and then you can search your documents for the word "foo" but
only return documents where "foo" is within the <CODE>subjects</CODE> META tag.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -w subjects=foo</pre>
</td>
</tr>
</table>
<P>
(See also the <CODE>-t</CODE> switch in <A HREF="././SWISH-RUN.html">SWISH-RUN</A> for information about
<EM>context</EM> searching in HTML documents.)
<P>
The <STRONG>MetaNames</STRONG> directive is a space separated list. For example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> MetaNames meta1 meta2 keywords subjects</pre>
</td>
</tr>
</table>
<P>
You may also use <A HREF="#item_UndefinedMetaTags">UndefinedMetaTags</A> to specify automatic extraction of meta names from your HTML and XML
documents, and also to ignore indexing content of meta tags.
<P>
META tags can have two formats in your <STRONG>HTML</STRONG> source documents:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <META NAME="meta1" CONTENT="some content"></pre>
</td>
</tr>
</table>
<P>
and (if using the HTML2/libxml2 parser)
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <meta1>
some content
</meta1></pre>
</td>
</tr>
</table>
<P>
But this second version is invalid HTML, and will generate a warning if
ParserWarningLevel is set (libxml2 only).
<P>
And in <STRONG>XML</STRONG> documents, use the format:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <meta1>
Some Content
</meta1></pre>
</td>
</tr>
</table>
<P>
Then you can limit your search to just META <STRONG>meta1</STRONG> like this:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -w 'meta1=(apples or oranges)'</pre>
</td>
</tr>
</table>
<P>
You may nest the XML and the start/end tag versions:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <keywords>
<tag1>
some content
</tag1>
<tag2>
some other content
</tag2>
<keywords></pre>
</td>
</tr>
</table>
<P>
Then you can search in both tag2 and tag2 with:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -w 'keywords=(query words)'</pre>
</td>
</tr>
</table>
<P>
Swish-e indexes all text as some metaname. The default is <CODE>swishdefault</CODE>, so these two queries are the same:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -w foo
swish-e -w swishdefault=foo</pre>
</td>
</tr>
</table>
<P>
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:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -w foo</pre>
</td>
</tr>
</table>
<P>
will find "foo" in the body, the title, or any meta tags.
<P>
Currently, there's no way to prevent Swish-e from indexing the title
contents along with the body contents, but see <A HREF="#item_UndefinedMetaTags">UndefinedMetaTags</A> for how to control the indexing of meta tags.
<P>
If you would like to search just the title text, you may use:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> MetaNames swishtitle</pre>
</td>
</tr>
</table>
<P>
This will index the title text separately under the built-in swish internal
meta name "swishtitle". You may then search like
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> 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</pre>
</td>
</tr>
</table>
<P>
In addition to swishtitle, you can limit searches to documents' path with:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> MetaNames swishdocpath</pre>
</td>
</tr>
</table>
<P>
Then to search for "foo" but also limit searches to documents
that include "manual" or "tutorial" in their path:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -w foo swishdocpath=(manual or tutorial)</pre>
</td>
</tr>
</table>
<P>
See also <A HREF="#item_ExtractPath">ExtractPath</A>.
<P><DT><STRONG><A NAME="item_MetaNameAlias">MetaNameAlias *meta name* *list of aliases*</A></STRONG><DD>
<P>
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:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> MetaNames summary
MetaNameAlias summary description overview</pre>
</td>
</tr>
</table>
<P>
Then all three tags will get indexed as meta tag "summary". You
can then search all the fields as:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w summary=foo</pre>
</td>
</tr>
</table>
<P>
The Alias work at search time, too. So these will also limit the search to
the "summary" meta name.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w description=foo
-w overview=foo</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_MetaNamesRank">MetaNamesRank integer *list of meta names*</A></STRONG><DD>
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> MetaNamesRank 4 subject
MetaNamesRank 3 swishdefault
MetaNamesRank 2 author publisher
MetaNamesRank -5 wrongwords</pre>
</td>
</tr>
</table>
<P>
This feature is still considered experimental. If you use it, please send
feedback to the discussion list.
<P><DT><STRONG><A NAME="item_HTMLLinksMetaName">HTMLLinksMetaName *metaname*</A></STRONG><DD>
<P>
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.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> HTMLLinksMetaName links</pre>
</td>
</tr>
</table>
<P>
Now, to limit searches to files with a link to "home.html" do
this:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w links='"home.html"'</pre>
</td>
</tr>
</table>
<P>
The double quotes force a phrase search.
<P>
To make Swish-e index links as normal text, you may use:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> HTMLLinksMetaName swishdefault</pre>
</td>
</tr>
</table>
<P>
This feature is only available with the libxml2 HTML parser.
<P><DT><STRONG><A NAME="item_ImageLinksMetaName">ImageLinksMetaName *metaname*</A></STRONG><DD>
<P>
Allows indexing of image links under a metaname. Normally, image URLs are
not indexed.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ImagesLinksMetaName images</pre>
</td>
</tr>
</table>
<P>
Now, if you would like to find pages that include a nice image of a beach:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w images='beach'</pre>
</td>
</tr>
</table>
<P>
To make Swish-e index links as normal text, you may use:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ImageLinksMetaName swishdefault</pre>
</td>
</tr>
</table>
<P>
This feature is only available with the libxml2 HTML parser.
<P><DT><STRONG><A NAME="item_IndexAltTagMetaName">IndexAltTagMetaName *tagname*|as-text</A></STRONG><DD>
<P>
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.
<P>
For example, by specifying a tag name:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexAltTagMetaName bar</pre>
</td>
</tr>
</table>
<P>
would make this markup:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <foo>
<img src="/someimage.png" alt="Alt text here">
</foo></pre>
</td>
</tr>
</table>
<P>
appear like
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <foo>
<bar>Alt text here</bar>
</foo></pre>
</td>
</tr>
</table>
<P>
Then the normal rules (<A HREF="#item_MetaNames">MetaNames</A> and <A HREF="#item_PropertyNames">PropertyNames</A>) apply to how that text is indexed.
<P>
If you use the special tag "as-text" then
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <foo>
<img src="/someimage.png" alt="Alt text here">
</foo></pre>
</td>
</tr>
</table>
<P>
simply becomes
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <foo>
Alt text here
</foo></pre>
</td>
</tr>
</table>
<P>
This feature is only available when using the libxml2 parser (HTML2 and
XML2).
<P><DT><STRONG><A NAME="item_AbsoluteLinks">AbsoluteLinks [yes|NO]</A></STRONG><DD>
<P>
If this is set true then Swish-e will attempt to convert relative URIs
extracted from HTML documents for use with <A HREF="#item_HTMLLinksMetaName">HTMLLinksMetaName</A> and
<A HREF="#item_ImageLinksMetaName">ImageLinksMetaName</A> 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* <A HREF="#item_ReplaceRules">ReplaceRules</A> has been applied to the document's pathname.
<P>
For example, say you wish to index image links under the metaname
"images".
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ImageLinksMetaName images</pre>
</td>
</tr>
</table>
<P>
If an image is located in <A
HREF="http://localhost/vacations/france/index.html">http://localhost/vacations/france/index.html</A>
and
<A HREF="#item_AbsoluteLinks">AbsoluteLinks</A> is set to no, then a image within that document:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <img src="beach.jpeg"></pre>
</td>
</tr>
</table>
<P>
will only index "beach.jpeg".
<P>
But, if you want more detail when searching, you can enable <A HREF="#item_AbsoluteLinks">AbsoluteLinks</A>
and Swish-e will index
"http://localhost/vacations/france/beach.jpeg". You can then look
for images of beaches, but only in France:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w images=(beach and france)</pre>
</td>
</tr>
</table>
<P>
This also means you can search for any images within France:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w images=(france)</pre>
</td>
</tr>
</table>
<P>
This feature is only available with the libxml2 HTML parser.
<P><DT><STRONG><A NAME="item_UndefinedMetaTags">UndefinedMetaTags [error|ignore|INDEX|auto]</A></STRONG><DD>
<P>
This directive defines the behavior of Swish-e during indexing when a meta
name is found but is <STRONG>not</STRONG> listed in <STRONG>MetaNames</STRONG>. There are four choices:
<DL>
<P><DT><STRONG>UndefinedMetaTags error</STRONG><DD>
<P>
If a meta name is found that is not listed in <STRONG>MetaNames</STRONG>
then indexing will be halted and an error reported.
<P><DT><STRONG>UndefinedMetaTags ignore</STRONG><DD>
<P>
The contents of the meta tag are ignored and <STRONG>not</STRONG> indexed unless a metaname has been defined with the <A HREF="#item_MetaNames">MetaNames</A> directive.
<P><DT><STRONG>UndefinedMetaTags index</STRONG><DD>
<P>
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.
<P><DT><STRONG>UndefinedMetaTags auto</STRONG><DD>
<P>
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 <STRONG>MetaNames</STRONG> directive.
</DL>
<P><DT><STRONG><A NAME="item_UndefinedXMLAttributes">UndefinedXMLAttributes [DISABLE|error|ignore|index|auto]</A></STRONG><DD>
<P>
This is similar to <A HREF="#item_UndefinedMetaTags">UndefinedMetaTags</A>, 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,
<A HREF="#item_UndefinedXMLAttributes">UndefinedXMLAttributes</A> can make
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <person age="23">
John Doe
</person></pre>
</td>
</tr>
</table>
<P>
look like the following to swish:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <person>
<person.age>
23
</person.age>
John Doe
</person></pre>
</td>
</tr>
</table>
<P>
What happens to the text "23" will depend on the setting of
<A HREF="#item_UndefinedXMLAttributes">UndefinedXMLAttributes</A>:
<DL>
<P><DT><STRONG><A NAME="item_disable">disable</A></STRONG><DD>
<P>
XML attributes are not parsed and not indexed. This is the default.
<P><DT><STRONG><A NAME="item_error">error</A></STRONG><DD>
<P>
If the concatenated meta name (e.g. person.age) is not listed in
<STRONG>MetaNames</STRONG> then indexing will be halted and an error reported.
<P><DT><STRONG><A NAME="item_ignore">ignore</A></STRONG><DD>
<P>
The contents of the meta tag are ignored and <STRONG>not</STRONG> indexed unless a metaname has been defined with the <A HREF="#item_MetaNames">MetaNames</A> directive.
<P><DT><STRONG><A NAME="item_index">index</A></STRONG><DD>
<P>
The contents of the meta tag are indexed, but placed in the main index
unless there's an enclosing metatag already in force.
<P><DT><STRONG><A NAME="item_auto">auto</A></STRONG><DD>
<P>
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.
<P>
See also the example below <CODE>XMLClassAttribues</CODE>.
</DL>
<P><DT><STRONG><A NAME="item_XMLClassAttributes">XMLClassAttributes *list of XML attribute names*</A></STRONG><DD>
<P>
Combines an XML class name with the element name to make up a metaname. For
example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> XMLClassAttributes class</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <person class="first">
John
</person>
<person class="last">
Doe
</person></pre>
</td>
</tr>
</table>
<P>
Will appear to Swish-e as:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <person>
<person.first>
John
</person.first>
</person>
<person>
<person.last>
Doe
</person.last>
</person></pre>
</td>
</tr>
</table>
<P>
How the data is indexed depends on <A HREF="#item_MetaNames">MetaNames</A> and <A HREF="#item_UndefinedMetaTags">UndefinedMetaTags</A>.
<P>
Here's an example using the following configuration which combines the two
directives <A HREF="#item_XMLClassAttributes">XMLClassAttributes</A> and <A HREF="#item_UndefinedXMLAttributes">UndefinedXMLAttributes</A>.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> XMLClassAttributes class
UndefinedMetaTags auto
UndefinedXMLAttributes auto
IndexContents XML2 .xml</pre>
</td>
</tr>
</table>
<P>
The source XML file looks like:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <xml> <person class="student" phone="555-1212" age="102"> John </person>
<person greeting="howdy">Bill</person> </xml></pre>
</td>
</tr>
</table>
<P>
Swish-e parses as:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ./swish-e -c 2 -i 1.xml -T parsed_tags parsed_text -v 0
Indexing Data Source: "File-System"</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <xml> (MetaName)</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <person> (MetaName)
<person.student> (MetaName)
<person.student.phone> (MetaName)
555-1212
</person.student.phone>
<person.student.age> (MetaName)
102
</person.student.age>
John
</person> </pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <person> (MetaName)
<person.greeting> (MetaName)
howdy
</person.greeting>
Bill
</person> </pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> </xml>
Indexing done!</pre>
</td>
</tr>
</table>
<P>
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").
<P><DT><STRONG><A NAME="item_ExtractPath">ExtractPath *metaname* [replace|remove|prepend|append|regex]</A></STRONG><DD>
<P>
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.
<P>
The extracted string will be indexed under the specified meta name.
<P>
See <A HREF="#item_ReplaceRules">ReplaceRules</A> for a description of the various pattern replacement methods, but you will
use the <EM>regex</EM> method.
<P>
For example, say your file system (or web tree) was organized into
departments:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> /web/sales/foo...
/web/parts/foo...
/web/accounting/foo...</pre>
</td>
</tr>
</table>
<P>
And you wanted a way to limit searches to just documents under
"sales".
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ExtractPath department regex !^/web/([^/]+)/.*$!$1!</pre>
</td>
</tr>
</table>
<P>
Which says, extract out the department name (as substring $1) and index it
as meta name <CODE>department</CODE>. Then to limit a search to the sales department:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -w foo AND department=sales</pre>
</td>
</tr>
</table>
<P>
Note that the <CODE>regex</CODE> method uses a substitution pattern, so to index only a sub-string match the <EM>entire</EM> document path in the regular expression, as shown above. Otherwise any part
that is not matched will end up in the substitution pattern.
<P>
See the <A HREF="#item_ExtractPathDefault">ExtractPathDefault</A> option for a way to set a value if not patterns match.
<P>
Although unlikely, you may use more than one <A HREF="#item_ExtractPath">ExtractPath</A> directive. More than one directive of the <EM>same</EM> 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).
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ExtractPath foo regex !^(...).+$!$1!
ExtractPath foo regex !^.+(.)$!$1!</pre>
</td>
</tr>
</table>
<P>
So, the third letter is indexed as meta name "foo" if both
patterns match.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ExtractPath foo regex !^X(...).+$!$1!
ExtractPath foo regex !^.+(.)$!$1!</pre>
</td>
</tr>
</table>
<P>
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 <A HREF="#item_ExtractPath">ExtractPath</A> directive with the same metaname.
<P>
The document path operated on is the real path swish used to access the
document. That is, the <A HREF="#item_ReplaceRules">ReplaceRules</A> directive has no effect on the path used with <A HREF="#item_ExtractPath">ExtractPath</A>.
<P>
The full path is used for each meta name if more than one <A HREF="#item_ExtractPath">ExtractPath</A>
directive is used. That is, changes to the path used in <CODE>ExtractPath foo</CODE> do not affect the path used by <CODE>ExtractPath bar</CODE>.
<P><DT><STRONG><A NAME="item_ExtractPathDefault">ExtractPathDefault *metaname* default_value</A></STRONG><DD>
<P>
This can be used with <A HREF="#item_ExtractPath">ExtractPath</A> to set a default string to index under the given metaname if none of the <A HREF="#item_ExtractPath">ExtractPath</A> patterns match.
<P>
For example, say your want to index each document with a metaname
"department" based on the following path examples:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> /web/sales/foo...
/web/parts/foo...
/web/accounting/foo...</pre>
</td>
</tr>
</table>
<P>
But you are also indexing documents that do not follow that pattern and you
want to search those separately, too.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ExtractPath department regex !^/web/([^/]+)/.*$!$1!
ExtractPathDefault department other</pre>
</td>
</tr>
</table>
<P>
Now, you may search like this:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -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.</pre>
</td>
</tr>
</table>
<P>
This basically is a shortcut for:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w foo not department=(sales or parts or accounting)</pre>
</td>
</tr>
</table>
<P>
but you don't need to keep track of what was extracted.
<P><DT><STRONG><A NAME="item_PropertyNames">PropertyNames *list of meta names*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_PropertyNamesCompareCase">PropertyNamesCompareCase *list of meta names*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_PropertyNamesIgnoreCase">PropertyNamesIgnoreCase *list of meta names*</A></STRONG><DD>
<P>
Swish-e allows you to specify certain META tags that can be used as <STRONG>document
properties</STRONG>. 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 <CODE>-p</CODE> and <CODE>-x</CODE> switches in
<A HREF="././SWISH-RUN.html">SWISH-RUN</A>).
<P>
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).
<P>
Another feature of properties is that Swish-e can use the PropertyNames for
sorting the search results (see the <CODE>-s</CODE> switch).
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> PropertyNames author subjects</pre>
</td>
</tr>
</table>
<P>
Two variations are available. <A HREF="#item_PropertyNamesCompareCase">PropertyNamesCompareCase</A> and
<A HREF="#item_PropertyNamesIgnoreCase">PropertyNamesIgnoreCase</A>. These tell Swish-e to either ignore or compare case when sorting results.
The default for <A HREF="#item_PropertyNames">PropertyNames</A> is to ignore the case.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> PropertyNamesIgnoreCase subject
PropertyNamesCompareCase keyword</pre>
</td>
</tr>
</table>
<P>
The defaults for "internal" properties are:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swishtitle -- ignore the case
swishdocpath -- compare case
swishdescription -- compare case</pre>
</td>
</tr>
</table>
<P>
These can be overridden with <A HREF="#item_PropertyNamesCompareCase">PropertyNamesCompareCase</A> and
<A HREF="#item_PropertyNamesIgnoreCase">PropertyNamesIgnoreCase</A>.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> PropertyNamesCompareCase swishtitle </pre>
</td>
</tr>
</table>
<P>
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 <A HREF="././INSTALL.html">INSTALL</A> manual page.
<P>
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.
<P><DT><STRONG><A NAME="item_PropertyNamesNoStripChars">PropertyNamesNoStripChars</A></STRONG><DD>
<P>
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.
<P>
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.
<P><DT><STRONG><A NAME="item_PropertyNamesNumeric">PropertyNamesNumeric</A></STRONG><DD>
<P>
This directive is similar to <A HREF="#item_PropertyNames">PropertyNames</A>, 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 <CODE>-s</CODE> and limiting with <CODE>-L</CODE> to sort and limit the property correctly.
<P>
Swish-e uses <CODE>strtoul(3)</CODE> to convert the string into an unsigned long integer. Therefore, only
positive integers can be stored.
<P>
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.
<P><DT><STRONG><A NAME="item_PropertyNamesDate">PropertyNamesDate</A></STRONG><DD>
<P>
This directive is exactly like <A HREF="#item_PropertyNamesNumeric">PropertyNamesNumeric</A>, but it also flags the number as a machine timestamp (seconds since
Epoch), and will print a formatted date when returning this property. See <CODE>-x</CODE> in <A HREF="././SWISH-RUN.html">SWISH-RUN</A>.
<P>
Swish-e will not parse dates when indexing; you must use a timestamp.
<P><DT><STRONG><A NAME="item_PropertyNameAlias">PropertyNameAlias *property name* *list of aliases*</A></STRONG><DD>
<P>
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:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> PropertyNameAlias swishtitle title titel ttulo titulo</pre>
</td>
</tr>
</table>
<P>
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.
<P><DT><STRONG><A NAME="item_PropertyNamesMaxLength">PropertyNamesMaxLength integer *list of meta names*</A></STRONG><DD>
<P>
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.
<P>
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).
<P>
In general, this feature will only be useful when parsing HTML or XML with
the libxml2 parser.
<P>
For example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> PropertyNamesMaxLength 1000 swishdescription
PropertyNameAlias swishdescription body</pre>
</td>
</tr>
</table>
<P>
Is somewhat like
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> StoreDescription HTML <body> 1000
StoreDescription XML <body> 1000
StoreDescription HTML2 <body> 1000
StoreDescription XML2 <body> 1000</pre>
</td>
</tr>
</table>
<P>
but StoreDescription allows setting the tag for each parser type.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> PropertyNamesMaxLength 1000 headings
PropertyNameAlias headings h1 h2 h3 h4</pre>
</td>
</tr>
</table>
<P>
collects all the heading text into a single property called
"headings", not to exceed 1000 characters.
<P><DT><STRONG><A NAME="item_PropertyNamesSortKeyLength">PropertyNamesSortKeyLength integer *list of meta names*</A></STRONG><DD>
<P>
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.
<P>
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.
<P><DT><STRONG><A NAME="item_PreSortedIndex">PreSortedIndex *list of property names*</A></STRONG><DD>
<P>
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.
<P>
If <A HREF="#item_PreSortedIndex">PreSortedIndex</A> it is <EM>not</EM> 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.
<P>
For example, if you only wish to sort results by a property called <CODE>title</CODE>:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> PropertyNames title age time
PreSortedIndex title</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_StoreDescription">StoreDescription [XML <tag> size|HTML <meta> size|TXT size]</A></STRONG><DD>
<P>
<STRONG>StoreDescription</STRONG> allows you to store a document description in the index file. This
description can be returned in your search results when the <CODE>-x</CODE>
switch is used to include the <EM>swishdescription</EM> for extended results, or by using <CODE>-p swishdescription</CODE>.
<P>
The document type (XML, HTML and TXT) must match the document type
currently being indexed as set by <A HREF="#item_IndexContents">IndexContents</A> or <A HREF="#item_DefaultContents">DefaultContents</A>. See those directives for possible values. A common problem is using <A HREF="#item_StoreDescription">StoreDescription</A>
yet not setting the document's type with <A HREF="#item_IndexContents">IndexContents</A> or
<A HREF="#item_DefaultContents">DefaultContents</A>. Another problem is different types:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexContents HTML2 .html
StoreDescription HTML <body></pre>
</td>
</tr>
</table>
<P>
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.
<P>
For text documents you specify the type TXT (or TXT2 or TXT*) and the
number of <EM>characters</EM> to capture.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> StoreDescription TXT 20</pre>
</td>
</tr>
</table>
<P>
The above stores only the first twenty characters from the text file in the
Swish-e index file.
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> StoreDescription HTML <body> 20000
StoreDescription XML <desc> 40</pre>
</td>
</tr>
</table>
<P>
Again, note that documents must be assigned a document type with
<A HREF="#item_IndexContents">IndexContents</A> or <A HREF="#item_DefaultContents">DefaultContents</A> to use this feature.
<P>
Swish-e will compress the descriptions (or any other large property) if
compiled to use zlib (see <A HREF="././INSTALL.html">INSTALL</A>). This is recommended when using StoreDescription and a large number of
documents. Compression of 30% to 50% is not uncommon with HTML files.
<P><DT><STRONG><A NAME="item_PropCompressionLevel">PropCompressionLevel [0-9]</A></STRONG><DD>
<P>
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.
<P>
The default depends on the default setting compiled with zlib, but is
typically six.
<P>
This option is useful when using <A HREF="#item_StoreDescription">StoreDescription</A> to store a large amount text in properties (or if using <A HREF="#item_PropertyNames">PropertyNames</A> with large property sizes).
<P>
Properties must be over a value defined in <EM>config.h</EM> (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.
<P>
This option is only available when Swish-e is compiled with zlib support.
<P><DT><STRONG><A NAME="item_TruncateDocSize">TruncateDocSize *number of characters*</A></STRONG><DD>
<P>
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.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> TruncateDocSize 10000000</pre>
</td>
</tr>
</table>
<P>
The default is zero, which means read all data.
<P>
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).
<P>
TruncateDocSize does not currently work with the <CODE>prog</CODE> input source method.
<P><DT><STRONG><A NAME="item_FuzzyIndexingMode">FuzzyIndexingMode NONE|Stemming|Soundex|Metaphone|DoubleMetaphone</A></STRONG><DD>
<P>
Selects the type of index to create. Only one type of index may be created.
<P>
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.
<P>
The available fuzzy indexing options can be displayed by running
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -T LIST_FUZZY_MODES</pre>
</td>
</tr>
</table>
<P>
Available options include:
<DL>
<P><DT><STRONG><A NAME="item_None">None</A></STRONG><DD>
<P>
Words are stored in the index without any conversion. This is the default.
<P><DT><STRONG><A NAME="item_Stemming_">Stemming_*</A></STRONG><DD>
<P>
This options uses one of the installed Snowball stemmers
(http://snowball.tartarus.org/).
<P>
The installed stemmers can be viewed by running
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -T LIST_FUZZY_MODES</pre>
</td>
</tr>
</table>
<P>
For example, to use the Spanish stemming module:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FuzzyIndexingMode Stemming_es</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_Stem">Stem or Stemming_en</A></STRONG><DD>
<P>
Selects the legacy Swish-e English stemmer.
<P>
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.
<P>
Words are converted using the Porter stemming algorithm.
<P>
From: <A
HREF="http://www.tartarus.org/~martin/PorterStemmer/">http://www.tartarus.org/~martin/PorterStemmer/</A>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> 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.</pre>
</td>
</tr>
</table>
<P>
This will help a search for "running" to also find
"run" and "runs", for example.
<P>
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.
<P>
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".
<P><DT><STRONG><A NAME="item_Soundex">Soundex</A></STRONG><DD>
<P>
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.
<P>
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.
<P><DT><STRONG><A NAME="item_Metaphone">Metaphone and DoubleMetaphone</A></STRONG><DD>
<P>
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.
<P>
From: <A
HREF="http://aspell.sourceforge.net/metaphone/">http://aspell.sourceforge.net/metaphone/</A>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> Lawrence Philips' Metaphone Algorithm is an algorithm which returns
the rough approximation of how an English word sounds.</pre>
</td>
</tr>
</table>
<P>
The <CODE>DoubleMetaphone</CODE> 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.
<P>
A metaphone index should give results somewhere in between Soundex and
Stemming.
</DL>
<P><DT><STRONG><A NAME="item_UseStemming">UseStemming [yes|NO]</A></STRONG><DD>
<P>
Put yes to apply word stemming algorithm during indexing, else no.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> UseStemming no
UseStemming yes</pre>
</td>
</tr>
</table>
<P>
When UseStemming is set to <CODE>yes</CODE> every word is stemmed before placing it in to the index.
<P>
This option is deprecated. It has been superceded by <A HREF="#item_FuzzyIndexingMode">FuzzyIndexingMode</A>.
<P><DT><STRONG><A NAME="item_UseSoundex">UseSoundex [yes|NO]</A></STRONG><DD>
<P>
When UseSoundex is set to <CODE>yes</CODE> every word is converted to a Soundex code before placing it in to the
index.
<P>
This option is deprecated. It has been superceded by <A HREF="#item_FuzzyIndexingMode">FuzzyIndexingMode</A>.
<P><DT><STRONG><A NAME="item_IgnoreTotalWordCountWhenRanking">IgnoreTotalWordCountWhenRanking [YES|no]</A></STRONG><DD>
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IgnoreTotalWordCountWhenRanking no</pre>
</td>
</tr>
</table>
<P>
The default was changed from no to yes in version 2.2.
<P>
<STRONG>NOTE:</STRONG> must be set to <STRONG>no</STRONG> if you intend to use the -R 1 option when searching.
<P><DT><STRONG><A NAME="item_MinWordLimit">MinWordLimit *integer*</A></STRONG><DD>
<P>
Set the minimum length of an word. Shorter words will not be indexed. The
default is 1 (as defined in <EM>src/config.h</EM>).
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> MinWordLimit 5</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_MaxWordLimit">MaxWordLimit *integer*</A></STRONG><DD>
<P>
Set the maximum length of an indexable word. Every longer word will not be
indexed. The Default is 40 (as defined in <EM>src/config.h</EM>).
<P><DT><STRONG><A NAME="item_WordCharacters">WordCharacters *string of characters*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_IgnoreFirstChar">IgnoreFirstChar *string of characters*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_IgnoreLastChar">IgnoreLastChar *string of characters*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_BeginCharacters">BeginCharacters *string of characters*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_EndCharacters">EndCharacters *string of characters*</A></STRONG><DD>
<P>
These settings define what a word consists of to the Swish-e indexing
engine. Compiled in defaults are in <EM>src/config.h</EM>.
<P>
When indexing Swish-e uses <STRONG>WordCharacters</STRONG> 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.
<P>
For example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> WordCharacters abde</pre>
</td>
</tr>
</table>
<P>
Would turn "abcde" into two words "ab" and
"de".
<P>
Next, of these words, any characters defined in <STRONG>IgnoreFirstChar</STRONG> are stripped off the start of the word, and <STRONG>IgnoreLastChar</STRONG> 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.
<P>
Finally, the resulting words MUST begin with one of the characters listed
in <STRONG>BeginCharacters</STRONG> and end with one of the characters listed in
<STRONG>EndCharacters</STRONG>. BeginCharacters and EndCharacters must be a subset of the characters in
WordCharacters. Often, WordCharacters, BeginCharacters and EndCharacters
will all be the same.
<P>
Note that the same process applies to the query while searching.
<P>
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 <CODE>-v 4</CODE>, <CODE>-D</CODE> and <CODE>-k</CODE> searching switches).
<P>
Currently there is only support for eight-bit characters.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> WordCharacters .abcdefghijklmnopqrstuvwxyz
BeginCharacters abcdefghijklmnopqrstuvwxyz
EndCharacters abcdefghijklmnopqrstuvwxyz
IgnoreFirstChar .
IgnoreLastChar .</pre>
</td>
</tr>
</table>
<P>
So the string
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> Please visit <A HREF="http://www.example.com/path/to/file.html.">http://www.example.com/path/to/file.html.</A></pre>
</td>
</tr>
</table>
<P>
will be indexed as the following words:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> please
visit
http
www.example.com
path
to
file.html</pre>
</td>
</tr>
</table>
<P>
Which means that you can search for <CODE>www.example.com</CODE> as a single word, but searching for just <CODE>example</CODE> will not find the document.
<P>
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 <CODE>0123456789&#;</CODE> to index entities. See also <A HREF="#item_ConvertHTMLEntities">ConvertHTMLEntities</A>
<P><DT><STRONG><A NAME="item_Buzzwords">Buzzwords [*list of buzzwords*|File: path]</A></STRONG><DD>
<P>
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.
<P>
Buzzwords are case insensitive.
<P>
Buzzwords should be separated by spaces and may span multiple directives.
If the special format <CODE>File:filename</CODE> is used then the Buzzwords will be read from an external file during
indexing.
<P>
Examples:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> Buzzwords C++ TCP/IP</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> Buzzwords File: ./buzzwords.lst</pre>
</td>
</tr>
</table>
<P>
If a Buzzword contains search operator characters they must be backslashed
when searching. For example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> Buzzwords C++ TCP/IP web=http</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ./swish-e -w 'web\=http'</pre>
</td>
</tr>
</table>
<P>
Buzzwords are found by splitting the text on whitespace, removing
<A HREF="#item_IgnoreFirstChar">IgnoreFirstChar</A> and <A HREF="#item_IgnoreLastChar">IgnoreLastChar</A> characters from the word, and then comparing with the list of <A HREF="#item_Buzzwords">Buzzwords</A>. Therefore, if adding <A HREF="#item_Buzzwords">Buzzwords</A> to an index you will probably want to define <A HREF="#item_IgnoreFirstChar">IgnoreFirstChar</A> and
<A HREF="#item_IgnoreLastChar">IgnoreLastChar</A> settings.
<P>
Note: Buzzwords specific settings for <A HREF="#item_IgnoreFirstChar">IgnoreFirstChar</A> and <A HREF="#item_IgnoreLastChar">IgnoreLastChar</A>
may be used in the future.
<P><DT><STRONG><A NAME="item_IgnoreWords">IgnoreWords [*list of stop words*|File: path]</A></STRONG><DD>
<P>
The IgnoreWords option allows you to specify words to ignore, called
<EM>stopwords</EM>. The default is to not use any stopwords.
<P>
Words should be separated by spaces and may span multiple directives. If
the special format <CODE>File:filename</CODE> is used then the stop words will be read from an external file during
indexing.
<P>
In previous versions of Swish-e you could use the directive
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IgnoreWords swishdefault - obsolete!</pre>
</td>
</tr>
</table>
<P>
to include a default list of compiled in stopwords. This keyword is no
longer supported.
<P>
Examples:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IgnoreWords www http a an the of and or</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IgnoreWords File: ./stopwords.de</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_UseWords">UseWords [*list of words*|File: path]</A></STRONG><DD>
<P>
UseWords defines the words that Swish-e will index. <STRONG>Only</STRONG> the words listed will be indexed.
<P>
You can specify a list of words following the directive (you may specify
more than one <A HREF="#item_UseWords">UseWords</A> directive in a config file), and/or use the <CODE>File:</CODE> form to specify a path to a file containing the words:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> UseWords perl python pascal fortran basic cobal php
UseWords File: /path/to/my/wordlist</pre>
</td>
</tr>
</table>
<P>
Please drop the Swish-e list a note if you actually use this feature. It
may be removed from future versions.
<P><DT><STRONG><A NAME="item_IgnoreLimit">IgnoreLimit *integer integer*</A></STRONG><DD>
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IgnoreLimit 50 1000</pre>
</td>
</tr>
</table>
<P>
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 <STRONG>IngoreWords</STRONG>
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.
<P><DT><STRONG><A NAME="item_IgnoreMetaTags">IgnoreMetaTags *list of names*</A></STRONG><DD>
<P>
<A HREF="#item_IgnoreMetaTags">IgnoreMetaTags</A> 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 (<A HREF="#item_MetaNames">MetaNames</A>) and properties (<A HREF="#item_PropertyNames">PropertyNames</A>). To still parse properties, yet do not index the text, see
<A HREF="#item_UndefinedMetaTags">UndefinedMetaTags</A>.
<P>
This option is useful to avoid indexing specific data from a file. For
example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <person>
<first_name>
William
</first_name> <last_name>
Shakespeare
</last_name> <updated_date>
April 25, 1999
</updated_date>
</person></pre>
</td>
</tr>
</table>
<P>
In the above example you might <STRONG>not</STRONG> want to index the updated date, and therefore prevent finding this record
by searching
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w 'person=(April)'</pre>
</td>
</tr>
</table>
<P>
This is solved by:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IgnoreMetaTags updated_date</pre>
</td>
</tr>
</table>
<P>
See also <A HREF="#item_UndefinedMetaTags">UndefinedMetaTags</A>.
<P><DT><STRONG><A NAME="item_IgnoreNumberChars">IgnoreNumberChars *list of characters*</A></STRONG><DD>
<P>
Experimental Feature
<P>
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 <A HREF="#item_WordCharacters">WordCharacters</A>
settings. In other words, the "word" checked is a word that
Swish-e would otherwise index.
<P>
For example,
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IgnoreNumberChars 0123456789$.,</pre>
</td>
</tr>
</table>
<P>
Then Swish-e would not index the following:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> 123
123,456.78
$123.45</pre>
</td>
</tr>
</table>
<P>
You might be tempted to avoid indexing hex numbers with:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IgnoreNumberChars 0123456789abcdef</pre>
</td>
</tr>
</table>
<P>
which will not index 0D31, but will also not index the word
"bad".
<P>
This is an experimental feature that may change in future versions. One
possible change is to use regular expressions instead.
<P><DT><STRONG><A NAME="item_IndexComments">IndexComments [NO|yes]</A></STRONG><DD>
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexComments yes</pre>
</td>
</tr>
</table>
<P>
Note: This is a change in the default behavior prior to version 2.2.
<P><DT><STRONG><A NAME="item_TranslateCharacters">TranslateCharacters [*string1 string2*|:ascii7:]</A></STRONG><DD>
<P>
The TranslateCharacters directive maps the characters in string1 to the
characters listed in string2.
<P>
For example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # This will index a_b as a-b and mo as amo
TranslateCharacters _ -a</pre>
</td>
</tr>
</table>
<P>
<CODE>TranslateCharacters :ascii7:</CODE> 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.
<P>
TranslateCharacters is done early in the indexing process, after converting
HTML entities but before splitting the input text into words based on <STRONG>WordCharacters</STRONG>. So characters you are translating <EM>from</EM>
do not need to be listed in word characters.
<P>
The same character translations take place when searching.
<P><DT><STRONG><A NAME="item_BumpPositionCounterCharacters">BumpPositionCounterCharacters *string*</A></STRONG><DD>
<P>
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.
<P>
For example, if you have a tag:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <subjects>
computer programming | apple computers
</subjects></pre>
</td>
</tr>
</table>
<P>
You might want to prevent matching "programming apple" in that
meta name.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> BumpPositionCounterCharacters |</pre>
</td>
</tr>
</table>
<P>
There is no default, and you may list a string of characters.
<P><DT><STRONG><A NAME="item_DontBumpPositionOnEndTags">DontBumpPositionOnEndTags *list of names*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_DontBumpPositionOnStartTags">DontBumpPositionOnStartTags *list of names*</A></STRONG><DD>
<P>
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. <A HREF="#item_DontBumpPositionOnEndTags">DontBumpPositionOnEndTags</A> and
<A HREF="#item_DontBumpPositionOnStartTags">DontBumpPositionOnStartTags</A> disables this feature for the listed metanames.
<P>
For example,
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> <person>
<first_name>
William
</first_name>
<last_name>
Shakespeare
</last_name>
<updated_date>
April 25, 1999
</updated_date>
</person></pre>
</td>
</tr>
</table>
<P>
In the configuration file:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> DontBumpPositionOnEndTags first_name
DontBumpPositionOnStartTags last_name</pre>
</td>
</tr>
</table>
<P>
This configuration allows this phrase search
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w 'person=("william shakespeare")'</pre>
</td>
</tr>
</table>
<P>
but this phrase search will fail
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> -w 'person=("shakespeare april")'</pre>
</td>
</tr>
</table>
</DL>
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H2><A NAME="Directives_for_the_File_Access_method_only">Directives for the File Access method only</A></H2>
<P>
Some directives have different uses depending on the source of the
documents. These directives are only valid when using the <STRONG>File system</STRONG>
method of indexing.
<DL>
<P><DT><STRONG><A NAME="item_IndexOnly">IndexOnly *list of file suffixes*</A></STRONG><DD>
<P>
This directive specifies the allowable file suffixes (extensions) while
indexing. The default is to index all files specified in <STRONG>IndexDir</STRONG>.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Only index .html .htm and .q files
IndexOnly .html .htm .q</pre>
</td>
</tr>
</table>
<P>
<A HREF="#item_IndexOnly">IndexOnly</A> checks that the file end in the characters listed. It does not check
"extensions". <A HREF="#item_IndexOnly">IndexOnly</A> is tested right before <A HREF="#item_FileRules">FileRules</A> is processed.
<P><DT><STRONG><A NAME="item_FollowSymLinks">FollowSymLinks [yes|NO]</A></STRONG><DD>
<P>
Put "yes" to follow symbolic links in indexing, else
"no". Default is no.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FollowSymLinks no
FollowSymLinks yes</pre>
</td>
</tr>
</table>
<P>
Note that when set to <CODE>no</CODE> extra <CODE>stat(2)</CODE> 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 <CODE>yes</CODE>.
<P>
See also the <CODE>-l</CODE> switch in <A HREF="././SWISH-RUN.html">SWISH-RUN</A>.
<P><DT><STRONG><A NAME="item_FileRules">FileRules [type] [contains|is|regex] *regular expression*</A></STRONG><DD>
<P><DT><STRONG><A NAME="item_FileMatch">FileMatch [type] [contains|is|regex] *regular expression*</A></STRONG><DD>
<P>
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 <A HREF="#item_FollowSymLinks">FollowSymLinks</A>) you will typically only use <A HREF="#item_FileRules">FileRules</A> to exclude files or directories. <A HREF="#item_FileMatch">FileMatch</A> is useful in a few cases, for example, to override the behavior of <A HREF="#item_IndexOnly">IndexOnly</A>. Some examples are included below.
<P>
Except for <CODE>FileRules title ...</CODE>, this feature is only available for file access method (-S fs), which is
the default indexing mode. Also, any pathname modification with <A HREF="#item_ReplaceRules">ReplaceRules</A> happens after the check for <A HREF="#item_FileRules">FileRules</A>. (It's unlikely that you would exclude files with <A HREF="#item_FileRules">FileRules</A> based on text you added with <A HREF="#item_ReplaceRules">ReplaceRules</A>!)
<P>
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.
<P>
The regular expression is compared against <STRONG>[type]</STRONG> as described below.
<P>
For historical reasons, you can specify <CODE>contains</CODE> or <CODE>is</CODE>. <CODE>is</CODE> simply forces the regular expression to match at the start and end of the
string (by internally prepending "^" and appending "$"
to the regular expression).
<P>
The <CODE>regex</CODE> option requires delimiter characters:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules title regex /^private/i</pre>
</td>
</tr>
</table>
<P>
The only advantage of <CODE>regex</CODE> 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.
<P>
Use quotes (" or ') around a pattern if it contains any white space.
Note that the backslash character becomes the escape character within
quotes.
<P>
For example, these sets generate the same regular expressions.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules title is hello
FileRules title contains ^hello$
FileRules title regex /^hello$/</pre>
</td>
</tr>
</table>
<P>
These all need quotes due to the included space character
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules title is "hello there"
FileRules title contains "^hello there$"
FileRules title regex "!^hello there$!"</pre>
</td>
</tr>
</table>
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules filename regex /\.pdf/
FileRules filename regex "/\\.pdf/"</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules filename regex !hello\\there! # need double for real backslash
FileRules filename regex "!hello\\\\there!" # need double-double inside of quotes</pre>
</td>
</tr>
</table>
<P>
<STRONG>Matching Types</STRONG>
<P>
The following types of match strings my be supplied:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules pathname
FileRules dirname
FileRules filename
FileRules directory
FileRules title</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileMatch pathname
FileMatch filename
FileMatch dirname
FileMatch directory</pre>
</td>
</tr>
</table>
<P>
<STRONG>pathname</STRONG> matches the regular expression against the current pathname. The pathname
may or may not be absolute depending on what you supplied to
<A HREF="#item_IndexDir">IndexDir</A>.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Don't index paths that contain private or hidden
FileRules pathname contains (private|hidden)</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Same thing
FileRules pathname regex /(private|hidden)/</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Don't index exe files
FileRules pathname contains \.exe$</pre>
</td>
</tr>
</table>
<P>
<STRONG>dirname</STRONG> and <STRONG>filename</STRONG> 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 <STRONG>not</STRONG> have a trailing slash. All path names use the forward slash as a delimiter
within Swish-e.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Same as last example - don't index *.exe files.
FileRules filename contains \.exe$</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Don't index any file called test.html files
FileRules filename contains ^test\.html$</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Same thing
FileRules filename is test\.html</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Don't index any directories that contain "old" (/usr/local/myold/docs)
FileRules dirname contains old</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Don't index any directories that contain the path segment "old" (/usr/local/old/foo)
FileRules dirname contains /old/ </pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Index only .htm, .html, plus any all-digit file names
IndexOnly .htm .html
FileMatch filename contains ^\d+$</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Same as previous, but maybe a little slower
FileRules filename regex not !\.(htm|html)$!
FileMatch filename contains ^\d+$</pre>
</td>
</tr>
</table>
<P>
Swish-e checks these settings in the order of <CODE>pathname</CODE>, <CODE>dirname</CODE>, and
<CODE>filename</CODE>, and <A HREF="#item_FileMatch">FileMatch</A> patterns are checked before <A HREF="#item_FileRules">FileRules</A>, in general. This allows you to exclude most files with <A HREF="#item_FileRules">FileRules</A>, yet allow in a few special cases with <A HREF="#item_FileMatch">FileMatch</A>. For example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # 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</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Same, but as a single pattern
FileMatch filename is (baseball\.bat|incoming_mail\.bin)</pre>
</td>
</tr>
</table>
<P>
The <CODE>directory</CODE> type is somewhat unique. When Swish-e recurses into a directory it will
compare all the <EM>files</EM> 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.
<P>
A <CODE>FileRules directory</CODE> match will cause Swish-e to ignore all files and sub-directories in the
current directory.
<P>
Warning: A match with <CODE>FileMatch directory</CODE> says to index <STRONG>everything</STRONG> in the *current* directory and <STRONG>ignore</STRONG> any FileRules for this directory.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Don't index any directories (and sub directories) that contain
# a file (or sub-directory) called "index.skip"
FileRules directory contains ^index\.skip$</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # Don't index directories that contain a .htaccess file.
FileRules directory contains ^\.htaccess</pre>
</td>
</tr>
</table>
<P>
Note: While <EM>processing</EM> 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 <A HREF="#item_IndexDir">IndexDir</A> or <CODE>-i</CODE>.
<P>
<CODE>title</CODE> checks for a pattern match in an HTML title.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules title contains construction example pointers</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> # This example says to ignore case
FileRules title regex "/^Internal document/i"</pre>
</td>
</tr>
</table>
<P>
Note: <CODE>FileRules title</CODE> works for any input method (fs, prog, or http) that is parsed as HTML, and
where a title was found in the document.
<P>
In case all this seems a bit confusing, processing a directory happens in
the following order.
<P>
First the directory name is checked:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules dirname - reject entire directory if matches</pre>
</td>
</tr>
</table>
<P>
Next the directory is scanned and each file name (which might be the name
of a sub-directory) is checked:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules directory - reject entire dir if *any* files match
FileMatch directory - accept entire dir if *any* files match</pre>
</td>
</tr>
</table>
<P>
Then, unless <CODE>FileMatch directory</CODE> matched, each file is tested with FileMatch. A match says to index the file
without further testing (i.e. overrides FileRules and IndexOnly):
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileMatch pathname \
FileMatch dirname - file is accepted if any match
FileMatch filename /</pre>
</td>
</tr>
</table>
<P>
otherwise
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexOnly - file is checked for the correct file extension</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules pathname \
FileRules dirname - file is rejected if any match
FileRules filename /</pre>
</td>
</tr>
</table>
<P>
finally, the file is indexed.
<P>
Files (not directories) listed with <A HREF="#item_IndexDir">IndexDir</A> or <CODE>-i</CODE> are processed in a similar way:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileMatch pathname \
FileMatch dirname - file is accepted if any match
FileMatch filename /</pre>
</td>
</tr>
</table>
<P>
otherwise, the file is rejected if it doesn't have the correct extension or
a FileRules matches.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexOnly - file is checked for the correct file extension</pre>
</td>
</tr>
</table>
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileRules pathname \
FileRules dirname - file is rejected if any match
FileRules filename /</pre>
</td>
</tr>
</table>
<P>
Note: If things are not indexing as you expect, create a directory with
some test files and use the <CODE>-T regex</CODE> trace option to see how file names are checked. Start with very simple
tests!
</DL>
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H2><A NAME="Directives_for_the_HTTP_Access_Method_Only">Directives for the HTTP Access Method Only</A></H2>
<P>
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.
<P>
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.
<P>
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.
<P>
These directives below are available when using the HTTP Access Method of
indexing.
<DL>
<P><DT><STRONG><A NAME="item_MaxDepth">MaxDepth *integer*</A></STRONG><DD>
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> MaxDepth 5</pre>
</td>
</tr>
</table>
<P>
Note: The default was changed from 5 to 0 in release 2.4.0
<P><DT><STRONG><A NAME="item_Delay">Delay *seconds*</A></STRONG><DD>
<P>
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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> Delay 1</pre>
</td>
</tr>
</table>
<P>
Note: The default was changed from 60 to 5 seconds in release 2.4.0
<P><DT><STRONG><A NAME="item_TmpDir">TmpDir *path*</A></STRONG><DD>
<P>
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 <CODE>-e</CODE>
switch causes Swish-e to use this directory while indexing. There is no
default.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> TmpDir /tmp/swish</pre>
</td>
</tr>
</table>
<P>
If this directory does not exist or is not writable Swish-e will fail with
an error during indexing.
<P>
Note, the environment variables of <CODE>TMPDIR</CODE>, <CODE>TMP</CODE>, and <CODE>TEMP</CODE> (in that order) will <STRONG>override</STRONG> this setting.
<P><DT><STRONG><A NAME="item_SpiderDirectory">SpiderDirectory *path*</A></STRONG><DD>
<P>
The location of the Perl helper script called <EM>swishspider</EM>. 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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> SpiderDirectory /usr/local/swish</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_EquivalentServer">EquivalentServer *server alias*</A></STRONG><DD>
<P>
Often times the same site may be referred to by different names. A common
example is that often <A
HREF="http://www.some-server.com">http://www.some-server.com</A> and <A
HREF="http://some-server.com">http://some-server.com</A> 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.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> EquivalentServer <A HREF="http://library.berkeley.edu">http://library.berkeley.edu</A> <A HREF="http://www.lib.berkeley.edu">http://www.lib.berkeley.edu</A>
EquivalentServer <A HREF="http://sunsite.berkeley.edu:2000">http://sunsite.berkeley.edu:2000</A> <A HREF="http://sunsite.berkeley.edu">http://sunsite.berkeley.edu</A></pre>
</td>
</tr>
</table>
</DL>
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H2><A NAME="Directives_for_the_prog_Access_Method_Only">Directives for the prog Access Method Only</A></H2>
<P>
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.
<P>
See <A HREF="././SWISH-RUN.html#item_prog">prog - general purpose access method</A> in the SWISH-RUN man page for more information.
<P>
A number of example programs for use with the "prog" access
method are provided in the <EM>prog-bin</EM> directory. Please see those example if you have questions about
implementing a "prog" input program.
<DL>
<P><DT><STRONG><A NAME="item_SwishProgParameters">SwishProgParameters *list of parameters*</A></STRONG><DD>
<P>
This is a list of parameters that will be sent to the external program when
running with the "prog" document source method.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> SwishProgParameters /path/to/config hello there
IndexDir /path/to/program.pl</pre>
</td>
</tr>
</table>
<P>
Then running:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -c config -S prog</pre>
</td>
</tr>
</table>
<P>
Swish-e will execute <CODE>/path/to/program.pl</CODE> and pass <CODE>/path/to/config hello
there</CODE> 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.
<P>
For example, the <CODE>spider.pl</CODE> program (included in the <CODE>prog-bin</CODE> directory) uses the <A HREF="#item_SwishProgParameters">SwishProgParameters</A> to specify what file to read for configuration information.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> SwishProgParameters spider.config
IndexDir ./spider.pl</pre>
</td>
</tr>
</table>
<P>
The <CODE>spider.pl</CODE> program also has a default action so you can avoid using a configuration
file:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> SwishProgParameters default <A HREF="http://www.swishe.org/">http://www.swishe.org/</A> <A HREF="http://some.other.site/">http://some.other.site/</A>
IndexDir ./spider.pl</pre>
</td>
</tr>
</table>
<P>
And the spider program will use default settings for spidering those sites.
<P>
Swish-e can read documents from standard input, so another way to run an
external program with parameters is:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> ./spider.pl spider.conf | ./swish-e -S prog -i stdin</pre>
</td>
</tr>
</table>
</DL>
<P>
<STRONG>Notes when using MS Windows</STRONG>
<P>
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 <A HREF="#item_IndexDir">IndexDir</A> or the <CODE>-i</CODE> command line option.
<P>
In addition, Swish-e will make sure the program specified actually exists,
which means you need to use the full name of the program.
<P>
For example, to run the perl spider program <EM>spider.pl</EM> you would need a Swish-e configuration file such as:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> IndexDir e:/perl/bin/perl.exe
SwishProgParameters prog-bin/spider.pl default <A HREF="http://swish-e.org">http://swish-e.org</A></pre>
</td>
</tr>
</table>
<P>
and run indexing with the command:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> swish-e -c swish.cfg -S prog -v 9</pre>
</td>
</tr>
</table>
<P>
The <A HREF="#item_IndexDir">IndexDir</A> 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.
<P>
The <A HREF="#item_SwishProgParameters">SwishProgParameters</A> are the parameters passed to the program specified by <A HREF="#item_IndexDir">IndexDir</A> (perl.exe in this case). The first parameter is the perl script to run (<EM>prog-bin/spider.pl</EM>). Perl passes the rest of the parameters directly to the perl script. The
second parameter <EM>default</EM> tells the
<EM>spider.pl</EM> program to use default settings for spidering (or you could specify a
spider config file -- see <CODE>perldoc spider.pl</CODE> for details), and lastly, the URL is passed into the spider program.
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H2><A NAME="Document_Filter_Directives">Document Filter Directives</A></H2>
<P>
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.
<P>
You may wish to read the Swish-e FAQ question on filtering before
continuing here. <A HREF="././SWISH-FAQ.html#How_Do_I_filter_documents_">How Do I filter documents?</A>
<P>
There are two suggested methods for filtering.
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H3><A NAME="Filtering_with_SWISH_Filter">Filtering with SWISH::Filter</A></H3>
<P>
The Swish-e distribution includes a Perl module called SWISH::Filter and
individual filters located in the <EM>filters</EM> 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.
<P>
The advantage of this method is that new filtering methods can be installed
easily.
<P>
This system is designed to work with the -S http and -prog methods, but may
also be used with the <A HREF="#item_FileFilter">FileFilter</A> feature and -S fs indexing method. See
<EM>$prefix/share/doc/swish-e/examples/filter-bin/swish_filter.pl</EM> for an example.
<P>
See the <EM>filters/README</EM> file for more information.
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H3><A NAME="Filtering_with_the_FileFilter_feature">Filtering with the FileFilter feature</A></H3>
<P>
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
<STRONG>FileFilter</STRONG> or <STRONG>FileFilterMatch</STRONG> directives. <STRONG>FileFilterMatch</STRONG>
matches using regular expressions and is described below.
<P>
Filters may be used with any type of input method (i.e. -S fs, -S http, or
-S prog). But because
<P>
Swish-e calls the external program passing as <STRONG>default</STRONG> arguments:
<DL>
<P><DT><STRONG><A NAME="item__0">$0</A></STRONG><DD>
<P>
the name of the filter program
<P><DT><STRONG><A NAME="item__1">$1</A></STRONG><DD>
<P>
the physical path name of the file to read. This may be a temporary file
location if indexing by the http method.
<P><DT><STRONG><A NAME="item__2">$2</A></STRONG><DD>
<P>
When indexing under the file system this will be the same as
<CODE>$1</CODE> (the path to the source file), but when indexing under the
http method this will be the URL of the source document.
</DL>
<P>
Swish-e can also pass other parameters to the filter program. These
parameters can be defined using the <STRONG>FileFilter</STRONG> or <STRONG>FileFilterMatch</STRONG>
directives. See Filter Options below.
<P>
The filter program must open the file, process its contents, and return it
to Swish-e by printing to STDOUT.
<P>
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.
<DL>
<P><DT><STRONG><A NAME="item_FilterDir">FilterDir *path-to-directory*</A></STRONG><DD>
<P>
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
<STRONG>FileFilter</STRONG> directive. If this directive is omitted, you have to specify the full path
to the filterscript on each FileFilter directive.
<P>
This feature does *not* apply to the <A HREF="#item_FileFilterMatch">FileFilterMatch</A> directive.
<P>
Example:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FilterDir /usr/local/swish/filters</pre>
</td>
</tr>
</table>
<P><DT><STRONG><A NAME="item_FileFilter">FileFilter *suffix* "filter-prog" ["filter-options"]</A></STRONG><DD>
<P>
This maps file suffix (extension) to a filter program. If <EM>filter-prog</EM>
starts with a directory delimiter (absolute path), Swish-e doesn't use the
FilterDir settings, but uses the given <EM>filter-prog</EM> path directly.
<P>
Filter options:
<P>
Filter options are a string passed as arguments to the <EM>filter-prog</EM>. Filter options can contain variables, replaced by Swish-e. If you omit
<EM>filter-options</EM> Swish-e will use default parameters for the options listed above.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> Default: "'%p' '%P'"
Which means: pass "workfile path" and "documentfile path" to filter (each quoted).</pre>
</td>
</tr>
</table>
<P>
Variables in filter options:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> %% = %
%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</pre>
</td>
</tr>
</table>
<P>
Examples of strings passed:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> %P = document pathname: <A HREF="http://myserver/path1/mydoc.txt">http://myserver/path1/mydoc.txt</A>
%p = work pathname: /tmp/tmp.1234.mydoc.txt
%F = mydoc.txt
%f = tmp.1234.mydoc.txt
%D = <A HREF="http://myserver/path1">http://myserver/path1</A>
%d = /tmp</pre>
</td>
</tr>
</table>
<P>
Important hint for security:
<P>
When using variable substitution, use quotes to ensure filename integrity.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> e.g. "'%f'" --> 'file name with spaces.doc'.</pre>
</td>
</tr>
</table>
<P>
If you don't use this, your system security may be compromised, or
filtering may not work for these files.
<P>
<STRONG>Notes when using MS Windows</STRONG>
<P>
Windows uses double quotes to escape shell metacharacters, so reverse the
quotes in the examples above. e.g.:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> '"%f"' --> "file name with spaced.doc"</pre>
</td>
</tr>
</table>
<P>
You can specify the filter program using forward slashes (unix style).
Swish will convert the slashes to backslashes before running your program.
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilter .mydoc c:/some/path/mydocfilter.exe '-d "%d" -example -url "%P" "%f"'</pre>
</td>
</tr>
</table>
<P>
Examples of filters:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> 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'"</pre>
</td>
</tr>
</table>
<P>
The above examples are running a <EM>binary</EM> 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:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilter .pdf pdf2html.sh
FileFilter .ps ghostscript-filter.pl</pre>
</td>
</tr>
</table>
<P>
Using a scripting language (or any language that has a large startup cost)
can
<STRONG>greatly increase the indexing time</STRONG>. 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 <CODE>-S prog</CODE> access method where the script will only be compiled once, instead of for
each document.
<P>
Filters are probably easier to write than a <CODE>-S prog</CODE> program. Which you decide to use depends on your requirements. Examples of
filter scripts can be found in the <EM>filter-bin</EM> directory, and examples of <CODE>-S prog</CODE> programs can be found in the <EM>prog-bin</EM> directory.
<P><DT><STRONG><A NAME="item_FileFilterMatch">FileFilterMatch *filter-prog* *filter-options* *regex* [*regex* ...]</A></STRONG><DD>
<P>
This is similar to <A HREF="#item_FileMatch">FileMatch</A> except uses regular expressions to match against the file name.
*filter-prog* is the path to the program. Unlike
<A HREF="#item_FileFilter">FileFilter</A> this does <STRONG>not</STRONG> use the <A HREF="#item_FilterDir">FilterDir</A> option. Also unlike
<A HREF="#item_FileFilter">FileFilter</A> you <STRONG>must</STRONG> specify the *filter-options*.
<P>
Examples:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilterMatch ./pdftotext "'%p' -" /\.pdf$/</pre>
</td>
</tr>
</table>
<P>
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:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilterMatch ./pdftotext "'%p' -" /.\.pdf$/</pre>
</td>
</tr>
</table>
<P>
To specify more than one extension:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilterMatch ./check_title.pl "%p" /\.html$/ /\.htm$/</pre>
</td>
</tr>
</table>
<P>
Or a few ways to do the same thing:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilterMatch ./check_title.pl %p /\.(html|html)$/
FileFilterMatch ./check_title.pl %p /\.html?$/</pre>
</td>
</tr>
</table>
<P>
And to ignore case:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilterMatch ./check_title.pl %p /\.html?$/i</pre>
</td>
</tr>
</table>
<P>
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:
<P>
<table>
<tr>
<td bgcolor="#eeeeee" width="1">
</td>
<td>
<pre> FileFilterMatch ./convert "%p %P" not /\..+$/</pre>
</td>
</tr>
</table>
</DL>
<P>
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<H1><A NAME="Document_Info">Document Info</A></H1>
<P>
$Id: SWISH-CONFIG.pod,v 1.81 2004/10/25 13:57:17 karman Exp $
<P>
.
[ <B><FONT SIZE=-1><A HREF="#toc">TOC</A></FONT></B> ]
<HR>
<p>
<div class="navbar">
<a href="./CHANGES.html">Prev</a> |
<a href="./index.html">Contents</a> |
<a href="./SWISH-RUN.html">Next</a>
</div>
<p>
<P ALIGN="CENTER">
<IMG ALT="" WIDTH="470" HEIGHT="10" SRC="images/dotrule1.gif"></P>
<P ALIGN="CENTER">
<div class="footer">
<BR>SWISH-E is distributed with <B>no warranty</B> under the terms of the
<A HREF="http://www.fsf.org/copyleft/gpl.html">GNU Public License</A>,<BR>
Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA<BR>
Public questions may be posted to
the <A HREF="http://swish-e.org/Discussion/">SWISH-E Discussion</A>.
</div>
</body>
</html>
|