~ubuntu-branches/ubuntu/trusty/swish-e/trusty

« back to all changes in this revision

Viewing changes to html/swish-config.html

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Drolez
  • Date: 2008-09-25 21:52:31 UTC
  • mfrom: (4.1.4 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080925215231-vk46pq42o533syg2
Tags: 2.4.5-5
swish.cgi was not working. Fixed with a 1 char patch. Closes: #500154

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 
2
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
3
 
 
4
<!-- 
 
5
    ***** GENERATED FILE *** DO NOT EDIT DIRECTLY - any changes will be LOST ******
 
6
 
 
7
    swish-e.org mockup based on http://www.oswd.org/design/1773/prosimii/index2.html 
 
8
-->
 
9
 
 
10
 
 
11
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-US">
 
12
  <head>
 
13
    <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
 
14
    <meta name="author" content="haran" />
 
15
    <meta name="generator" content="haran" />
 
16
 
 
17
 
 
18
    <link rel="stylesheet" type="text/css" href="./swish.css" media="screen" title="swish css" />
 
19
 
 
20
    
 
21
        <link rel="Last" href="./filter.html" />
 
22
    
 
23
        <link rel="Prev" href="./changes.html" />
 
24
    
 
25
        <link rel="Up" href="./index.html" />
 
26
    
 
27
        <link rel="Next" href="./swish-run.html" />
 
28
    
 
29
        <link rel="Start" href="./index.html" />
 
30
    
 
31
        <link rel="First" href="./readme.html" />
 
32
    
 
33
 
 
34
    <title>Swish-e :: SWISH-CONFIG - Configuration File Directives</title>
 
35
  </head>
 
36
 
 
37
 
 
38
<body>
 
39
    
 
40
 
 
41
    <!-- noindex -->
 
42
 
 
43
    <!-- For non-visual user agents: -->
 
44
      <div id="top"><a href="#main-copy" class="doNotDisplay doNotPrint">Skip to main content.</a></div>
 
45
 
 
46
    <!-- ##### Header ##### -->
 
47
 
 
48
    <div id="header">
 
49
      <div class="superHeader">
 
50
        <span>Related Sites:</span>
 
51
            <a href="http://swishewiki.org/" title="swishe wiki">swish-e wiki</a> |
 
52
            <a href="http://www.xmlsoft.org/" title="libxml2 home page">libxml2</a> |
 
53
            <a href="http://www.zlib.net/" title="zlib home page">zlib</a> |
 
54
            <a href="http://www.foolabs.com/xpdf/" title="xpdf home page">xpdf</a> |
 
55
            <a href="http://cvs.sourceforge.net/viewcvs.py/swishe/" title="View CVS at SourceForge">CVS @ SourceForge</a> 
 
56
      </div>
 
57
 
 
58
      <div class="midHeader">
 
59
        <h1 class="headerTitle" lang="la">Swish-e</h1>
 
60
        <div class="headerSubTitle">Simple Web Indexing System for Humans - Enhanced</div>
 
61
 
 
62
        <br class="doNotDisplay doNotPrint" />
 
63
 
 
64
        <div class="headerLinks">
 
65
          <span class="doNotDisplay">Tools:</span>
 
66
 
 
67
              <!-- don't know what platform, so link to download page -->
 
68
 
 
69
              <a href="http://swish-e.org/download/index.html">download latest version</a>
 
70
 
 
71
 
 
72
        </div>
 
73
      </div>
 
74
    </div>
 
75
    <!-- index -->
 
76
 
 
77
  <!-- noindex -->
 
78
  <div class="subHeader">
 
79
 
 
80
   <form method="get"
 
81
        action="http://swish-e.org/search/index.html"
 
82
        enctype="application/x-www-form-urlencoded"
 
83
        class="srchform">
 
84
 
 
85
         <table width='100%'>
 
86
          <tr>
 
87
           <td align='left'>
 
88
            <a href="http://swish-e.org/index.html">home</a> |
 
89
            <a href="http://swish-e.org/support.html">support</a> |
 
90
            <a href="http://swish-e.org/download/index.html">download</a>
 
91
           </td>
 
92
 
 
93
           <td align='right'>
 
94
 
 
95
 
 
96
     <label for="searchfield">Search for</label>
 
97
     <input maxlength="200" value="" id="searchfield" size="30" name="query" type="text" alt="Search input field"/>
 
98
     <input value="search swish-e.org" name="submit" type="submit" class='button' />
 
99
 
 
100
                </td>
 
101
           </tr>
 
102
          </table>
 
103
 
 
104
   </form>
 
105
 
 
106
  </div>
 
107
  <!-- index -->
 
108
 
 
109
 
 
110
 
 
111
    <div id="side-bar">
 
112
 
 
113
    <!-- noindex -->
 
114
<ul class="menu"><li class="menuparent">
 
115
 
 
116
    <a class="menu" 
 
117
    href="./index.html"
 
118
    >Doc Overview</a>
 
119
 
 
120
<!-- noindex -->
 
121
<ul class="submenu"><li class="">
 
122
 
 
123
    <a class="submenu" 
 
124
    href="./readme.html"
 
125
     title="First time users">README</a>
 
126
 
 
127
</li><li class="">
 
128
 
 
129
    <a class="submenu" 
 
130
    href="./install.html"
 
131
     title="Installation and usage overview">Install</a>
 
132
 
 
133
</li><li class="">
 
134
 
 
135
    <a class="submenu" 
 
136
    href="./changes.html"
 
137
     title="Important changes from previous versions">Changes</a>
 
138
 
 
139
</li><li class="">
 
140
 
 
141
    <a class="thisfile" 
 
142
    href="./swish-config.html"
 
143
     title="Directives that go in your Swish-e configuration file">Configuration &#187;</a>
 
144
 
 
145
</li><li class="">
 
146
 
 
147
    <a class="submenu" 
 
148
    href="./swish-run.html"
 
149
     title="Command line options for Swish-e binary">Running</a>
 
150
 
 
151
</li><li class="">
 
152
 
 
153
    <a class="submenu" 
 
154
    href="./swish-search.html"
 
155
     title="Swish-e's search language">Searching</a>
 
156
 
 
157
</li><li class="">
 
158
 
 
159
    <a class="submenu" 
 
160
    href="./swish-faq.html"
 
161
    >FAQ</a>
 
162
 
 
163
</li><li class="">
 
164
 
 
165
    <a class="submenu" 
 
166
    href="./swish-bugs.html"
 
167
    >Known issues</a>
 
168
 
 
169
</li><li class="">
 
170
 
 
171
    <a class="submenu" 
 
172
    href="./swish-3.0.html"
 
173
    >The Future</a>
 
174
 
 
175
</li><li class="">
 
176
 
 
177
    <a class="submenu" 
 
178
    href="./swish-library.html"
 
179
     title="Swish-e C API">C API</a>
 
180
 
 
181
</li><li class="">
 
182
 
 
183
    <a class="submenu" 
 
184
    href="./api.html"
 
185
     title="Perl interface to the Swish-e library">Perl API</a>
 
186
 
 
187
</li><li class="">
 
188
 
 
189
    <a class="submenu" 
 
190
    href="./swish.cgi.html"
 
191
     title="Example CGI/mod_perl script">Swish.cgi</a>
 
192
 
 
193
</li><li class="">
 
194
 
 
195
    <a class="submenu" 
 
196
    href="./search.cgi.html"
 
197
     title="Example Perl script using SWISH::API">Search.cgi</a>
 
198
 
 
199
</li><li class="">
 
200
 
 
201
    <a class="submenu" 
 
202
    href="./spider.html"
 
203
     title="The Swish-e HTTP spider">Spider.pl</a>
 
204
 
 
205
</li><li class="">
 
206
 
 
207
    <a class="submenu" 
 
208
    href="./filter.html"
 
209
     title="How to index non-text documents">Filters</a>
 
210
 
 
211
</li></ul>
 
212
<!-- index -->
 
213
 
 
214
 
 
215
</li></ul>
 
216
<!-- index -->
 
217
 
 
218
 
 
219
 
 
220
</div>
 
221
 
 
222
<div id="main-copy">
 
223
    
 
224
    
 
225
    
 
226
    
 
227
<h1>SWISH-CONFIG - Configuration File Directives</h1>
 
228
Swish-e version 2.4.5
 
229
 
 
230
 
 
231
 
 
232
    <!-- noindex -->
 
233
 
 
234
    
 
235
        <h2>Table of Contents</h2>
 
236
        <div class="toc">
 
237
            
 
238
    <ul class="toc">
 
239
        
 
240
            <li>
 
241
                <a href="#overview">OVERVIEW</a>
 
242
                
 
243
            </li>
 
244
        
 
245
            <li>
 
246
                <a href="#configuration_file">CONFIGURATION FILE</a>
 
247
                
 
248
    <ul class="toc">
 
249
        
 
250
            <li>
 
251
                <a href="#alphabetical_listing_of_directives">Alphabetical Listing of Directives</a>
 
252
                
 
253
            </li>
 
254
        
 
255
            <li>
 
256
                <a href="#directives_that_control_swish">Directives that Control Swish</a>
 
257
                
 
258
            </li>
 
259
        
 
260
            <li>
 
261
                <a href="#administrative_headers_directives">Administrative Headers Directives</a>
 
262
                
 
263
            </li>
 
264
        
 
265
            <li>
 
266
                <a href="#document_source_directives">Document Source Directives</a>
 
267
                
 
268
            </li>
 
269
        
 
270
            <li>
 
271
                <a href="#document_contents_directives">Document Contents Directives</a>
 
272
                
 
273
            </li>
 
274
        
 
275
            <li>
 
276
                <a href="#directives_for_the_file_access_method_only">Directives for the File Access method only</a>
 
277
                
 
278
            </li>
 
279
        
 
280
            <li>
 
281
                <a href="#directives_for_the_http_access_method_only">Directives for the HTTP Access Method Only</a>
 
282
                
 
283
            </li>
 
284
        
 
285
            <li>
 
286
                <a href="#directives_for_the_prog_access_method_only">Directives for the prog Access Method Only</a>
 
287
                
 
288
            </li>
 
289
        
 
290
            <li>
 
291
                <a href="#document_filter_directives">Document Filter Directives</a>
 
292
                
 
293
    <ul class="toc">
 
294
        
 
295
            <li>
 
296
                <a href="#filtering_with_swish_filter">Filtering with SWISH::Filter</a>
 
297
                
 
298
            </li>
 
299
        
 
300
            <li>
 
301
                <a href="#filtering_with_the_filefilter_feature">Filtering with the FileFilter feature</a>
 
302
                
 
303
            </li>
 
304
        
 
305
    </ul>
 
306
 
 
307
            </li>
 
308
        
 
309
    </ul>
 
310
 
 
311
            </li>
 
312
        
 
313
            <li>
 
314
                <a href="#document_info">Document Info</a>
 
315
                
 
316
            </li>
 
317
        
 
318
    </ul>
 
319
 
 
320
        </div>
 
321
    
 
322
    <!-- index -->
 
323
 
 
324
 
 
325
 
 
326
 
 
327
 
 
328
<hr />
 
329
 
 
330
 
 
331
    <div class="sub-section">
 
332
        
 
333
<h1><a name="overview"></a>OVERVIEW</h1>
 
334
 
 
335
<p>This document lists the available configuration directives available in
 
336
Swish-e.</p>
 
337
 
 
338
    </div>
 
339
 
 
340
    <div class="sub-section">
 
341
        
 
342
<h1><a name="configuration_file"></a>CONFIGURATION FILE</h1>
 
343
 
 
344
<p>What files Swish-e indexes and how they are indexed, and where the index
 
345
is written can be controlled by a configuration file.</p>
 
346
<p>The configuration file is a text file composed of comments, blank
 
347
lines, and <b>configuration directives</b>.  The order of the directives
 
348
is not important.  Some directives may be used more than once in the
 
349
configuration file, while others can only be used once (e.g. additional
 
350
directives will overwrite preceding directives).  Case of the directive
 
351
is not important -- you may use upper, lower, or mixed case.</p>
 
352
<p>Comments are any line that begin with a "#".</p>
 
353
<pre class="pre-section">    # This is a comment</pre>
 
354
<p>As of 2.4.3 lines may be continued by placing a backslas as the last character
 
355
on the line:</p>
 
356
<pre class="pre-section">    IgnoreWords \
 
357
        am \
 
358
        the \
 
359
        foo</pre>
 
360
<p>Directives may take more than one parameter.  Enclose single parameters
 
361
that include whitespace in quotes (single or double).  Inside of quotes
 
362
the backslash escapes the next character.</p>
 
363
<pre class="pre-section">    ReplaceRules append "foo bar"   &lt;- define "foo bar" as a single parameter</pre>
 
364
<p>If you need to include a quote character in the value either use a
 
365
backslash to escape it, or enclose it in quotes of the other type.</p>
 
366
<p>Backslashes also have special meaning in regular expressions.</p>
 
367
<pre class="pre-section">    FileFilterMatch pdftotext "'%p' -" /\.pdf$/</pre>
 
368
<p>This says that the dot is a real dot (instead of matching any character).
 
369
If you place the regular expression in quotes then you must use
 
370
double-backslashes.</p>
 
371
<pre class="pre-section">    FileFilterMatch pdftotext "'%p' -" "/\\.pdf$/"</pre>
 
372
<p>Swish-e will convert the double backslash into a single backslash before
 
373
passing the parameter to the regular expression compiler.</p>
 
374
<p>Commented example configuration files are included in the <i>conf</i>
 
375
directory of the Swish-e distribution.</p>
 
376
<p>Some command line arguments can override directives specified in the
 
377
configuration file.  Please see also the <a href="swish-run.html">SWISH-RUN</a> for
 
378
instructions on running Swish-e, and the <a href="swish-search.html">SWISH-SEARCH</a> page for
 
379
information and examples on how to search your index.</p>
 
380
<p>The configuration file is specified to Swish-e by the <code>-c</code> switch.  For
 
381
example,</p>
 
382
<pre class="pre-section">    swish-e -c myconfig.conf</pre>
 
383
<p>You may also split your directives up into different configuration files.  This
 
384
allows you to have a master configuration file used for many different indexes,
 
385
and smaller configuration files for each separate index.  You can specify the
 
386
different configuration files when running from the command line with the <code>-c</code>
 
387
switch (see <a href="swish-run.html">SWISH-RUN</a>), or you may include other Configuration
 
388
file with the <b>IncludeConfigFile</b> directive below.</p>
 
389
<p>Typically, in a configuration file the directives are grouped together in
 
390
some logical order -- that is, directives that control the source of the
 
391
documents would be grouped together first, and directives that control
 
392
how each document is filtered or its words index in another group of
 
393
directives. (The directives listed below are grouped in this order).</p>
 
394
<p>The configuration file directives are listed below in these groups:    </p>
 
395
<ul>
 
396
<li>
 
397
<p><a href="#administrative_headers_directives">Administrative Headers Directives</a> -- You may add administrative
 
398
information to the header of the index file.</p>
 
399
</li>
 
400
<li>
 
401
<p><a href="#document_source_directives">Document Source Directives</a> -- Directives for selecting the source
 
402
documents and the location of the index file.</p>
 
403
</li>
 
404
<li>
 
405
<p><a href="#document_contents_directives">Document Contents Directives</a> -- Directives that control how a document
 
406
content is indexed.</p>
 
407
</li>
 
408
<li>
 
409
<p><a href="#directives_for_the_file_access_method_only">Directives for the File Access method only</a> -- These directives are only
 
410
applicable to the File Access indexing method.</p>
 
411
</li>
 
412
<li>
 
413
<p><a href="#directives_for_the_http_access_method_only">Directives for the HTTP Access Method Only</a> -- Likewise, these only apply
 
414
to the HTTP Access method.</p>
 
415
</li>
 
416
<li>
 
417
<p><a href="#directives_for_the_prog_access_method_only">Directives for the prog Access Method Only</a> -- These only apply to the prog
 
418
Access method.</p>
 
419
</li>
 
420
<li>
 
421
<p><a href="#document_filter_directives">Document Filter Directives</a> -- This is a special section that describes
 
422
using document filters with Swish-e.</p>
 
423
</li>
 
424
</ul>
 
425
 
 
426
    </div>
 
427
 
 
428
    <div class="sub-section">
 
429
        
 
430
<h2><a name="alphabetical_listing_of_directives"></a>Alphabetical Listing of Directives</h2>
 
431
 
 
432
<ul>
 
433
<li>
 
434
<p><a href="#absolutelinks">AbsoluteLinks</a> [yes|NO]</p>
 
435
</li>
 
436
<li>
 
437
<p><a href="#begincharacters">BeginCharacters</a> *string of characters*</p>
 
438
</li>
 
439
<li>
 
440
<p><a href="#bumppositioncountercharacters">BumpPositionCounterCharacters</a> *string*</p>
 
441
</li>
 
442
<li>
 
443
<p><a href="#buzzwords">Buzzwords</a> [*list of buzzwords*|File: path]</p>
 
444
</li>
 
445
<li>
 
446
<p><a href="#compresspositions">CompressPositions</a>  [yes|NO]</p>
 
447
</li>
 
448
<li>
 
449
<p><a href="#converthtmlentities">ConvertHTMLEntities</a> [YES|no]</p>
 
450
</li>
 
451
<li>
 
452
<p><a href="#defaultcontents">DefaultContents</a> [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]</p>
 
453
</li>
 
454
<li>
 
455
<p><a href="#delay">Delay</a> *seconds*</p>
 
456
</li>
 
457
<li>
 
458
<p><a href="#dontbumppositiononendtags">DontBumpPositionOnEndTags</a> *list of names*</p>
 
459
</li>
 
460
<li>
 
461
<p><a href="#dontbumppositiononstarttags">DontBumpPositionOnStartTags</a> *list of names*</p>
 
462
</li>
 
463
<li>
 
464
<p><a href="#enablealtsearchsyntax">EnableAltSearchSyntax</a>  [yes|NO]</p>
 
465
</li>
 
466
<li>
 
467
<p><a href="#endcharacters">EndCharacters</a> *string of characters*</p>
 
468
</li>
 
469
<li>
 
470
<p><a href="#equivalentserver">EquivalentServer</a> *server alias*</p>
 
471
</li>
 
472
<li>
 
473
<p><a href="#extractpath">ExtractPath</a> *metaname* [replace|remove|prepend|append|regex]</p>
 
474
</li>
 
475
<li>
 
476
<p><a href="#filefilter">FileFilter</a> *suffix* *program* [options]</p>
 
477
</li>
 
478
<li>
 
479
<p><a href="#filefiltermatch">FileFilterMatch</a> *program* *options* *regex* [*regex* ...]</p>
 
480
</li>
 
481
<li>
 
482
<p><a href="#fileinfocompression">FileInfoCompression</a> [yes|NO]</p>
 
483
</li>
 
484
<li>
 
485
<p><a href="#filematch">FileMatch</a> [contains|is|regex] *regular expression*</p>
 
486
</li>
 
487
<li>
 
488
<p><a href="#filerules">FileRules</a> [contains|is|regex] *regular expression*</p>
 
489
</li>
 
490
<li>
 
491
<p><a href="#fuzzyindexingmode">FuzzyIndexingMode</a> [NONE|Stemming|Soundex|Metaphone|DoubleMetaphone]</p>
 
492
</li>
 
493
<li>
 
494
<p><a href="#followsymlinks">FollowSymLinks</a> [yes|NO]</p>
 
495
</li>
 
496
<li>
 
497
<p><a href="#htmllinksmetaname">HTMLLinksMetaName</a> *metaname*</p>
 
498
</li>
 
499
<li>
 
500
<p><a href="#ignorefirstchar">IgnoreFirstChar</a> *string of characters*</p>
 
501
</li>
 
502
<li>
 
503
<p><a href="#ignorelastchar">IgnoreLastChar</a> *string of characters*</p>
 
504
</li>
 
505
<li>
 
506
<p><a href="#ignorelimit">IgnoreLimit</a> *integer integer*</p>
 
507
</li>
 
508
<li>
 
509
<p><a href="#ignoremetatags">IgnoreMetaTags</a> *list of names*</p>
 
510
</li>
 
511
<li>
 
512
<p><a href="#ignorenumberchars">IgnoreNumberChars</a> *list of characters*</p>
 
513
</li>
 
514
<li>
 
515
<p><a href="#ignoretotalwordcountwhenranking">IgnoreTotalWordCountWhenRanking</a> [YES|no]</p>
 
516
</li>
 
517
<li>
 
518
<p><a href="#ignorewords">IgnoreWords</a> [*list of stop words*|File: path]</p>
 
519
</li>
 
520
<li>
 
521
<p><a href="#imagelinksmetaname">ImageLinksMetaName</a> *metaname*</p>
 
522
</li>
 
523
<li>
 
524
<p><a href="#includeconfigfile">IncludeConfigFile</a></p>
 
525
</li>
 
526
<li>
 
527
<p><a href="#indexadmin">IndexAdmin</a> *text*</p>
 
528
</li>
 
529
<li>
 
530
<p><a href="#indexalttagmetaname">IndexAltTagMetaName</a> *tagname*|as-text</p>
 
531
</li>
 
532
<li>
 
533
<p><a href="#indexcomments">IndexComments</a> [yes|NO]</p>
 
534
</li>
 
535
<li>
 
536
<p><a href="#indexcontents">IndexContents</a> [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]  *file
 
537
extensions*</p>
 
538
</li>
 
539
<li>
 
540
<p><a href="#indexdescription">IndexDescription</a> *text*</p>
 
541
</li>
 
542
<li>
 
543
<p><a href="#indexdir">IndexDir</a> [URL|directories or files]</p>
 
544
</li>
 
545
<li>
 
546
<p><a href="#indexfile">IndexFile</a> *path*</p>
 
547
</li>
 
548
<li>
 
549
<p><a href="#indexname">IndexName</a> *text*</p>
 
550
</li>
 
551
<li>
 
552
<p><a href="#indexonly">IndexOnly</a> *list of file suffixes*</p>
 
553
</li>
 
554
<li>
 
555
<p><a href="#indexpointer">IndexPointer</a> *text*</p>
 
556
</li>
 
557
<li>
 
558
<p><a href="#indexreport">IndexReport</a> [0|1|2|3]</p>
 
559
</li>
 
560
<li>
 
561
<p><a href="#maxdepth">MaxDepth</a> *integer*</p>
 
562
</li>
 
563
<li>
 
564
<p><a href="#maxwordlimit">MaxWordLimit</a> *integer*</p>
 
565
</li>
 
566
<li>
 
567
<p><a href="#metanamealias">MetaNameAlias</a> *meta name* *list of aliases*</p>
 
568
</li>
 
569
<li>
 
570
<p><a href="#metanames">MetaNames</a> *list of names*</p>
 
571
</li>
 
572
<li>
 
573
<p><a href="#minwordlimit">MinWordLimit</a> *integer*</p>
 
574
</li>
 
575
<li>
 
576
<p><a href="#nocontents">NoContents</a> *list of file suffixes*</p>
 
577
</li>
 
578
<li>
 
579
<p><a href="#obeyrobotsnoindex">obeyRobotsNoIndex</a> [yes|NO]</p>
 
580
</li>
 
581
<li>
 
582
<p><a href="#parserwarnlevel">ParserWarnLevel</a> [0|1|2|3]</p>
 
583
</li>
 
584
<li>
 
585
<p><a href="#presortedindex">PreSortedIndex</a> *list of property names*</p>
 
586
</li>
 
587
<li>
 
588
<p><a href="#propcompressionlevel">PropCompressionLevel</a> [0-9]</p>
 
589
</li>
 
590
<li>
 
591
<p><a href="#propertynamealias">PropertyNameAlias</a> *property name* *list of aliases*</p>
 
592
</li>
 
593
<li>
 
594
<p><a href="#propertynames">PropertyNames</a> *list of meta names*</p>
 
595
</li>
 
596
<li>
 
597
<p><a href="#propertynamescomparecase">PropertyNamesCompareCase</a> *list of meta names*</p>
 
598
</li>
 
599
<li>
 
600
<p><a href="#propertynamesignorecase">PropertyNamesIgnoreCase</a> *list of meta names*</p>
 
601
</li>
 
602
<li>
 
603
<p><a href="#propertynamesnostripchars">PropertyNamesNoStripChars</a> *list of meta names*</p>
 
604
</li>
 
605
<li>
 
606
<p><a href="#propertynamesdate">PropertyNamesDate</a> *list of meta names*</p>
 
607
</li>
 
608
<li>
 
609
<p><a href="#propertynamesnumeric">PropertyNamesNumeric</a> *list of meta names*</p>
 
610
</li>
 
611
<li>
 
612
<p><a href="#propertynamesmaxlength">PropertyNamesMaxLength</a> integer *list of meta names*</p>
 
613
</li>
 
614
<li>
 
615
<p><a href="#propertynamessortkeylength">PropertyNamesSortKeyLength</a> integer *list of meta names*</p>
 
616
</li>
 
617
<li>
 
618
<p><a href="#replacerules">ReplaceRules</a> [replace|remove|prepend|append|regex]</p>
 
619
</li>
 
620
<li>
 
621
<p><a href="#resultextformatname">ResultExtFormatName</a>  name -x format string</p>
 
622
</li>
 
623
<li>
 
624
<p><a href="#spiderdirectory">SpiderDirectory</a> *path*</p>
 
625
</li>
 
626
<li>
 
627
<p><a href="#storedescription">StoreDescription</a> [XML &lt;tag&gt;|HTML &lt;meta&gt;|TXT size]</p>
 
628
</li>
 
629
<li>
 
630
<p><a href="#swishprogparameters">"SwishProgParameters</a> *list of parameters*</p>
 
631
</li>
 
632
<li>
 
633
<p><a href="#swishsearchdefaultrule">SwishSearchDefaultRule</a>   [&lt;AND-WORD&gt;|&lt;or-word&gt;]</p>
 
634
</li>
 
635
<li>
 
636
<p><a href="#tmpdir">TmpDir</a> *path*</p>
 
637
</li>
 
638
<li>
 
639
<p><a href="#translatecharacters">TranslateCharacters</a> [*string1 string2*|:ascii7:]</p>
 
640
</li>
 
641
<li>
 
642
<p><a href="#truncatedocsize">TruncateDocSize</a> *number of characters*</p>
 
643
</li>
 
644
<li>
 
645
<p><a href="#undefinedmetatags">UndefinedMetaTags</a> [error|ignore|INDEX|auto]</p>
 
646
</li>
 
647
<li>
 
648
<p><a href="#undefinedxmlattributes">UndefinedXMLAttributes</a> [DISABLE|error|ignore|index|auto]</p>
 
649
</li>
 
650
<li>
 
651
<p><a href="#usestemming">UseStemming</a> [yes|NO]</p>
 
652
</li>
 
653
<li>
 
654
<p><a href="#usesoundex">UseSoundex</a> [yes|NO]</p>
 
655
</li>
 
656
<li>
 
657
<p><a href="#usewords">UseWords</a> [*list of words*|File: path]</p>
 
658
</li>
 
659
<li>
 
660
<p><a href="#wordcharacters">WordCharacters</a> *string of characters*</p>
 
661
</li>
 
662
<li>
 
663
<p><a href="#xmlclassattributes">XMLClassAttributes</a> *list of XML attribute names*</p>
 
664
</li>
 
665
</ul>
 
666
 
 
667
    </div>
 
668
 
 
669
    <div class="sub-section">
 
670
        
 
671
<h2><a name="directives_that_control_swish"></a>Directives that Control Swish</h2>
 
672
 
 
673
<p>These configuration directives control the general behavior of Swish-e.</p>
 
674
<ul>
 
675
<li><a name="item_includeconfigfile"></a><a name="includeconfigfile"></a><b>IncludeConfigFile *path to config file*</b>
 
676
<p>This directive can be used to include configuration directives located
 
677
in another file.</p>
 
678
<pre class="pre-section">    IncludeConfigFile /usr/local/swish/conf/site_config.config</pre>
 
679
</li>
 
680
<li><a name="item_indexreport"></a><a name="indexreport"></a><b>IndexReport [0|1|2|3]</b>
 
681
<p>This is how detailed you want reporting while indexing. You can specify
 
682
numbers 0 to 3.  0 is totally silent, 3 is the most verbose.   The default
 
683
is 1.</p>
 
684
<p>This may be overridden from the command line via the <code>-v</code> switch (see
 
685
<a href="swish-run.html">SWISH-RUN</a>).</p>
 
686
</li>
 
687
<li><a name="item_parserwarnlevel"></a><a name="parserwarnlevel"></a><b>ParserWarnLevel [0|1|2|3]</b>
 
688
<p>Sets the error level when using the libxml2 parser for XML and HTML.
 
689
libxml2 will point out structural errors in your documents.</p>
 
690
<pre class="pre-section">    0 = no report
 
691
    1 = fatal errors
 
692
    2 = errors
 
693
    3 = warnings</pre>
 
694
<p>Currently (as of 2.4.4 - early 2005) libxml2 only reports errors at level 2.
 
695
The default as of 2.4.4 is "2" which should report any errors that might indicate
 
696
a problem parsing a document.</p>
 
697
<p>The exception to this is UTF-8 to Latin-1 conversion errors are reported at
 
698
level 3 (changed from 1 in 2.4.4).  Although these errors indicate a problem indexing
 
699
text, they are only reported at level 3 because they can be very common.</p>
 
700
<p>It is recommended that you index at ParserWarnLevel 3 when first starting out to see
 
701
what errors and warnings are reported.  Then reduce the level when you understand what
 
702
documents are causing parsing problems and why.</p>
 
703
</li>
 
704
<li><a name="item_indexfile"></a><a name="indexfile"></a><b>IndexFile *path*</b>
 
705
<p>Index file specifies the location of the generated index file.  If not
 
706
specified, Swish-e will create the file <i>index.swish-e</i> in the current
 
707
directory.</p>
 
708
<pre class="pre-section">    IndexFile /usr/local/swish/site.index</pre>
 
709
</li>
 
710
<li><a name="item_obeyrobotsnoindex"></a><a name="obeyrobotsnoindex"></a><b>obeyRobotsNoIndex [yes|NO]</b>
 
711
<p>When enabled, Swish-e will not index any HTML file that contains:</p>
 
712
<pre class="pre-section">    &lt;meta name="robots" content="noindex"&gt;</pre>
 
713
<p>The default is to ignore these meta tags and index the document.
 
714
This tag is described at <a href="http://www.robotstxt.org/wc/exclusion.html">http://www.robotstxt.org/wc/exclusion.html</a>.</p>
 
715
<p>Note: This feature is only available with the libxml2 HTML parser.</p>
 
716
<p>Also, if you are using the libxml2 parser (HTML2 and XML2) then you can use the following
 
717
comments in your documents to prevent indexing:</p>
 
718
<pre class="pre-section">       &lt;!-- SwishCommand noindex --&gt;
 
719
       &lt;!-- SwishCommand index --&gt;</pre>
 
720
<p>and/or these may be used also:</p>
 
721
<pre class="pre-section">       &lt;!-- noindex --&gt;
 
722
       &lt;!-- index --&gt;</pre>
 
723
<p>For example, these are very helpful to prevent indexing of common headers, footers, and menus.</p>
 
724
</li>
 
725
</ul>
 
726
<p><b>NOTE</b>: This following items are currently not available.  These items
 
727
require Swish-e to parse the configuration file while searching.</p>
 
728
<ul>
 
729
<li><a name="item_enablealtsearchsyntax"></a><a name="enablealtsearchsyntax"></a><b>EnableAltSearchSyntax [yes|NO]</b>
 
730
<p><b>NOTE</b>: This following item is currently not available.</p>
 
731
<p>Enable alternate search syntax.  Allows the usage of a basic
 
732
"Altavista(c)", "Lycos(c)", etc. like search syntax.  This means a search
 
733
query can contain "+" and "-" as syntax parameter.</p>
 
734
<p>Example:</p>
 
735
<pre class="pre-section">    swish-e -w "+word1 +word2 -word3  word4 word5"
 
736
    "+"  = following word has to be in all found documents
 
737
    "-"  = following word may not be in any document found
 
738
    " "  = following word will be searched in documents</pre>
 
739
</li>
 
740
<li><a name="item_swishsearhoperators"></a><a name="swishsearhoperators"></a><b>SwishSearhOperators &lt;and-word&gt; &lt;or-word&gt; &lt;not-word&gt;</b>
 
741
<p><b>NOTE</b>: This following item is currently not available.</p>
 
742
<p>Using this config directive you can change the boolean search operators of
 
743
Swish-e, e.g. to adapt these to your language.
 
744
The default is:    AND  OR  NOT</p>
 
745
<p>Example (german):</p>
 
746
<pre class="pre-section">    SwishSearchOperators   UND  ODER  NICHT</pre>
 
747
</li>
 
748
<li><a name="item_swishsearchdefaultrule"></a><a name="swishsearchdefaultrule"></a><b>SwishSearchDefaultRule   [&lt;AND-WORD&gt;|&lt;or-word&gt;]</b>
 
749
<p><b>NOTE</b>: This following item is currently not available.</p>
 
750
<p><code>SwishSearchDefaultRule</code> defines the default Boolean operator to use if none
 
751
is specified between words or phrases.  The default is <code>AND</code>.</p>
 
752
<p>The word you specify must match one of the available <code>SwishSearchOperators</code>.</p>
 
753
<p>Example:</p>
 
754
<pre class="pre-section">    SwishSearchOperators   UND  ODER  NICHT
 
755
    # Make it act like a web search engine
 
756
    SwishSearchDefaultRule ODER</pre>
 
757
</li>
 
758
<li><a name="item_resultextformatname"></a><a name="resultextformatname"></a><b>ResultExtFormatName name -x format string</b>
 
759
<p><b>NOTE</b>: This following item is currently not available.</p>
 
760
<p>The output of Swish-e can be defined by specifying a format string with the
 
761
<code>-x</code> command line argument.  Using <code>ResultExtFormatName</code> you can assign a
 
762
predefined format string to a name.</p>
 
763
<p>Examples:</p>
 
764
<pre class="pre-section">    ResultExtFormatName  moreinfo   "%c|%r|%t|%p|&lt;author&gt;|&lt;publishyear&gt;\n"</pre>
 
765
<p>Then when searching you can specify the format string's name</p>
 
766
<pre class="pre-section">    swish-e   ...  -x moreinfo  ...</pre>
 
767
<p>See the <code>-x</code> switch in <a href="swish-run.html">SWISH-RUN</a> for more information about
 
768
output formats.</p>
 
769
</li>
 
770
</ul>
 
771
 
 
772
    </div>
 
773
 
 
774
    <div class="sub-section">
 
775
        
 
776
<h2><a name="administrative_headers_directives"></a>Administrative Headers Directives</h2>
 
777
 
 
778
<p>Swish-e stores configuration information in the header of the index file.
 
779
This information can be retrieved while searching or by functions in
 
780
the Swish-e C library.  There are a number of fields available for your
 
781
own use.  None of these fields are required:</p>
 
782
<ul>
 
783
<li><a name="item_indexname"></a><a name="indexname"></a><b>IndexName *text*</b>
 
784
</li>
 
785
<li><a name="item_indexdescription"></a><a name="indexdescription"></a><b>IndexDescription *text*</b>
 
786
</li>
 
787
<li><a name="item_indexpointer"></a><a name="indexpointer"></a><b>IndexPointer *text*</b>
 
788
</li>
 
789
<li><a name="item_indexadmin"></a><a name="indexadmin"></a><b>IndexAdmin *text*</b>
 
790
<p>These variables specify information that goes into index files to help
 
791
users and administrators.  IndexName should be the name of your index,
 
792
like a book title.  IndexDescription is a short description of the index
 
793
or a URL pointing to a more full description.  IndexPointer should be
 
794
a pointer to the original information, most likely a URL.  IndexAdmin
 
795
should be the name of the index maintainer and can include name and email
 
796
information.  These values should not be more than 70 or so characters
 
797
and should be contained in quotes.  Note that the automatically generated
 
798
date in index files is in D/M/Y and 24-hour format.</p>
 
799
<p>Examples:</p>
 
800
<pre class="pre-section">    IndexName "Linux Documentation"
 
801
    IndexDescription "This is an index of /usr/doc on our Linux machine." 
 
802
    IndexPointer http://localhost/swish/linux/index.html
 
803
    IndexAdmin webmaster</pre>
 
804
</li>
 
805
</ul>
 
806
 
 
807
    </div>
 
808
 
 
809
    <div class="sub-section">
 
810
        
 
811
<h2><a name="document_source_directives"></a>Document Source Directives</h2>
 
812
 
 
813
<p>These directives control <i>what</i> documents are indexed and <i>how</i> they are
 
814
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
 
815
specific to those access methods.</p>
 
816
<ul>
 
817
<li><a name="item_indexdir"></a><a name="indexdir"></a><b>IndexDir [directories or files|URL|external program]</b>
 
818
<p>IndexDir defines the source of the documents for Swish-e.  Swish-e
 
819
currently supports three file access methods: <b>File system</b>, <b>HTTP</b>
 
820
(also called <b>spidering</b>), and <b>prog</b> for reading files from an
 
821
external program.</p>
 
822
<p>The <code>-S</code> command line argument is used to select the file access method.</p>
 
823
<pre class="pre-section">    swish-e -c swish.config -S fs    - file system
 
824
    swish-e -c swish.config -S http  - internal http spider
 
825
    swish-e -c swish.config -S prog  - external program of any type</pre>
 
826
<p>For the <b>fs</b> method of access <b>IndexDir</b> is a space-separated
 
827
list of files and directories to index.  Use a forward slash as the path
 
828
separator in MS Windows.</p>
 
829
<p>For the <b>http</b> method the <b>IndexDir</b> setting is a list of space-separated
 
830
URLs.</p>
 
831
<p>For the <b>prog</b> method the <b>IndexDir</b> setting is a list of space-separated
 
832
programs to run (which generate documents for swish to index).</p>
 
833
<p>You may specify more than one <b>IndexDir</b> directive.</p>
 
834
<p>Any sub-directories of any listed directory will also be indexed.</p>
 
835
<p>Note: While <i>processing</i> directories, Swish-e will ignore any files or
 
836
directories that begin with a dot (".").  You may index files or directories
 
837
that begin with a dot by specifying their name with <code>IndexDir</code> or <code>-i</code>.</p>
 
838
<p>Examples:</p>
 
839
<pre class="pre-section">    # Index this directory an any subdirectories
 
840
    IndexDir /usr/local/home/http
 
841
 
 
842
    # Index the docs directory in current directory
 
843
    IndexDir ./docs
 
844
 
 
845
    # Index these files in the current directory
 
846
    IndexDir ./index.html ./page1.html ./page2.html
 
847
    # and index this directory, too
 
848
    IndexDir ../public_html</pre>
 
849
<p>For the <b>HTTP</b> method of access specify the URL's from which
 
850
you want the spidering to begin.</p>
 
851
<p>Example:</p>
 
852
<pre class="pre-section">    IndexDir http://www.my-site.com/index.html
 
853
    IndexDir http://localhost/index.html</pre>
 
854
<p>Obviously, using the <b>HTTP</b> method to index is <b>much</b> slower than indexing
 
855
local files.  Be well aware that some sites do not appreciate spidering and may
 
856
block your IP address.  You may wish to contact the remote site before
 
857
spidering their web site.  More information about spidering can be found in
 
858
<a href="#directives_for_the_http_access_method_only">Directives for the HTTP Access Method Only</a> below.</p>
 
859
<p>For the <a href="swish-run.html#item_prog">prog</a> method of access <b>IndexDir</b> specifies
 
860
the path to the program(s) to execute.  The external program must correctly
 
861
format the documents being passed back to Swish-e.  Examples of external
 
862
programs are provided in the <i>prog-bin</i> directory.</p>
 
863
<pre class="pre-section">    IndexDir ./myprogram.pl</pre>
 
864
<p>See <a href="swish-run.html#item_prog">prog</a> for details.</p>
 
865
<p>Note: Not all directives work with all methods.</p>
 
866
</li>
 
867
<li><a name="item_nocontents"></a><a name="nocontents"></a><b>NoContents *list of file suffixes*</b>
 
868
<p>Files with these suffixes will <b>not</b> have their contents indexed,
 
869
but will have their path name (file name) indexed instead.</p>
 
870
<p>If the file's type is HTML or HTML2 (as set by <code>IndexContents</code> or
 
871
<code>DefaultContents</code>) then the file will be parsed for a HTML title and that
 
872
title will be indexed.  Note that you must set the file's type with
 
873
<code>IndexContents</code> or <code>DefaultContents</code>: <code>.html</code> and <code>.htm</code> are NOT type HTML
 
874
by default.  For example:</p>
 
875
<pre class="pre-section">   IndexContents HTML* .htm .html</pre>
 
876
<p>If a title is found, it will still be checked for <code>FileRules title</code>, and the
 
877
file will be skipped if a match is found.  See <code>FileRules</code>.</p>
 
878
<p>If the file's type is not HTML, or it is HTML and no title is found,
 
879
then the file's path will be indexed.</p>
 
880
<p>For example, this will allow searching by image file name.</p>
 
881
<pre class="pre-section">    NoContents .gif .xbm .au .mov .mpg .pdf .ps</pre>
 
882
<p>Note: Using this directive will <b>not</b> cause files with those suffixes to be
 
883
indexed.  That is, if you use <code>IndexOnly</code> to limit the types of files that are
 
884
indexed, then you must specify in <code>IndexOnly</code> the same suffixes listed in
 
885
<code>NoContents</code>.</p>
 
886
<p>This does <b>not</b> work:</p>
 
887
<pre class="pre-section">    # Wrong!
 
888
    IndexOnly .htm .html
 
889
    NoContents .gif .xbm .au .mov .mpg .pdf .ps</pre>
 
890
<p>A <code>-S prog</code> program may set the <code>No-Contents:</code> header to enable this feature
 
891
for a specific document (although it would be smarter for the <code>-S prog</code>
 
892
program to simply only send the pathname or title to be indexed.</p>
 
893
</li>
 
894
<li><a name="item_replacerules"></a><a name="replacerules"></a><b>ReplaceRules [replace|remove|prepend|append|regex]</b>
 
895
<p>ReplaceRules allows you to make changes to file pathnames before
 
896
they're indexed.  These changed file names or URLs will be returned in
 
897
search results.</p>
 
898
<p>For example, you may index your files locally (with the File system
 
899
indexing method), yet return a URL in search results.  This directive can
 
900
be used to map the file names to their respective URLs on your web server.</p>
 
901
<p>There are five operations you can specify: <b>replace</b>, <b>append</b>,
 
902
<b>remove</b>, <b>prepend</b>, and <b>regex</b> They will parse the pathname in the
 
903
order you've typed these commands.</p>
 
904
<p>This directive uses C library regex.h regular expressions.</p>
 
905
<pre class="pre-section">   replace "the string you want replaced" "what to change it to"
 
906
   remove "a string to remove"   
 
907
   prepend "a string to add before the result"
 
908
   append "a string to add after the result"
 
909
   regex  "/search string/replace string/options"</pre>
 
910
<p>Remember, quotes are needed if an expression contains white space,
 
911
and backslashes have special meaning.</p>
 
912
<p>Regex is an Extended Regular Expression.  The first character found is 
 
913
the delimiter (but it's not smart enough to use matched chars such as [],
 
914
(), and {}).</p>
 
915
<p>The <b>replace</b> string may use substitution variables:</p>
 
916
<pre class="pre-section">    $0      the entire matched (sub)string
 
917
    $1-$9   returns patterns captured in "(" ")" pairs
 
918
    $`      the string before the matched pattern
 
919
    $'      the string after the matched pattern</pre>
 
920
<p>The <b>options</b> change the behavior of expression:</p>
 
921
<pre class="pre-section">    i       ignore the case when matching
 
922
    g       repeat the substitution for the entire pattern</pre>
 
923
<p>Examples:</p>
 
924
<pre class="pre-section">    ReplaceRules replace testdir/ anotherdir/
 
925
    ReplaceRules replace [a-z_0-9]*_m.*\.html index.html
 
926
 
 
927
    ReplaceRules remove testdir/
 
928
 
 
929
    ReplaceRules prepend http://localhost/
 
930
    ReplaceRules append .html
 
931
 
 
932
    ReplaceRules regex  !^/web/(.+)/!http://$1.domain.com/!
 
933
    replaces a file path:
 
934
        /web/search/foo/index.html
 
935
    with
 
936
        http://search.domain.com/foo/index.html
 
937
 
 
938
    ReplaceRules regex  #^#http://localhost/www#
 
939
    ReplaceRules prepend http://localhost/www  (same thing)
 
940
 
 
941
    # Remove all extensions from C source files
 
942
    ReplaceRules remove .c     # ERROR! That "." is *any char*
 
943
    ReplaceRules remove \.c    # much better...
 
944
 
 
945
    ReplaceRules remove "\\.c" # if in quotes you need double-backslash!  
 
946
    ReplaceRules remove "\.c"  # ERROR! "\." -&gt; "." and is *any char*</pre>
 
947
</li>
 
948
<li><a name="item_indexcontents"></a><a name="indexcontents"></a><b>IndexContents [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]  *file extensions*</b>
 
949
<p>The <code>IndexContents</code> directive assigns one of Swish-e's document parsers to a
 
950
document, based on the its extension.  Swish-e currently knows how to parse
 
951
TXT, HTML, and XML documents.</p>
 
952
<p>The XML2, HTML2, and TXT2 parsers are currently only available when
 
953
Swish-e is configured to use libxml2.</p>
 
954
<p>You may use XML*, HTML*, and TXT* to select the parser automatically.
 
955
If libxml2 is installed then it will be used to parse the content.  Otherwise,
 
956
Swish-e's internal parsers will be used.</p>
 
957
<p>Documents that are not assigned a parser with <code>IndexContents</code> will, by
 
958
default, use the HTML2 parser if libxml2 is installed, otherwise will use
 
959
Swish-e's internal HTML parser.  The <code>DefaultContents</code> directive may be used
 
960
to assign a parser to documents that do not match a file extension defined with
 
961
the <code>IndexContents</code> directive.</p>
 
962
<p>Example:</p>
 
963
<pre class="pre-section">    IndexContents HTML* .htm .html .shtml
 
964
    IndexContents TXT*  .txt .log .text
 
965
    IndexContents XML*  .xml</pre>
 
966
<p>HTML* is the default type for all files, unless otherwise specified (and this
 
967
default can be changed by the <b>DefaultContents</b> directive.  Swish-e parses
 
968
titles from HTML files, if available, and keeps track of the context of the
 
969
text for context searching (see <code>-t</code> in <a href="swish-run.html">SWISH-RUN</a>).</p>
 
970
<p>If using filters (with the <code>FileFilter</code> directive) to convert documents you
 
971
should include those extensions, too.  For example, if using a filter to
 
972
convert .pdf to .html, you need to tell Swish-e that .pdf should be indexed by
 
973
the internal HTML parser:</p>
 
974
<pre class="pre-section">    FileFilter  .pdf   pdf2html
 
975
    IndexContent  HTML  .pdf</pre>
 
976
<p>See also <a href="#document_filter_directives">Document Filter Directives</a>.</p>
 
977
<p><b>Note:</b> Some of this may be changed in the future to use content-types instead
 
978
of file extensions.  See <a href="swish-3.0.html">SWISH-3.0</a></p>
 
979
</li>
 
980
<li><a name="item_defaultcontents"></a><a name="defaultcontents"></a><b>DefaultContents [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]</b>
 
981
<p>This sets the default parser for documents that are not specified in
 
982
<b>IndexContents</b>. If not specified the default is HTML.</p>
 
983
<p>The XML2, HTML2, and TXT2 parsers are currently only available when
 
984
Swish-e is configured to use libxml2.</p>
 
985
<p>You may use XML*, HTML*, and TXT* to select the parser automatically.
 
986
If libxml2 is installed then it will be used to parse the content.  Otherwise,
 
987
Swish-e's internal parsers will be used.</p>
 
988
<p>Example:</p>
 
989
<pre class="pre-section">    DefaultContents HTML</pre>
 
990
<p>The <code>DefaultContents</code> directive <i>should</i> be used when spidering, as HTML
 
991
files may be returned without a file extension (such as when requesting a
 
992
directory and the default index.html is returned).</p>
 
993
</li>
 
994
<li><a name="item_fileinfocompression"></a><a name="fileinfocompression"></a><b>FileInfoCompression [yes|NO]</b>
 
995
<p>** This directive is currently not supported **</p>
 
996
<p>Setting <b>FileInfoCompression</b> to <code>yes</code> will compress the index file to save
 
997
disk space.  This may result in longer indexing times.  The default is <code>no</code>.</p>
 
998
<p>Also see the <code>-e</code> switch in <a href="swish-run.html">SWISH-RUN</a> for saving RAM during
 
999
indexing.</p>
 
1000
</li>
 
1001
</ul>
 
1002
 
 
1003
    </div>
 
1004
 
 
1005
    <div class="sub-section">
 
1006
        
 
1007
<h2><a name="document_contents_directives"></a>Document Contents Directives</h2>
 
1008
 
 
1009
<p>These directives control what information is extracted from your source
 
1010
documents, and how that information is made available during searching.</p>
 
1011
<ul>
 
1012
<li><a name="item_converthtmlentities"></a><a name="converthtmlentities"></a><b>ConvertHTMLEntities [YES|no]</b>
 
1013
<p>ASCII <i>entities</i> can be converted automatically while indexing documents of
 
1014
type HTML (not for HTML2).  For performance reasons you may wish to set this to
 
1015
<code>no</code> if your documents do not contain HTML entities.  The default is <code>yes</code>.</p>
 
1016
<p>If <code>ConvertHTMLEntities</code> is set <code>no</code> the entities will be indexed without
 
1017
conversion.</p>
 
1018
<p><b>NOTE:</b> Entities within XML files and files parsed with libxml2 (HTML2) are
 
1019
converted regardless of this setting.</p>
 
1020
</li>
 
1021
<li><a name="item_metanames"></a><a name="metanames"></a><b>MetaNames *list of names*</b>
 
1022
<p>META names are a way to define "fields" in your XML and HTML documents.  You
 
1023
can use the META names in your queries to limit the search to just the words
 
1024
contained in that META name of your document.  For example, you might have a
 
1025
META tagged field in your documents called <code>subjects</code> and then you can search
 
1026
your documents for the word "foo" but only return documents where "foo" is
 
1027
within the <code>subjects</code> META tag.</p>
 
1028
<pre class="pre-section">    swish-e -w subjects=foo</pre>
 
1029
<p>(See also the <code>-t</code> switch in <a href="swish-run.html">SWISH-RUN</a> for information about
 
1030
<i>context</i> searching in HTML documents.)</p>
 
1031
<p>The <b>MetaNames</b> directive is a space separated list.  For example:</p>
 
1032
<pre class="pre-section">    MetaNames meta1 meta2 keywords subjects</pre>
 
1033
<p>You may also use <code>UndefinedMetaTags</code> to specify automatic extraction of meta
 
1034
names from your HTML and XML documents, and also to ignore indexing content of
 
1035
meta tags.</p>
 
1036
<p>META tags can have two formats in your <b>HTML</b> source documents:</p>
 
1037
<pre class="pre-section">    &lt;META NAME="meta1" CONTENT="some content"&gt;</pre>
 
1038
<p>and (if using the HTML2/libxml2 parser)</p>
 
1039
<pre class="pre-section">    &lt;meta1&gt;
 
1040
        some content
 
1041
    &lt;/meta1&gt;</pre>
 
1042
<p>But this second version is invalid HTML, and will generate a warning if
 
1043
ParserWarningLevel is set (libxml2 only).</p>
 
1044
<p>And in <b>XML</b> documents, use the format:</p>
 
1045
<pre class="pre-section">    &lt;meta1&gt;
 
1046
        Some Content
 
1047
    &lt;/meta1&gt;</pre>
 
1048
<p>Then you can limit your search to just META <b>meta1</b> like this:</p>
 
1049
<pre class="pre-section">    swish-e -w 'meta1=(apples or oranges)'</pre>
 
1050
<p>You may nest the XML and the start/end tag versions:</p>
 
1051
<pre class="pre-section">    &lt;keywords&gt;
 
1052
        &lt;tag1&gt;
 
1053
            some content
 
1054
        &lt;/tag1&gt;
 
1055
        &lt;tag2&gt;
 
1056
            some other content
 
1057
        &lt;/tag2&gt;
 
1058
    &lt;keywords&gt;</pre>
 
1059
<p>Then you can search in both tag2 and tag2 with:</p>
 
1060
<pre class="pre-section">    swish-e -w 'keywords=(query words)'</pre>
 
1061
<p>Swish-e indexes all text as some metaname.  The default is <code>swishdefault</code>, so
 
1062
these two queries are the same:</p>
 
1063
<pre class="pre-section">    swish-e -w foo
 
1064
    swish-e -w swishdefault=foo</pre>
 
1065
<p>When indexing HTML Swish-e indexes the HTML title as default text, so
 
1066
when searching Swish-e will find matches in both the HTML body and the
 
1067
HTML title.  Swish also, by default, indexes content of meta tags.  So:</p>
 
1068
<pre class="pre-section">    swish-e -w foo</pre>
 
1069
<p>will find "foo" in the body, the title, or any meta tags.</p>
 
1070
<p>Currently, there's no way to prevent Swish-e from indexing the title contents
 
1071
along with the body contents, but see <code>UndefinedMetaTags</code> for how to control
 
1072
the indexing of meta tags.</p>
 
1073
<p>If you would like to search just the title text, you may use:</p>
 
1074
<pre class="pre-section">    MetaNames swishtitle</pre>
 
1075
<p>This will index the title text separately under the built-in swish
 
1076
internal meta name "swishtitle".  You may then search like</p>
 
1077
<pre class="pre-section">    swish-e -w foo  -- search for "foo" in title, body (and undefined meta tags)
 
1078
    swish-e -w swishtitle=foo -- search for "foo" in title only</pre>
 
1079
<p>In addition to swishtitle, you can limit searches to documents' path with:</p>
 
1080
<pre class="pre-section">   MetaNames swishdocpath</pre>
 
1081
<p>Then to search for "foo" but also limit searches to documents that include
 
1082
"manual" or "tutorial" in their path:</p>
 
1083
<pre class="pre-section">   swish-e -w foo swishdocpath=(manual or tutorial)</pre>
 
1084
<p>See also <code>ExtractPath</code>.</p>
 
1085
</li>
 
1086
<li><a name="item_metanamealias"></a><a name="metanamealias"></a><b>MetaNameAlias *meta name* *list of aliases*</b>
 
1087
<p>MetaNameAlias assigns aliases for a meta name.  For example, if your
 
1088
documents contain meta tags "description", "summary", and "overview"
 
1089
that all give a summary of your documents you could do this:</p>
 
1090
<pre class="pre-section">    MetaNames summary
 
1091
    MetaNameAlias summary description overview</pre>
 
1092
<p>Then all three tags will get indexed as meta tag "summary".  You can
 
1093
then search all the fields as:</p>
 
1094
<pre class="pre-section">    -w summary=foo</pre>
 
1095
<p>The Alias work at search time, too.  So these will also limit the search
 
1096
to the "summary" meta name.</p>
 
1097
<pre class="pre-section">    -w description=foo
 
1098
    -w overview=foo</pre>
 
1099
</li>
 
1100
<li><a name="item_metanamesrank"></a><a name="metanamesrank"></a><b>MetaNamesRank integer *list of meta names*</b>
 
1101
<p>You can assign a bias to metanames that will affect how ranking is
 
1102
calculated.  The range of values is from -10 to +10, with zero being
 
1103
no bias.</p>
 
1104
<pre class="pre-section">    MetaNamesRank 4 subject
 
1105
    MetaNamesRank 3 swishdefault
 
1106
    MetaNamesRank 2 author publisher
 
1107
    MetaNamesRank -5 wrongwords</pre>
 
1108
<p>This feature is still considered experimental. If you use it, please send feedback
 
1109
to the discussion list.</p>
 
1110
</li>
 
1111
<li><a name="item_htmllinksmetaname"></a><a name="htmllinksmetaname"></a><b>HTMLLinksMetaName *metaname*</b>
 
1112
<p>Allows indexing of HTML links.  Normally, HTML links (href tags) are
 
1113
not indexed by Swish-e.  This directive defines a metaname, and links
 
1114
will be indexed under this meta name.</p>
 
1115
<p>Example:</p>
 
1116
<pre class="pre-section">    HTMLLinksMetaName links</pre>
 
1117
<p>Now, to limit searches to files with a link to "home.html" do this:</p>
 
1118
<pre class="pre-section">    -w links='"home.html"'</pre>
 
1119
<p>The double quotes force a phrase search.    </p>
 
1120
<p>To make Swish-e index links as normal text, you may use:</p>
 
1121
<pre class="pre-section">    HTMLLinksMetaName swishdefault</pre>
 
1122
<p>This feature is only available with the libxml2 HTML parser.    </p>
 
1123
</li>
 
1124
<li><a name="item_imagelinksmetaname"></a><a name="imagelinksmetaname"></a><b>ImageLinksMetaName *metaname*</b>
 
1125
<p>Allows indexing of image links under a metaname.  Normally, image URLs
 
1126
are not indexed.</p>
 
1127
<p>Example:</p>
 
1128
<pre class="pre-section">    ImagesLinksMetaName images</pre>
 
1129
<p>Now, if you would like to find pages that include a nice image of a beach:</p>
 
1130
<pre class="pre-section">    -w images='beach'</pre>
 
1131
<p>To make Swish-e index links as normal text, you may use:</p>
 
1132
<pre class="pre-section">    ImageLinksMetaName swishdefault</pre>
 
1133
<p>This feature is only available with the libxml2 HTML parser.</p>
 
1134
</li>
 
1135
<li><a name="item_indexalttagmetaname"></a><a name="indexalttagmetaname"></a><b>IndexAltTagMetaName *tagname*|as-text</b>
 
1136
<p>Allows indexing of images &lt;IMG&gt; ALT tag text.  Specify either a tag name which will be
 
1137
used as a metaname, or the special text "as-text" which says to index the ALT text as
 
1138
if it were plain text at the current location.</p>
 
1139
<p>For example, by specifying a tag name:</p>
 
1140
<pre class="pre-section">   IndexAltTagMetaName bar</pre>
 
1141
<p>would make this markup:   </p>
 
1142
<pre class="pre-section">    &lt;foo&gt;
 
1143
        &lt;img src="/someimage.png" alt="Alt text here"&gt;
 
1144
    &lt;/foo&gt;</pre>
 
1145
<p>appear like</p>
 
1146
<pre class="pre-section">    &lt;foo&gt;
 
1147
        &lt;bar&gt;Alt text here&lt;/bar&gt;
 
1148
    &lt;/foo&gt;</pre>
 
1149
<p>Then the normal rules (<code>MetaNames</code> and <code>PropertyNames</code>) apply to how that
 
1150
text is indexed.</p>
 
1151
<p>If you use the special tag "as-text" then</p>
 
1152
<pre class="pre-section">    &lt;foo&gt;
 
1153
        &lt;img src="/someimage.png" alt="Alt text here"&gt;
 
1154
    &lt;/foo&gt;</pre>
 
1155
<p>simply becomes</p>
 
1156
<pre class="pre-section">    &lt;foo&gt;
 
1157
        Alt text here
 
1158
    &lt;/foo&gt;</pre>
 
1159
<p>This feature is only available when using the libxml2 parser (HTML2 and XML2).    </p>
 
1160
</li>
 
1161
<li><a name="item_absolutelinks"></a><a name="absolutelinks"></a><b>AbsoluteLinks [yes|NO]</b>
 
1162
<p>If this is set true then Swish-e will attempt to convert relative URIs
 
1163
extracted from HTML documents for use with <code>HTMLLinksMetaName</code> and
 
1164
<code>ImageLinksMetaName</code> into absolute URIs.  Swish-e will use any &lt;BASE&gt; tag
 
1165
found in the document, otherwise it will use the file's pathname.  The pathname
 
1166
used will be the pathname *after* <code>ReplaceRules</code> has been applied to the
 
1167
document's pathname.</p>
 
1168
<p>For example, say you wish to index image links under the metaname
 
1169
"images".</p>
 
1170
<pre class="pre-section">    ImageLinksMetaName images</pre>
 
1171
<p>If an image is located in <a href="http://localhost/vacations/france/index.html">http://localhost/vacations/france/index.html</a> and
 
1172
<code>AbsoluteLinks</code> is set to no, then a image within that document:</p>
 
1173
<pre class="pre-section">     &lt;img src="beach.jpeg"&gt;</pre>
 
1174
<p>will only index "beach.jpeg".</p>
 
1175
<p>But, if you want more detail when searching, you can enable <code>AbsoluteLinks</code>
 
1176
and Swish-e will index "<a href="http://localhost/vacations/france/beach.jpeg">http://localhost/vacations/france/beach.jpeg</a>".  You can
 
1177
then look for images of beaches, but only in France:</p>
 
1178
<pre class="pre-section">    -w images=(beach and france)</pre>
 
1179
<p>This also means you can search for any images within France:</p>
 
1180
<pre class="pre-section">    -w images=(france)</pre>
 
1181
<p>This feature is only available with the libxml2 HTML parser.    </p>
 
1182
</li>
 
1183
<li><a name="item_undefinedmetatags"></a><a name="undefinedmetatags"></a><b>UndefinedMetaTags [error|ignore|INDEX|auto]</b>
 
1184
<p>This directive defines the behavior of Swish-e during indexing when a
 
1185
meta name is found but is <b>not</b> listed in <b>MetaNames</b>.  There are
 
1186
four choices:</p>
 
1187
<ul>
 
1188
<li><a name="item_error"></a><a name="error"></a><b>error</b>
 
1189
<p>If a meta name is found that is not listed in <b>MetaNames</b>
 
1190
then indexing will be halted and an error reported.</p>
 
1191
</li>
 
1192
<li><a name="item_ignore"></a><a name="ignore"></a><b>ignore</b>
 
1193
<p>The contents of the meta tag are ignored and <b>not</b> indexed unless a metaname
 
1194
has been defined with the <code>MetaNames</code> directive.</p>
 
1195
</li>
 
1196
<li><a name="item_index"></a><a name="index"></a><b>index</b>
 
1197
<p>The contents of the meta tag are indexed, but placed in the
 
1198
main index unless there's an enclosing metatag already in force. This
 
1199
is the default.</p>
 
1200
</li>
 
1201
<li><a name="item_auto"></a><a name="auto"></a><b>auto</b>
 
1202
<p>This method create meta tags automatically for HTML meta names
 
1203
and XML elements.  Using this is the same as specifying all the meta
 
1204
names explicitly in a <b>MetaNames</b> directive.</p>
 
1205
</li>
 
1206
</ul>
 
1207
</li>
 
1208
<li><a name="item_undefinedxmlattributes"></a><a name="undefinedxmlattributes"></a><b>UndefinedXMLAttributes [DISABLE|error|ignore|index|auto]</b>
 
1209
<p>This is similar to <code>UndefinedMetaTags</code>, but only applies to XML documents
 
1210
(parsed with libxml2).  This allows indexing of attribute content, and provides
 
1211
a way to index the content under a metaname.  For example,
 
1212
<code>UndefinedXMLAttributes</code> can make</p>
 
1213
<pre class="pre-section">    &lt;person age="23"&gt;
 
1214
          John Doe
 
1215
    &lt;/person&gt;</pre>
 
1216
<p>look like the following to swish:</p>
 
1217
<pre class="pre-section">    &lt;person&gt;
 
1218
        &lt;person.age&gt;
 
1219
            23
 
1220
        &lt;/person.age&gt;
 
1221
        John Doe
 
1222
    &lt;/person&gt;</pre>
 
1223
<p>What happens to the text "23" will depend on the setting of
 
1224
<code>UndefinedXMLAttributes</code>:    </p>
 
1225
<ul>
 
1226
<li><a name="item_disable"></a><a name="disable"></a><b>disable</b>
 
1227
<p>XML attributes are not parsed and not indexed.  This is the default.</p>
 
1228
</li>
 
1229
<li><a name="item_error"></a><a name="error"></a><b>error</b>
 
1230
<p>If the concatenated meta name (e.g. person.age) is not listed in
 
1231
<b>MetaNames</b> then indexing will be halted and an error reported.</p>
 
1232
</li>
 
1233
<li><a name="item_ignore"></a><a name="ignore"></a><b>ignore</b>
 
1234
<p>The contents of the meta tag are ignored and <b>not</b> indexed unless a metaname
 
1235
has been defined with the <code>MetaNames</code> directive.</p>
 
1236
</li>
 
1237
<li><a name="item_index"></a><a name="index"></a><b>index</b>
 
1238
<p>The contents of the meta tag are indexed, but placed in the main index
 
1239
unless there's an enclosing metatag already in force.</p>
 
1240
</li>
 
1241
<li><a name="item_auto"></a><a name="auto"></a><b>auto</b>
 
1242
<p>This method will create meta tags from the combined element and attributes
 
1243
(and XML Class name) This options should be used with caution as it can
 
1244
generate a lot of metaname entries.</p>
 
1245
<p>See also the example below <code>XMLClassAttribues</code>.</p>
 
1246
</li>
 
1247
</ul>
 
1248
</li>
 
1249
<li><a name="item_xmlclassattributes"></a><a name="xmlclassattributes"></a><b>XMLClassAttributes *list of XML attribute names*</b>
 
1250
<p>Combines an XML class name with the element name to make up a metaname.
 
1251
For example:</p>
 
1252
<pre class="pre-section">    XMLClassAttributes class
 
1253
 
 
1254
    &lt;person class="first"&gt;
 
1255
        John
 
1256
    &lt;/person&gt;
 
1257
    &lt;person class="last"&gt;
 
1258
        Doe
 
1259
    &lt;/person&gt;</pre>
 
1260
<p>Will appear to Swish-e as:</p>
 
1261
<pre class="pre-section">    &lt;person&gt;
 
1262
        &lt;person.first&gt;
 
1263
        John
 
1264
        &lt;/person.first&gt;
 
1265
    &lt;/person&gt;
 
1266
    &lt;person&gt;
 
1267
        &lt;person.last&gt;
 
1268
        Doe
 
1269
        &lt;/person.last&gt;
 
1270
    &lt;/person&gt;</pre>
 
1271
<p>How the data is indexed depends on <code>MetaNames</code> and <code>UndefinedMetaTags</code>.</p>
 
1272
<p>Here's an example using the following configuration which combines the two
 
1273
directives <code>XMLClassAttributes</code> and <code>UndefinedXMLAttributes</code>.</p>
 
1274
<pre class="pre-section">    XMLClassAttributes class
 
1275
    UndefinedMetaTags auto
 
1276
    UndefinedXMLAttributes auto
 
1277
    IndexContents XML2 .xml</pre>
 
1278
<p>The source XML file looks like:    </p>
 
1279
<pre class="pre-section">    &lt;xml&gt; &lt;person class="student" phone="555-1212" age="102"&gt; John &lt;/person&gt;
 
1280
    &lt;person greeting="howdy"&gt;Bill&lt;/person&gt; &lt;/xml&gt;</pre>
 
1281
<p>Swish-e parses as:</p>
 
1282
<pre class="pre-section">    ./swish-e -c 2 -i 1.xml -T parsed_tags  parsed_text  -v 0
 
1283
    Indexing Data Source: "File-System"
 
1284
 
 
1285
    &lt;xml&gt; (MetaName)
 
1286
 
 
1287
        &lt;person&gt; (MetaName)
 
1288
            &lt;person.student&gt; (MetaName)
 
1289
                &lt;person.student.phone&gt; (MetaName)
 
1290
                    555-1212
 
1291
                &lt;/person.student.phone&gt; 
 
1292
                &lt;person.student.age&gt; (MetaName)
 
1293
                    102
 
1294
                &lt;/person.student.age&gt; 
 
1295
                John
 
1296
        &lt;/person&gt; 
 
1297
 
 
1298
        &lt;person&gt; (MetaName)
 
1299
            &lt;person.greeting&gt; (MetaName)
 
1300
                howdy
 
1301
            &lt;/person.greeting&gt; 
 
1302
            Bill
 
1303
        &lt;/person&gt; 
 
1304
 
 
1305
    &lt;/xml&gt; 
 
1306
    Indexing done!</pre>
 
1307
<p>One thing to note is that the first &lt;person&gt; block finds a class name
 
1308
"student" so all metanames that are created from attributes use the
 
1309
combined name "person.student".  The second &lt;person&gt; block doesn't contain
 
1310
a "class" so, the attribute name is combined directly with the element
 
1311
name (e.g. "person.greeting").</p>
 
1312
</li>
 
1313
<li><a name="item_extractpath"></a><a name="extractpath"></a><b>ExtractPath *metaname* [replace|remove|prepend|append|regex]</b>
 
1314
<p>This directive can be used to index extracted parts of a document's path.
 
1315
A common use would be to limit searches to specific areas of your
 
1316
file tree.</p>
 
1317
<p>The extracted string will be indexed under the specified meta name.</p>
 
1318
<p>See <code>ReplaceRules</code> for a description of the various pattern replacement
 
1319
methods, but you will use the <i>regex</i> method.</p>
 
1320
<p>For example, say your file system (or web tree) was organized into departments:</p>
 
1321
<pre class="pre-section">    /web/sales/foo...
 
1322
    /web/parts/foo...
 
1323
    /web/accounting/foo...</pre>
 
1324
<p>And you wanted a way to limit searches to just documents under "sales".</p>
 
1325
<pre class="pre-section">    ExtractPath department regex !^/web/([^/]+)/.*$!$1!</pre>
 
1326
<p>Which says, extract out the department name (as substring $1) and index it as
 
1327
meta name <code>department</code>.  Then to limit a search to the sales department:</p>
 
1328
<pre class="pre-section">    swish-e -w foo AND department=sales</pre>
 
1329
<p>Note that the <code>regex</code> method uses a substitution pattern, so to index only a
 
1330
sub-string match the <i>entire</i> document path in the regular expression, as
 
1331
shown above.  Otherwise any part that is not matched will end up in the
 
1332
substitution pattern.</p>
 
1333
<p>See the <code>ExtractPathDefault</code> option for a way to set a value if not patterns
 
1334
match.</p>
 
1335
<p>Although unlikely, you may use more than one <code>ExtractPath</code> directive.  More
 
1336
than one directive of the <i>same</i> meta name will operate successively (in order
 
1337
listed in the configuration file) on the path.  This allows you to use regular
 
1338
expressions on the results of the previous pattern substitution (as if piping
 
1339
the output from one expression to the patter of the next).</p>
 
1340
<pre class="pre-section">    ExtractPath foo regex !^(...).+$!$1!
 
1341
    ExtractPath foo regex !^.+(.)$!$1!</pre>
 
1342
<p>So, the third letter is indexed as meta name "foo" if both patterns match.    </p>
 
1343
<pre class="pre-section">    ExtractPath foo regex !^X(...).+$!$1!
 
1344
    ExtractPath foo regex !^.+(.)$!$1!</pre>
 
1345
<p>Now (not the "X"), if the first pattern doesn't match, the last character of
 
1346
the path name is indexed.  You must be clear on this behavior if you are using
 
1347
more than one <code>ExtractPath</code> directive with the same metaname.</p>
 
1348
<p>The document path operated on is the real path swish used to access the
 
1349
document.  That is, the <code>ReplaceRules</code> directive has no effect on the path
 
1350
used with <code>ExtractPath</code>.</p>
 
1351
<p>The full path is used for each meta name if more than one <code>ExtractPath</code>
 
1352
directive is used.  That is, changes to the path used in <code>ExtractPath foo</code> do
 
1353
not affect the path used by <code>ExtractPath bar</code>.</p>
 
1354
</li>
 
1355
<li><a name="item_extractpathdefault"></a><a name="extractpathdefault"></a><b>ExtractPathDefault *metaname* default_value</b>
 
1356
<p>This can be used with <code>ExtractPath</code> to set a default string to index under the
 
1357
given metaname if none of the <code>ExtractPath</code> patterns match.</p>
 
1358
<p>For example, say your want to index each document with a metaname
 
1359
"department" based on the following path examples:</p>
 
1360
<pre class="pre-section">    /web/sales/foo...
 
1361
    /web/parts/foo...
 
1362
    /web/accounting/foo...</pre>
 
1363
<p>But you are also indexing documents that do not follow that pattern and you want to search those
 
1364
separately, too.</p>
 
1365
<pre class="pre-section">    ExtractPath department regex !^/web/([^/]+)/.*$!$1!
 
1366
    ExtractPathDefault department other</pre>
 
1367
<p>Now, you may search like this:</p>
 
1368
<pre class="pre-section">    -w foo department=(sales)      - limit searches to the sales documents
 
1369
    -w foo department=(parts)      - limit searches to the parts documents
 
1370
    -w foo department=(accounting) - limit searches to the accounting documents
 
1371
    -w foo department=(other)      - everything but sales, parts, and accounting.</pre>
 
1372
<p>This basically is a shortcut for:</p>
 
1373
<pre class="pre-section">    -w foo not department=(sales or parts or accounting)</pre>
 
1374
<p>but you don't need to keep track of what was extracted.    </p>
 
1375
</li>
 
1376
<li><a name="item_propertynames"></a><a name="propertynames"></a><b>PropertyNames *list of meta names*</b>
 
1377
</li>
 
1378
<li><a name="item_propertynamescomparecase"></a><a name="propertynamescomparecase"></a><b>PropertyNamesCompareCase *list of meta names*</b>
 
1379
</li>
 
1380
<li><a name="item_propertynamesignorecase"></a><a name="propertynamesignorecase"></a><b>PropertyNamesIgnoreCase *list of meta names*</b>
 
1381
<p>Swish-e allows you to specify certain META tags that can be used as <b>document
 
1382
properties</b>.  The contents of any META tag that has been identified as a
 
1383
document property can be returned as part of the search results along with the
 
1384
rank, file name, title, and document size (see the <code>-p</code> and <code>-x</code> switches in
 
1385
<a href="swish-run.html">SWISH-RUN</a>).</p>
 
1386
<p>Properties are useful for returning additional data from documents in
 
1387
search results -- this saves the effort of reading and parsing the source
 
1388
files while reading Swish-e search results, and is especially useful
 
1389
when the source documents are no longer available or slow to access
 
1390
(e.g. over http).</p>
 
1391
<p>Another feature of properties is that Swish-e can use the PropertyNames for
 
1392
sorting the search results (see the <code>-s</code> switch).</p>
 
1393
<pre class="pre-section">    PropertyNames author subjects</pre>
 
1394
<p>Two variations are available.  <code>PropertyNamesCompareCase</code> and
 
1395
<code>PropertyNamesIgnoreCase</code>.  These tell Swish-e to either ignore or compare
 
1396
case when sorting results.  The default for <code>PropertyNames</code> is to ignore the
 
1397
case.</p>
 
1398
<pre class="pre-section">    PropertyNamesIgnoreCase subject
 
1399
    PropertyNamesCompareCase keyword</pre>
 
1400
<p>The defaults for "internal" properties are:</p>
 
1401
<pre class="pre-section">    swishtitle          --  ignore the case
 
1402
    swishdocpath        --  compare case
 
1403
    swishdescription    --  compare case</pre>
 
1404
<p>These can be overridden with <code>PropertyNamesCompareCase</code> and
 
1405
<code>PropertyNamesIgnoreCase</code>.</p>
 
1406
<pre class="pre-section">    PropertyNamesCompareCase swishtitle    </pre>
 
1407
<p>Use of PropertyNames will increase the size of your index files, sometimes
 
1408
significantly.  Properties will be compressed if Swish-e is compiled with zlib
 
1409
as described in the <a href="install.html">INSTALL</a> manual page.</p>
 
1410
<p>If Swish-e finds more than one property of the same name in a document
 
1411
the property's contents will be concatinated for strings, and a warning
 
1412
issues for numeric (or date) properties.</p>
 
1413
</li>
 
1414
<li><a name="item_propertynamesnostripchars"></a><a name="propertynamesnostripchars"></a><b>PropertyNamesNoStripChars</b>
 
1415
<p>PropertyNamesNoStripChars specifies that the listed properties should not
 
1416
have strings of low ASCII characters replaced with a space character.
 
1417
Properties will be stored as found in the document.</p>
 
1418
<p>When printing properties with the swish-e binary newlines are replaced with
 
1419
a space character.  Use the swish-e library (or SWISH::API perl module) to
 
1420
fetch properties without newlines replaced.</p>
 
1421
</li>
 
1422
<li><a name="item_propertynamesnumeric"></a><a name="propertynamesnumeric"></a><b>PropertyNamesNumeric</b>
 
1423
<p>This directive is similar to <code>PropertyNames</code>, but it flags the property as
 
1424
being a string of digits (integer value) that will be stored as binary data
 
1425
instead of a string.  This allows sorting with <code>-s</code> and limiting with <code>-L</code> to
 
1426
sort and limit the property correctly.</p>
 
1427
<p>Swish-e uses <code>strtoul(3)</code> to convert the string into an unsigned long integer.
 
1428
Therefore, only positive integers can be stored.</p>
 
1429
<p>Future versions of Swish-e may be able to store different property types
 
1430
(such as negative integers and real numbers).  This directive may change
 
1431
in future releases of Swish.</p>
 
1432
</li>
 
1433
<li><a name="item_propertynamesdate"></a><a name="propertynamesdate"></a><b>PropertyNamesDate</b>
 
1434
<p>This directive is exactly like <code>PropertyNamesNumeric</code>, but it also flags the
 
1435
number as a machine timestamp (seconds since Epoch), and will print a formatted
 
1436
date when returning this property.  See <code>-x</code> in <a href="swish-run.html">SWISH-RUN</a>.</p>
 
1437
<p>Swish-e will not parse dates when indexing; you must use a timestamp.</p>
 
1438
</li>
 
1439
<li><a name="item_propertynamealias"></a><a name="propertynamealias"></a><b>PropertyNameAlias  *property name* *list of aliases*</b>
 
1440
<p>This allows aliases for a property name.  For example, if you are indexing
 
1441
HTML files, plus XML files that are written in English, German, and
 
1442
Spanish and thus use the tags "title", "titel", and "t�tulo" you can use:</p>
 
1443
<pre class="pre-section">    PropertyNameAlias swishtitle title titel t�tulo titulo</pre>
 
1444
<p>Note that "swishtitle" is the built-in property used to store the title of
 
1445
a document, and therefore you do not need to specify it as a PropertyName
 
1446
before use.</p>
 
1447
</li>
 
1448
<li><a name="item_propertynamesmaxlength"></a><a name="propertynamesmaxlength"></a><b>PropertyNamesMaxLength  integer *list of meta names*</b>
 
1449
<p>This option will set the max length of the text stored in a property.
 
1450
You must specify a number between 0 and the max integer size on your
 
1451
platform, and a list of properties.  The properties specified must not
 
1452
be aliases.</p>
 
1453
<p>If any of the property names do not exist they will be created (e.g. you
 
1454
do not need to define the property with PropertyNames first).</p>
 
1455
<p>In general, this feature will only be useful when parsing HTML or XML
 
1456
with the libxml2 parser.</p>
 
1457
<p>For example:</p>
 
1458
<pre class="pre-section">    PropertyNamesMaxLength 1000 swishdescription
 
1459
    PropertyNameAlias swishdescription body</pre>
 
1460
<p>Is somewhat like</p>
 
1461
<pre class="pre-section">    StoreDescription HTML &lt;body&gt; 1000
 
1462
    StoreDescription XML &lt;body&gt; 1000
 
1463
    StoreDescription HTML2 &lt;body&gt; 1000
 
1464
    StoreDescription XML2 &lt;body&gt; 1000</pre>
 
1465
<p>but StoreDescription allows setting the tag for each parser type.</p>
 
1466
<pre class="pre-section">    PropertyNamesMaxLength 1000 headings
 
1467
    PropertyNameAlias headings h1 h2 h3 h4</pre>
 
1468
<p>collects all the heading text into a single property called "headings", not
 
1469
to exceed 1000 characters.</p>
 
1470
</li>
 
1471
<li><a name="item_propertynamessortkeylength"></a><a name="propertynamessortkeylength"></a><b>PropertyNamesSortKeyLength  integer *list of meta names*</b>
 
1472
<p>Sets the length of the string used when sorting.
 
1473
The default is 100 characters.  The -T metanames debugging option will
 
1474
list the current values for an index.</p>
 
1475
<p>This setting is used when sorting during indexing, and perhaps when sorting
 
1476
while searching.  It also effects the order when limiting to a range of values
 
1477
with the -L option.</p>
 
1478
</li>
 
1479
<li><a name="item_presortedindex"></a><a name="presortedindex"></a><b>PreSortedIndex *list of property names*</b>
 
1480
<p>By default Swish-e generates presorted tables while indexing for each
 
1481
property name.  This allows faster sorting when generating results.
 
1482
On large document collections this presorting may add to the indexing
 
1483
time, and also adds to the total size of the index.  This directive can
 
1484
be used to customize exactly which properties will be presorted.</p>
 
1485
<p>If <code>PreSortedIndex</code> it is <i>not</i> present in the config file (default action),
 
1486
all the properties will be presorted at indexing time.  If it is present
 
1487
without any parameter, no properties will be presorted.  Otherwise, only the
 
1488
property names specified will be presorted.</p>
 
1489
<p>For example, if you only wish to sort results by a property called <code>title</code>:</p>
 
1490
<pre class="pre-section">    PropertyNames title age time
 
1491
    PreSortedIndex  title</pre>
 
1492
</li>
 
1493
<li><a name="item_storedescription"></a><a name="storedescription"></a><b>StoreDescription [XML &lt;tag&gt; size|HTML &lt;meta&gt; size|TXT size]</b>
 
1494
<p><b>StoreDescription</b> allows you to store a document description in the index
 
1495
file.  This description can be returned in your search results when the <code>-x</code>
 
1496
switch is used to include the <i>swishdescription</i> for extended results, or by
 
1497
using <code>-p swishdescription</code>.</p>
 
1498
<p>The document type (XML, HTML and TXT) must match the document type currently
 
1499
being indexed as set by <code>IndexContents</code> or <code>DefaultContents</code>.  See those
 
1500
directives for possible values.  A common problem is using <code>StoreDescription</code>
 
1501
yet not setting the document's type with <code>IndexContents</code> or
 
1502
<code>DefaultContents</code>.  Another problem is different types:</p>
 
1503
<pre class="pre-section">    IndexContents HTML2 .html
 
1504
    StoreDescription HTML &lt;body&gt;</pre>
 
1505
<p>Then .html documents are assigned a type of HTML2 (and parsed by the libxml2 parser), but the
 
1506
description will not be stored since it is type HTML instead of HTML2.</p>
 
1507
<p>For text documents you specify the type TXT (or TXT2 or TXT*) and the number of <i>characters</i> to capture.</p>
 
1508
<pre class="pre-section">    StoreDescription TXT 20</pre>
 
1509
<p>The above stores only the first twenty characters from the text file in the Swish-e index
 
1510
file.</p>
 
1511
<p>For HTML, and XML file types, specify the tag to use for the
 
1512
description, and optionally the number of characters to capture.  If not
 
1513
specified will capture the entire contents of the tag.</p>
 
1514
<pre class="pre-section">    StoreDescription HTML &lt;body&gt; 20000
 
1515
    StoreDescription XML  &lt;desc&gt; 40</pre>
 
1516
<p>Again, note that documents must be assigned a document type with
 
1517
<code>IndexContents</code> or <code>DefaultContents</code> to use this feature.</p>
 
1518
<p>Swish-e will compress the descriptions (or any other large property) if
 
1519
compiled to use zlib (see <a href="install.html">INSTALL</a>).  This is recommended when using
 
1520
StoreDescription and a large number of documents.  Compression of 30% to 50% is
 
1521
not uncommon with HTML files.</p>
 
1522
</li>
 
1523
<li><a name="item_propcompressionlevel"></a><a name="propcompressionlevel"></a><b>PropCompressionLevel [0-9]</b>
 
1524
<p>This directive sets the compression level used when storing properties
 
1525
to disk.  A setting of zero is no compression, and a setting of nine is
 
1526
the most compression.</p>
 
1527
<p>The default depends on the default setting compiled with zlib, but is
 
1528
typically six.</p>
 
1529
<p>This option is useful when using <code>StoreDescription</code> to store a large amount
 
1530
text in properties (or if using <code>PropertyNames</code> with large property sizes).</p>
 
1531
<p>Properties must be over a value defined in <i>config.h</i> (100 is the
 
1532
default) before compression will be attempted.  Swish-e will never store
 
1533
the results of the compression if the compressed data is larger than
 
1534
the original data.</p>
 
1535
<p>This option is only available when Swish-e is compiled with zlib support.</p>
 
1536
</li>
 
1537
<li><a name="item_truncatedocsize"></a><a name="truncatedocsize"></a><b>TruncateDocSize *number of characters*</b>
 
1538
<p>TruncateDocSize limits the size of a document while indexing documents
 
1539
and/or using filters.  This config directive truncates the numbers of
 
1540
read bytes of a document to the specified size.  This means: if a document
 
1541
is larger, read only the specified numbers of bytes of the document.</p>
 
1542
<p>Example:</p>
 
1543
<pre class="pre-section">    TruncateDocSize    10000000</pre>
 
1544
<p>The default is zero, which means read all data.</p>
 
1545
<p>Warning: If you use TruncateDocSize, use it with care!  TruncateDocSize
 
1546
is a safety belt only, to limit e.g.  filteroutput, when accessing
 
1547
databases, or to limit "runnaway" filters.  Truncating doc input may
 
1548
destroy document structures for Swish-e (e.g.  swish may miss closing
 
1549
tags for XML or HTML documents).</p>
 
1550
<p>TruncateDocSize does not currently work with the <code>prog</code> input source method.</p>
 
1551
</li>
 
1552
<li><a name="item_fuzzyindexingmode"></a><a name="fuzzyindexingmode"></a><b>FuzzyIndexingMode NONE|Stemming|Soundex|Metaphone|DoubleMetaphone</b>
 
1553
<p>Selects the type of index to create.  Only one type of index may be created.</p>
 
1554
<p>It's a good idea to create both a normal index and a fuzzy index and
 
1555
allow your search interface select which index to use.  Many people find the
 
1556
fuzzy searches to be too fuzzy.</p>
 
1557
<p>The available fuzzy indexing options can be displayed by running</p>
 
1558
<pre class="pre-section">   swish-e -T LIST_FUZZY_MODES</pre>
 
1559
<p>Available options include:</p>
 
1560
<ul>
 
1561
<li><a name="item_none"></a><a name="none"></a><b>None</b>
 
1562
<p>Words are stored in the index without any conversion.  This is the default.</p>
 
1563
</li>
 
1564
<li><a name="item_stemming__"></a><a name="stemming__"></a><b>Stemming_*</b>
 
1565
<p>This options uses one of the installed Snowball stemmers (<a href="http://snowball.tartarus.org/">http://snowball.tartarus.org/</a>).</p>
 
1566
<p>The installed stemmers can be viewed by running</p>
 
1567
<pre class="pre-section">   swish-e -T LIST_FUZZY_MODES</pre>
 
1568
<p>For example, to use the Spanish stemming module:</p>
 
1569
<pre class="pre-section">   FuzzyIndexingMode Stemming_es</pre>
 
1570
</li>
 
1571
<li><a name="item_stem"></a><a name="stem"></a><b>Stem or Stemming_en</b>
 
1572
<p><b>**This option is no longer supported.**</b></p>
 
1573
<p>Selects the legacy Swish-e English stemmer.</p>
 
1574
<p>This is deprecated in favor of the Snowball English stemmer Stemming_en1.</p>
 
1575
<p>Words are converted using the Porter stemming algorithm.</p>
 
1576
<p>From: <a href="http://www.tartarus.org/~martin/PorterStemmer/">http://www.tartarus.org/~martin/PorterStemmer/</a></p>
 
1577
<pre class="pre-section">    The Porter stemming algorithm (or Porter stemmer) is a
 
1578
    process for removing the commoner morphological and inflexional
 
1579
    endings from words in English. Its main use is as part of a
 
1580
    term normalisation process that is usually done when setting up
 
1581
    Information Retrieval systems.</pre>
 
1582
<p>This will help a search for "running" to also find "run" and "runs", for example.</p>
 
1583
<p>The stemming function does not convert words to their root, rather
 
1584
programmatically removes endings on words in an attempt to make similar
 
1585
words with different endings stem to the same string of characters.
 
1586
It's not a perfect system, and searches on stemmed indexes often return
 
1587
curious results.  For example, two entirely different words may stem to
 
1588
the same word.</p>
 
1589
<p>Stemming also can be confusing when used with a wildcard (truncation).
 
1590
For example, you might expect to find the word "running" by searching for
 
1591
"runn*".  But this fails when using a stemmed index, as "running" stems to
 
1592
"run", yet searching for "runn*" looks for words that start with "runn".</p>
 
1593
</li>
 
1594
<li><a name="item_soundex"></a><a name="soundex"></a><b>Soundex</b>
 
1595
<p>Soundex was developed in the 1880s so records for people with similar
 
1596
sounding names could be found more readily.  Soundex is a coded surname
 
1597
based on the way a surname sounds rather than spelling.  Surnames that
 
1598
sound similar, like Smith and Smyth, are filed together under the same
 
1599
Soundex code.  This is mostly useful for US English.</p>
 
1600
<p>Soundex should not be used to search for sound-alike words.  Metaphone
 
1601
would be more appropriate for generic sound matching of words.  Soundex
 
1602
should only be used where you need to search multiple documents for
 
1603
proper names which sound similar.  This is primarily used for indexing
 
1604
genealogical records.  This may be useful for indexing other collections
 
1605
of data consisting mostly of names.  Many common name variations are
 
1606
matched by Soundex.  The only notable exception is the first letter of
 
1607
the name.  The first letter is not matched for sound.</p>
 
1608
</li>
 
1609
<li><a name="item_metaphone"></a><a name="metaphone"></a><b>Metaphone and DoubleMetaphone</b>
 
1610
<p>Words are transformed into a short series of letters representing the sound of the word (in English).
 
1611
Metaphone algorithms are often used for looking up mis-spelled words in dictionary programs.</p>
 
1612
<p>From: <a href="http://aspell.sourceforge.net/metaphone/">http://aspell.sourceforge.net/metaphone/</a></p>
 
1613
<pre class="pre-section">    Lawrence Philips' Metaphone Algorithm is an algorithm which returns
 
1614
    the rough approximation of how an English word sounds.</pre>
 
1615
<p>The <code>DoubleMetaphone</code> mode will sometimes generate two different metaphones
 
1616
for the same word.  This is supposed to be useful when a word may be pronounced
 
1617
more than one way.</p>
 
1618
<p>A metaphone index should give results somewhere in between Soundex and Stemming.    </p>
 
1619
</li>
 
1620
</ul>
 
1621
</li>
 
1622
<li><a name="item_usestemming"></a><a name="usestemming"></a><b>UseStemming [yes|NO]</b>
 
1623
<p>Put yes to apply word stemming algorithm during indexing, else no.</p>
 
1624
<pre class="pre-section">    UseStemming no
 
1625
    UseStemming yes</pre>
 
1626
<p>When UseStemming is set to <code>yes</code> every word is stemmed before placing it in to
 
1627
the index.</p>
 
1628
<p>This option is deprecated.  It has been superceded by <code>FuzzyIndexingMode</code>.</p>
 
1629
</li>
 
1630
<li><a name="item_usesoundex"></a><a name="usesoundex"></a><b>UseSoundex [yes|NO]</b>
 
1631
<p>When UseSoundex is set to <code>yes</code> every word is converted to a Soundex code
 
1632
before placing it in to the index.</p>
 
1633
<p>This option is deprecated.  It has been superceded by <code>FuzzyIndexingMode</code>.</p>
 
1634
</li>
 
1635
<li><a name="item_ignoretotalwordcountwhenranking"></a><a name="ignoretotalwordcountwhenranking"></a><b>IgnoreTotalWordCountWhenRanking [YES|no]</b>
 
1636
<p>Put yes to ignore the total number of words in the file when calculating
 
1637
ranking. Often better with merges and small files. Default is yes.</p>
 
1638
<pre class="pre-section">    IgnoreTotalWordCountWhenRanking no</pre>
 
1639
<p>The default was changed from no to yes in version 2.2.</p>
 
1640
<p><b>NOTE:</b> must be set to <b>no</b> if you intend to use the -R 1 option when
 
1641
searching.</p>
 
1642
</li>
 
1643
<li><a name="item_minwordlimit"></a><a name="minwordlimit"></a><b>MinWordLimit *integer*</b>
 
1644
<p>Set the minimum length of an word. Shorter words will not be indexed.
 
1645
The default is 1 (as defined in <i>src/config.h</i>).</p>
 
1646
<pre class="pre-section">    MinWordLimit 5</pre>
 
1647
</li>
 
1648
<li><a name="item_maxwordlimit"></a><a name="maxwordlimit"></a><b>MaxWordLimit *integer*</b>
 
1649
<p>Set the maximum length of an indexable word. Every longer word will not
 
1650
be indexed.  The Default is 40 (as defined in <i>src/config.h</i>).</p>
 
1651
</li>
 
1652
<li><a name="item_wordcharacters"></a><a name="wordcharacters"></a><b>WordCharacters *string of characters*</b>
 
1653
</li>
 
1654
<li><a name="item_ignorefirstchar"></a><a name="ignorefirstchar"></a><b>IgnoreFirstChar *string of characters*</b>
 
1655
</li>
 
1656
<li><a name="item_ignorelastchar"></a><a name="ignorelastchar"></a><b>IgnoreLastChar *string of characters*</b>
 
1657
</li>
 
1658
<li><a name="item_begincharacters"></a><a name="begincharacters"></a><b>BeginCharacters *string of characters*</b>
 
1659
</li>
 
1660
<li><a name="item_endcharacters"></a><a name="endcharacters"></a><b>EndCharacters *string of characters*</b>
 
1661
<p>These settings define what a word consists of to the Swish-e indexing engine.
 
1662
Compiled in defaults are in <i>src/config.h</i>.</p>
 
1663
<p>When indexing Swish-e uses <b>WordCharacters</b> to split up the document
 
1664
into words.  Words are defined by any string of non-blank characters
 
1665
that contain only the characters listed in WordCharacters.  If a string
 
1666
of characters includes a character that is not in WordCharacters then
 
1667
the word will be spit into two or more separate words.</p>
 
1668
<p>For example:</p>
 
1669
<pre class="pre-section">    WordCharacters abde</pre>
 
1670
<p>Would turn "abcde" into two words "ab" and "de".</p>
 
1671
<p>Next, of these words, any characters defined in <b>IgnoreFirstChar</b> are
 
1672
stripped off the start of the word, and <b>IgnoreLastChar</b> characters
 
1673
are stripped off the end of the word.  This allows, for example,
 
1674
periods within a word (www.slashdot.com), but not at the end of
 
1675
a word.  Characters in IgnoreFirstChar and IgnoreLastChar must be in
 
1676
WordCharacters.</p>
 
1677
<p>Finally, the resulting words MUST begin with one of the characters
 
1678
listed in <b>BeginCharacters</b> and end with one of the characters listed in
 
1679
<b>EndCharacters</b>.  BeginCharacters and EndCharacters must be a subset of
 
1680
the characters in WordCharacters.  Often, WordCharacters, BeginCharacters
 
1681
and EndCharacters will all be the same.</p>
 
1682
<p>Note that the same process applies to the query while searching.</p>
 
1683
<p>Getting these settings correct will take careful consideration and practice.
 
1684
It's helpful to create an index of a single test file, and then look at the
 
1685
words that are placed in the index (see the <code>-v 4</code>, <code>-D</code> and <code>-k</code> searching
 
1686
switches).</p>
 
1687
<p>Currently there is only support for eight-bit characters.</p>
 
1688
<p>Example:</p>
 
1689
<pre class="pre-section">    WordCharacters  .abcdefghijklmnopqrstuvwxyz
 
1690
    BeginCharacters abcdefghijklmnopqrstuvwxyz
 
1691
    EndCharacters   abcdefghijklmnopqrstuvwxyz
 
1692
    IgnoreFirstChar .
 
1693
    IgnoreLastChar  .</pre>
 
1694
<p>So the string</p>
 
1695
<pre class="pre-section">    Please visit http://www.example.com/path/to/file.html.</pre>
 
1696
<p>will be indexed as the following words:</p>
 
1697
<pre class="pre-section">    please
 
1698
    visit
 
1699
    http
 
1700
    www.example.com
 
1701
    path
 
1702
    to
 
1703
    file.html</pre>
 
1704
<p>Which means that you can search for <code>www.example.com</code> as a single word, but
 
1705
searching for just <code>example</code> will not find the document.</p>
 
1706
<p>Note: when indexing HTML documents HTML entities are converted to their
 
1707
character equivalents before being processed with these directives.  This is a
 
1708
change from previous versions of Swish-e where you were required to include the
 
1709
characters <code>0123456789&amp;#;</code> to index entities.  See also <code>ConvertHTMLEntities</code></p>
 
1710
</li>
 
1711
<li><a name="item_buzzwords"></a><a name="buzzwords"></a><b>Buzzwords [*list of buzzwords*|File: path]</b>
 
1712
<p>The Buzzwords option allows you to specify words that will be indexed
 
1713
regardless of WordCharacters, BeginCharacters, EndCharacters, stemming,
 
1714
soundex and many of the other checks done on words while indexing.</p>
 
1715
<p>Buzzwords are case insensitive.</p>
 
1716
<p>Buzzwords should be separated by spaces and may span multiple directives.  If
 
1717
the special format <code><a href="File:filename">File:filename</a></code> is used then the Buzzwords will be read
 
1718
from an external file during indexing.</p>
 
1719
<p>Examples:</p>
 
1720
<pre class="pre-section">    Buzzwords C++ TCP/IP
 
1721
 
 
1722
    Buzzwords File: ./buzzwords.lst</pre>
 
1723
<p>If a Buzzword contains search operator characters they must be backslashed
 
1724
when searching.  For example:</p>
 
1725
<pre class="pre-section">    Buzzwords C++ TCP/IP web=http
 
1726
 
 
1727
    ./swish-e -w 'web\=http'</pre>
 
1728
<p>Buzzwords are found by splitting the text on whitespace, removing
 
1729
<code>IgnoreFirstChar</code> and <code>IgnoreLastChar</code> characters from the word, and then
 
1730
comparing with the list of <code>Buzzwords</code>.  Therefore, if adding <code>Buzzwords</code> to
 
1731
an index you will probably want to define <code>IgnoreFirstChar</code> and
 
1732
<code>IgnoreLastChar</code> settings.</p>
 
1733
<p>Note: Buzzwords specific settings for <code>IgnoreFirstChar</code> and <code>IgnoreLastChar</code>
 
1734
may be used in the future.</p>
 
1735
</li>
 
1736
<li><a name="item_compresspositions"></a><a name="compresspositions"></a><b>CompressPositions  [yes|NO]</b>
 
1737
<p>This option enables zlib compression for individual word data in the index file.
 
1738
The default is NO, that is the index word data is not compressed by default.</p>
 
1739
<p>Enabling this option can reduced the size of the index file, but at the expense of
 
1740
slower wildcard search times.</p>
 
1741
<p>The default changed from YES to NO starting with version 2.4.3.</p>
 
1742
</li>
 
1743
<li><a name="item_ignorewords"></a><a name="ignorewords"></a><b>IgnoreWords [*list of stop words*|File: path]</b>
 
1744
<p>The IgnoreWords option allows you to specify words to ignore, called
 
1745
<i>stopwords</i>.  The default is to not use any stopwords.</p>
 
1746
<p>Words should be separated by spaces and may span multiple directives.  If the
 
1747
special format <code><a href="File:filename">File:filename</a></code> is used then the stop words will be read from
 
1748
an external file during indexing.</p>
 
1749
<p>In previous versions of Swish-e you could use the directive</p>
 
1750
<pre class="pre-section">    IgnoreWords swishdefault - obsolete!</pre>
 
1751
<p>to include a default list of compiled in stopwords.  This keyword is no
 
1752
longer supported.</p>
 
1753
<p>Examples:</p>
 
1754
<pre class="pre-section">    IgnoreWords www http a an the of and or
 
1755
 
 
1756
    IgnoreWords File: ./stopwords.de</pre>
 
1757
</li>
 
1758
<li><a name="item_usewords"></a><a name="usewords"></a><b>UseWords [*list of words*|File: path]</b>
 
1759
<p>UseWords defines the words that Swish-e will index.  <b>Only</b> the words
 
1760
listed will be indexed.</p>
 
1761
<p>You can specify a list of words following the directive (you may specify more
 
1762
than one <code>UseWords</code> directive in a config file), and/or use the <code>File:</code> form
 
1763
to specify a path to a file containing the words:</p>
 
1764
<pre class="pre-section">    UseWords perl python pascal fortran basic cobal php
 
1765
    UseWords File: /path/to/my/wordlist</pre>
 
1766
<p>Please drop the Swish-e list a note if you actually use this feature.
 
1767
It may be removed from future versions.</p>
 
1768
</li>
 
1769
<li><a name="item_ignorelimit"></a><a name="ignorelimit"></a><b>IgnoreLimit *integer integer*</b>
 
1770
<p>This automatically omits words that appear too often in the files (these
 
1771
words are called stopwords). Specify a whole percentage and a number,
 
1772
such as "80 256". This omits words that occur in over 80% of the files
 
1773
and appear in over 256 files. Comment out to turn off auto-stopwording.</p>
 
1774
<pre class="pre-section">    IgnoreLimit 50 1000</pre>
 
1775
<p>Swish-e must do extra processing to adjust the entire index when this
 
1776
feature is used.  It is recommended that instead of using this feature
 
1777
that you decided what words are stopwords and add them to <b>IngoreWords</b>
 
1778
in your configuration file.  To do this, use IgnoreLimit one time and
 
1779
note the stop words that are found while indexing.  Add this list to
 
1780
IgnoreWords, and then remove IgnoreLimit from the configuration file.</p>
 
1781
</li>
 
1782
<li><a name="item_ignoremetatags"></a><a name="ignoremetatags"></a><b>IgnoreMetaTags *list of names*</b>
 
1783
<p><code>IgnoreMetaTags</code> defines a list of metatags to ignore while indexing XML files
 
1784
(and HTML files if using libxml2 for parsing HTML).  All text within the tags
 
1785
will be ignored -- both for indexing (<code>MetaNames</code>) and properties
 
1786
(<code>PropertyNames</code>).  To still parse properties, yet do not index the text, see
 
1787
<code>UndefinedMetaTags</code>.</p>
 
1788
<p>This option is useful to avoid indexing specific data from a file.
 
1789
For example:</p>
 
1790
<pre class="pre-section">    &lt;person&gt;
 
1791
        &lt;first_name&gt;
 
1792
            William
 
1793
        &lt;/first_name&gt; &lt;last_name&gt;
 
1794
            Shakespeare
 
1795
        &lt;/last_name&gt; &lt;updated_date&gt;
 
1796
            April 25, 1999
 
1797
        &lt;/updated_date&gt;
 
1798
    &lt;/person&gt;</pre>
 
1799
<p>In the above example you might <b>not</b> want to index the updated date,
 
1800
and therefore prevent finding this record by searching</p>
 
1801
<pre class="pre-section">    -w 'person=(April)'</pre>
 
1802
<p>This is solved by:</p>
 
1803
<pre class="pre-section">    IgnoreMetaTags updated_date</pre>
 
1804
<p>See also <code>UndefinedMetaTags</code>.</p>
 
1805
</li>
 
1806
<li><a name="item_ignorenumberchars"></a><a name="ignorenumberchars"></a><b>IgnoreNumberChars *list of characters*</b>
 
1807
<p>Experimental Feature</p>
 
1808
<p>This experimental feature can be used to define a set of characters that
 
1809
describe a number.  If a word is found to contain only those characters it will
 
1810
not be indexed.  The characters listed must be part of <code>WordCharacters</code>
 
1811
settings.  In other words, the "word" checked is a word that Swish-e would
 
1812
otherwise index.</p>
 
1813
<p>For example,</p>
 
1814
<pre class="pre-section">    IgnoreNumberChars 0123456789$.,</pre>
 
1815
<p>Then Swish-e would not index the following:</p>
 
1816
<pre class="pre-section">    123
 
1817
    123,456.78
 
1818
    $123.45</pre>
 
1819
<p>You might be tempted to avoid indexing hex numbers with:</p>
 
1820
<pre class="pre-section">    IgnoreNumberChars 0123456789abcdef</pre>
 
1821
<p>which will not index 0D31, but will also not index the word "bad".</p>
 
1822
<p>This is an experimental feature that may change in future versions.
 
1823
One possible change is to use regular expressions instead.</p>
 
1824
</li>
 
1825
<li><a name="item_indexcomments"></a><a name="indexcomments"></a><b>IndexComments [NO|yes]</b>
 
1826
<p>This option allows the user decide if to index the contents of HTML
 
1827
comments.  Default is no. Set to yes if comment indexing is required.</p>
 
1828
<pre class="pre-section">    IndexComments yes</pre>
 
1829
<p>Note: This is a change in the default behavior prior to version 2.2.</p>
 
1830
</li>
 
1831
<li><a name="item_translatecharacters"></a><a name="translatecharacters"></a><b>TranslateCharacters [*string1 string2*|:ascii7:]</b>
 
1832
<p>The TranslateCharacters directive maps the characters in string1 to the
 
1833
characters listed in string2.</p>
 
1834
<p>For example:</p>
 
1835
<pre class="pre-section">    # This will index a_b as a-b and �mo as amo
 
1836
    TranslateCharacters _� -a</pre>
 
1837
<p><code>TranslateCharacters :ascii7:</code> is a predefined set of characters that will
 
1838
translate eight bit characters to ascii7 characters.  Using the :ascii7: rule
 
1839
will translate "���" to "aac". This means: searching "�elik", "�elik" or
 
1840
"celik" will all match the same word.</p>
 
1841
<p>TranslateCharacters is done early in the indexing process, after
 
1842
converting HTML entities but before splitting the input text into words
 
1843
based on <b>WordCharacters</b>.  So characters you are translating <i>from</i>
 
1844
do not need to be listed in word characters.</p>
 
1845
<p>The same character translations take place when searching.</p>
 
1846
</li>
 
1847
<li><a name="item_bumppositioncountercharacters"></a><a name="bumppositioncountercharacters"></a><b>BumpPositionCounterCharacters *string*</b>
 
1848
<p>When indexing Swish-e assigns a word position to each word.  This enables
 
1849
phrase searching.  There may be cases where you would like to prevent
 
1850
phrase matching.  The BumpPositionCounterCharacters directive allows
 
1851
you to specify a set of characters that when found in the text will
 
1852
increment the word position -- effectively preventing phrase matches
 
1853
across that character.</p>
 
1854
<p>For example, if you have a tag:</p>
 
1855
<pre class="pre-section">    &lt;subjects&gt;
 
1856
        computer programming | apple computers
 
1857
    &lt;/subjects&gt;</pre>
 
1858
<p>You might want to prevent matching "programming apple" in that meta name.</p>
 
1859
<pre class="pre-section">    BumpPositionCounterCharacters |</pre>
 
1860
<p>There is no default, and you may list a string of characters.</p>
 
1861
</li>
 
1862
<li><a name="item_dontbumppositiononendtags"></a><a name="dontbumppositiononendtags"></a><b>DontBumpPositionOnEndTags *list of names*</b>
 
1863
</li>
 
1864
<li><a name="item_dontbumppositiononstarttags"></a><a name="dontbumppositiononstarttags"></a><b>DontBumpPositionOnStartTags *list of names*</b>
 
1865
<p>Since metatags are typically separate data fields, the word position counter is
 
1866
automatically bumped between metatags (actually, bumped when a start tag is
 
1867
found and when an end tag is found).  This prevents matching a phrase that
 
1868
spans more than one metaname.  <code>DontBumpPositionOnEndTags</code> and
 
1869
<code>DontBumpPositionOnStartTags</code> disables this feature for the listed metanames.</p>
 
1870
<p>For example,</p>
 
1871
<pre class="pre-section">    &lt;person&gt;
 
1872
        &lt;first_name&gt;
 
1873
            William
 
1874
        &lt;/first_name&gt;
 
1875
        &lt;last_name&gt;
 
1876
            Shakespeare
 
1877
        &lt;/last_name&gt;
 
1878
        &lt;updated_date&gt;
 
1879
            April 25, 1999
 
1880
        &lt;/updated_date&gt;
 
1881
    &lt;/person&gt;</pre>
 
1882
<p>In the configuration file:</p>
 
1883
<pre class="pre-section">    DontBumpPositionOnEndTags first_name
 
1884
    DontBumpPositionOnStartTags last_name</pre>
 
1885
<p>This configuration allows this phrase search</p>
 
1886
<pre class="pre-section">    -w 'person=("william shakespeare")'</pre>
 
1887
<p>but this phrase search will fail</p>
 
1888
<pre class="pre-section">    -w 'person=("shakespeare april")'</pre>
 
1889
</li>
 
1890
</ul>
 
1891
 
 
1892
    </div>
 
1893
 
 
1894
    <div class="sub-section">
 
1895
        
 
1896
<h2><a name="directives_for_the_file_access_method_only"></a>Directives for the File Access method only</h2>
 
1897
 
 
1898
<p>Some directives have different uses depending on the source of the
 
1899
documents.  These directives are only valid when using the <b>File system</b>
 
1900
method of indexing.</p>
 
1901
<ul>
 
1902
<li><a name="item_indexonly"></a><a name="indexonly"></a><b>IndexOnly *list of file suffixes*</b>
 
1903
<p>This directive specifies the allowable file suffixes (extensions) while
 
1904
indexing.  The default is to index all files specified in <b>IndexDir</b>.</p>
 
1905
<pre class="pre-section">    # Only index .html .htm and .q files
 
1906
    IndexOnly .html .htm .q</pre>
 
1907
<p><code>IndexOnly</code> checks that the file end in the characters listed.  It does not
 
1908
check "extensions".  <code>IndexOnly</code> is tested right before <code>FileRules</code> is
 
1909
processed.</p>
 
1910
</li>
 
1911
<li><a name="item_followsymlinks"></a><a name="followsymlinks"></a><b>FollowSymLinks [yes|NO]</b>
 
1912
<p>Put "yes" to follow symbolic links in indexing, else "no".  Default is no.</p>
 
1913
<pre class="pre-section">    FollowSymLinks no
 
1914
    FollowSymLinks yes</pre>
 
1915
<p>Note that when set to <code>no</code> extra stat(2) system calls must be made for each
 
1916
file.  For large number of files you may see a small reduction in indexing time
 
1917
by setting this to <code>yes</code>.</p>
 
1918
<p>See also the <code>-l</code> switch in <a href="swish-run.html">SWISH-RUN</a>.</p>
 
1919
</li>
 
1920
<li><a name="item_filerules"></a><a name="filerules"></a><b>FileRules [type] [contains|is|regex] *regular expression*</b>
 
1921
</li>
 
1922
<li><a name="item_filematch"></a><a name="filematch"></a><b>FileMatch [type] [contains|is|regex] *regular expression*</b>
 
1923
<p>FileRules and FileMatch are used to, respectively, exclude and include files
 
1924
and directories to index.  Since, by default, Swish-e indexes all files and
 
1925
recurses all directories (but see also <code>FollowSymLinks</code>) you will typically
 
1926
only use <code>FileRules</code> to exclude files or directories.  <code>FileMatch</code> is useful
 
1927
in a few cases, for example, to override the behavior of <code>IndexOnly</code>.  Some
 
1928
examples are included below.</p>
 
1929
<p>Except for <code>FileRules title ...</code>, this feature is only available for file
 
1930
access method (-S fs), which is the default indexing mode.  Also, any pathname
 
1931
modification with <code>ReplaceRules</code> happens after the check for <code>FileRules</code>.
 
1932
(It's unlikely that you would exclude files with <code>FileRules</code> based on text you
 
1933
added with <code>ReplaceRules</code>!)</p>
 
1934
<p>The regular expression is a C regex.h extended regular expression.
 
1935
You may supply more than one regular expression per line, or use
 
1936
separate directives.  Preceding the regular expression with the word
 
1937
"not" negates the match.</p>
 
1938
<p>The regular expression is compared against <b>[type]</b> as described below.</p>
 
1939
<p>For historical reasons, you can specify <code>contains</code> or <code>is</code>.  <code>is</code> simply
 
1940
forces the regular expression to match at the start and end of the string (by
 
1941
internally prepending "^" and appending "$" to the regular expression).</p>
 
1942
<p>The <code>regex</code> option requires delimiter characters:</p>
 
1943
<pre class="pre-section">    FileRules title regex /^private/i</pre>
 
1944
<p>The only advantage of <code>regex</code> is if you want to do case insensitive matches,
 
1945
or simply like your regular expressions to look like perl regular expressions.
 
1946
You must use matching delimiters; (), {}, and [], are not currently supported
 
1947
for no good reason other than laziness.</p>
 
1948
<p>Use quotes (" or ') around a pattern if it contains any white space.
 
1949
Note that the backslash character becomes the escape character within
 
1950
quotes.</p>
 
1951
<p>For example, these sets generate the same regular expressions.</p>
 
1952
<pre class="pre-section">    FileRules title is hello
 
1953
    FileRules title contains ^hello$
 
1954
    FileRules title regex /^hello$/</pre>
 
1955
<p>These all need quotes due to the included space character</p>
 
1956
<pre class="pre-section">    FileRules title is "hello there"
 
1957
    FileRules title contains "^hello there$"
 
1958
    FileRules title regex "!^hello there$!"</pre>
 
1959
<p>These show how the backslash must be doubled inside of quotes.
 
1960
Swish-e converts a double-backslash into a single backslash, and then
 
1961
passes that single onto the regular expression compiler.</p>
 
1962
<pre class="pre-section">    FileRules filename regex /\.pdf/
 
1963
    FileRules filename regex "/\\.pdf/"
 
1964
 
 
1965
    FileRules filename regex !hello\\there!     # need double for real backslash 
 
1966
    FileRules filename regex "!hello\\\\there!" # need double-double inside of quotes</pre>
 
1967
<p><b>Matching Types</b></p>
 
1968
<p>The following types of match strings my be supplied:</p>
 
1969
<pre class="pre-section">    FileRules pathname
 
1970
    FileRules dirname
 
1971
    FileRules filename
 
1972
    FileRules directory
 
1973
    FileRules title
 
1974
 
 
1975
    FileMatch pathname
 
1976
    FileMatch filename
 
1977
    FileMatch dirname
 
1978
    FileMatch directory</pre>
 
1979
<p><b>pathname</b> matches the regular expression against the current pathname.  The
 
1980
pathname may or may not be absolute depending on what you supplied to
 
1981
<code>IndexDir</code>.</p>
 
1982
<p>Example:</p>
 
1983
<pre class="pre-section">    # Don't index paths that contain private or hidden
 
1984
    FileRules pathname contains (private|hidden)
 
1985
 
 
1986
    # Same thing
 
1987
    FileRules pathname regex /(private|hidden)/
 
1988
 
 
1989
    # Don't index exe files
 
1990
    FileRules pathname contains \.exe$</pre>
 
1991
<p><b>dirname</b> and <b>filename</b> split the path name by the last delimiter
 
1992
character into a directory name, and a file name.  Then these are compared
 
1993
against the patterns supplied.  Directory names do <b>not</b> have a trailing
 
1994
slash.  All path names use the forward slash as a delimiter within Swish-e.</p>
 
1995
<p>Example:</p>
 
1996
<pre class="pre-section">    # Same as last example - don't index *.exe files.
 
1997
    FileRules filename contains \.exe$
 
1998
 
 
1999
    # Don't index any file called test.html files
 
2000
    FileRules filename contains ^test\.html$
 
2001
 
 
2002
    # Same thing
 
2003
    FileRules filename is test\.html
 
2004
 
 
2005
    # Don't index any directories that contain "old"  (/usr/local/myold/docs)
 
2006
    FileRules dirname contains old
 
2007
 
 
2008
    # Don't index any directories that contain the path segment "old" (/usr/local/old/foo)
 
2009
    FileRules dirname contains /old/  
 
2010
 
 
2011
    # Index only .htm, .html, plus any all-digit file names
 
2012
    IndexOnly .htm .html
 
2013
    FileMatch filename contains ^\d+$
 
2014
 
 
2015
    # Same as previous, but maybe a little slower
 
2016
    FileRules filename regex not !\.(htm|html)$!
 
2017
    FileMatch filename contains ^\d+$</pre>
 
2018
<p>Swish-e checks these settings in the order of <code>pathname</code>, <code>dirname</code>, and
 
2019
<code>filename</code>, and <code>FileMatch</code> patterns are checked before <code>FileRules</code>, in
 
2020
general.  This allows you to exclude most files with <code>FileRules</code>, yet allow in
 
2021
a few special cases with <code>FileMatch</code>. For example:</p>
 
2022
<pre class="pre-section">    # Exclude all files of .exe, .bin, and .bat
 
2023
    FileRules filename contains \.(exe|bin|bat)$
 
2024
    # But, let these two in
 
2025
    FileMatch filename is baseball\.bat incoming_mail\.bin
 
2026
 
 
2027
    # Same, but as a single pattern
 
2028
    FileMatch filename is (baseball\.bat|incoming_mail\.bin)</pre>
 
2029
<p>The <code>directory</code> type is somewhat unique. When Swish-e recurses into a
 
2030
directory it will compare all the <i>files</i> in the directory with the pattern
 
2031
and then decide if that entire directory should or should not be indexed (or
 
2032
recursed).  Note that you are matching against file names in a directory -- and
 
2033
some of those names may be directory names.</p>
 
2034
<p>A <code>FileRules directory</code> match will cause Swish-e to ignore all files and
 
2035
sub-directories in the current directory.</p>
 
2036
<p>Warning: A match with <code>FileMatch directory</code> says to index <b>everything</b> in the
 
2037
*current* directory and <b>ignore</b> any FileRules for this directory.</p>
 
2038
<p>Example:</p>
 
2039
<pre class="pre-section">    # Don't index any directories (and sub directories) that contain
 
2040
    # a file (or sub-directory) called "index.skip"
 
2041
    FileRules directory contains ^index\.skip$
 
2042
 
 
2043
    # Don't index directories that contain a .htaccess file.
 
2044
    FileRules directory contains ^\.htaccess</pre>
 
2045
<p>Note: While <i>processing</i> directories, Swish-e will ignore any files or
 
2046
directories that begin with a dot (".").  You may index files or directories
 
2047
that begin with a dot by specifying their name with <code>IndexDir</code> or <code>-i</code>.</p>
 
2048
<p><code>title</code> checks for a pattern match in an HTML title.</p>
 
2049
<p>Example:</p>
 
2050
<pre class="pre-section">    FileRules title contains construction example pointers
 
2051
 
 
2052
    # This example says to ignore case
 
2053
    FileRules title regex "/^Internal document/i"</pre>
 
2054
<p>Note: <code>FileRules title</code> works for any input method (fs, prog, or http) that is
 
2055
parsed as HTML, and where a title was found in the document.</p>
 
2056
<p>In case all this seems a bit confusing, processing a directory happens
 
2057
in the following order.</p>
 
2058
<p>First the directory name is checked:</p>
 
2059
<pre class="pre-section">    FileRules dirname - reject entire directory if matches</pre>
 
2060
<p>Next the directory is scanned and each file name (which might be the
 
2061
name of a sub-directory) is checked:</p>
 
2062
<pre class="pre-section">    FileRules directory - reject entire dir if *any* files match
 
2063
    FileMatch directory - accept entire dir if *any* files match</pre>
 
2064
<p>Then, unless <code>FileMatch directory</code> matched, each file is tested with
 
2065
FileMatch.  A match says to index the file without further testing (i.e.
 
2066
overrides FileRules and IndexOnly):</p>
 
2067
<pre class="pre-section">    FileMatch pathname  \
 
2068
    FileMatch dirname   - file is accepted if any match
 
2069
    FileMatch filename  /</pre>
 
2070
<p>otherwise    </p>
 
2071
<pre class="pre-section">    IndexOnly - file is checked for the correct file extension
 
2072
 
 
2073
    FileRules pathname  \
 
2074
    FileRules dirname   - file is rejected if any match
 
2075
    FileRules filename  /</pre>
 
2076
<p>finally, the file is indexed.</p>
 
2077
<p>Files (not directories) listed with <code>IndexDir</code> or <code>-i</code> are processed in a
 
2078
similar way:</p>
 
2079
<pre class="pre-section">    FileMatch pathname  \
 
2080
    FileMatch dirname   - file is accepted if any match
 
2081
    FileMatch filename  /</pre>
 
2082
<p>otherwise, the file is rejected if it doesn't have the correct extension
 
2083
or a FileRules matches.</p>
 
2084
<pre class="pre-section">    IndexOnly - file is checked for the correct file extension
 
2085
 
 
2086
    FileRules pathname  \
 
2087
    FileRules dirname   - file is rejected if any match
 
2088
    FileRules filename  /</pre>
 
2089
<p>Note:  If things are not indexing as you expect, create a directory with some
 
2090
test files and use the <code>-T regex</code> trace option to see how file names are
 
2091
checked.  Start with very simple tests!</p>
 
2092
</li>
 
2093
</ul>
 
2094
 
 
2095
    </div>
 
2096
 
 
2097
    <div class="sub-section">
 
2098
        
 
2099
<h2><a name="directives_for_the_http_access_method_only"></a>Directives for the HTTP Access Method Only</h2>
 
2100
 
 
2101
<p>The HTTP Access method is enabled by the "-S http" switch when indexing.  It works by
 
2102
running a Perl program called SwishSpider which fetches documents from a web server.</p>
 
2103
<p>Only text files (content-type of "text/*") are indexed with the HTTP Access Method.
 
2104
Other document types (e.g. PDF or MSWord) may be indexed as well.  The SwishSpider will
 
2105
attempt to make use of the SWISH::Filter module (included with the Swish-e distribution) to
 
2106
convert documents into a format that Swish-e can index.</p>
 
2107
<p>Note: The -S prog method of spidering (using spider.pl) can be a replacement for the -S http method.
 
2108
It offers more configuration options and better spidering speed.</p>
 
2109
<p>These directives below are available when using the HTTP Access Method of indexing.</p>
 
2110
<ul>
 
2111
<li><a name="item_maxdepth"></a><a name="maxdepth"></a><b>MaxDepth *integer*</b>
 
2112
<p>MaxDepth defines how many links the spider should follow before stopping.
 
2113
A value of 0 configures the spider to traverse all links.  The default
 
2114
is MaxDepth 0.</p>
 
2115
<pre class="pre-section">    MaxDepth 5</pre>
 
2116
<p>Note: The default was changed from 5 to 0 in release 2.4.0</p>
 
2117
</li>
 
2118
<li><a name="item_delay"></a><a name="delay"></a><b>Delay *seconds*</b>
 
2119
<p>The number of seconds to wait between issuing requests to a server.
 
2120
This setting allows for more friendly spidering of remote sites.
 
2121
The default is 5 seconds.</p>
 
2122
<pre class="pre-section">    Delay 1</pre>
 
2123
<p>Note: The default was changed from 60 to 5 seconds in release 2.4.0</p>
 
2124
</li>
 
2125
<li><a name="item_tmpdir"></a><a name="tmpdir"></a><b>TmpDir *path*</b>
 
2126
<p>The location of a writable temp directory on your system.  The HTTP access
 
2127
method tells the Perl helper to place its files in this location, and the <code>-e</code>
 
2128
switch causes Swish-e to use this directory while indexing.  There is no
 
2129
default.</p>
 
2130
<pre class="pre-section">    TmpDir /tmp/swish</pre>
 
2131
<p>If this directory does not exist or is not writable Swish-e will fail
 
2132
with an error during indexing.</p>
 
2133
<p>Note, the environment variables of <code>TMPDIR</code>, <code>TMP</code>, and <code>TEMP</code> (in that
 
2134
order) will <b>override</b> this setting.</p>
 
2135
</li>
 
2136
<li><a name="item_spiderdirectory"></a><a name="spiderdirectory"></a><b>SpiderDirectory *path*</b>
 
2137
<p>The location of the Perl helper script called <i>swishspider</i>.  If you
 
2138
use a relative directory, it is relative to your directory when you run
 
2139
Swish-e, not to the directory that Swish-e is in.
 
2140
The default is the location swishspider was installed.
 
2141
Normally this does not need to be set.</p>
 
2142
<pre class="pre-section">    SpiderDirectory /usr/local/swish</pre>
 
2143
</li>
 
2144
<li><a name="item_equivalentserver"></a><a name="equivalentserver"></a><b>EquivalentServer *server alias*</b>
 
2145
<p>Often times the same site may be referred to by different names.
 
2146
A common example is that often <a href="http://www.some-server.com">http://www.some-server.com</a> and
 
2147
<a href="http://some-server.com">http://some-server.com</a> are the same.  Each line should have a list of
 
2148
all the method/names that should be considered equivalent.  Multiple
 
2149
EquivalentServer directives may be used.  Each directive defines its
 
2150
own set of equivalent servers.</p>
 
2151
<pre class="pre-section">    EquivalentServer http://library.berkeley.edu http://www.lib.berkeley.edu
 
2152
    EquivalentServer http://sunsite.berkeley.edu:2000 http://sunsite.berkeley.edu</pre>
 
2153
</li>
 
2154
</ul>
 
2155
 
 
2156
    </div>
 
2157
 
 
2158
    <div class="sub-section">
 
2159
        
 
2160
<h2><a name="directives_for_the_prog_access_method_only"></a>Directives for the prog Access Method Only</h2>
 
2161
 
 
2162
<p>This section details the directives that are only available for the
 
2163
"prog" document source feature of Swish-e.  The "prog" access method runs
 
2164
an external program that "feeds" documents to Swish-e.  This allows indexing
 
2165
and filtering of documents from any source.</p>
 
2166
<p>See <a href="swish-run.html#item_prog">prog - general purpose access method</a> in the
 
2167
SWISH-RUN man page for more information.</p>
 
2168
<p>A number of example programs for use with the "prog" access method are
 
2169
provided in the <i>prog-bin</i> directory.  Please see those example if you
 
2170
have questions about implementing a "prog" input program.</p>
 
2171
<ul>
 
2172
<li><a name="item_swishprogparameters"></a><a name="swishprogparameters"></a><b>SwishProgParameters *list of parameters*</b>
 
2173
<p>This is a list of parameters that will be sent to the external program
 
2174
when running with the "prog" document source method.</p>
 
2175
<pre class="pre-section">    SwishProgParameters /path/to/config hello there
 
2176
    IndexDir /path/to/program.pl</pre>
 
2177
<p>Then running:</p>
 
2178
<pre class="pre-section">    swish-e -c config -S prog</pre>
 
2179
<p>Swish-e will execute <code>/path/to/program.pl</code> and pass <code>/path/to/config hello
 
2180
there</code> as three command line arguments to the program.  This directive makes it
 
2181
easy to pass settings from the Swish-e configuration file to the external
 
2182
program.</p>
 
2183
<p>For example, the <code>spider.pl</code> program (included in the <code>prog-bin</code> directory)
 
2184
uses the <code>SwishProgParameters</code> to specify what file to read for configuration
 
2185
information.</p>
 
2186
<pre class="pre-section">    SwishProgParameters spider.config
 
2187
    IndexDir ./spider.pl</pre>
 
2188
<p>The <code>spider.pl</code> program also has a default action so you can avoid using a
 
2189
configuration file:</p>
 
2190
<pre class="pre-section">    SwishProgParameters default http://www.swishe.org/ http://some.other.site/
 
2191
    IndexDir ./spider.pl</pre>
 
2192
<p>And the spider program will use default settings for spidering those sites.</p>
 
2193
<p>Swish-e can read documents from standard input, so another way to run an external program
 
2194
with parameters is:</p>
 
2195
<pre class="pre-section">    ./spider.pl spider.conf | ./swish-e -S prog -i stdin</pre>
 
2196
</li>
 
2197
</ul>
 
2198
<p><b>Notes when using MS Windows</b></p>
 
2199
<p>You should use unix style path separators to specify your external program.
 
2200
Swish will convert forward slashes to backslashes before calling the external
 
2201
program.  This is only true for the program name specified with <code>IndexDir</code> or
 
2202
the <code>-i</code> command line option.</p>
 
2203
<p>In addition, Swish-e will make sure the program specified actually exists,
 
2204
which means you need to use the full name of the program.</p>
 
2205
<p>For example, to run the perl spider program <i>spider.pl</i> you would need
 
2206
a Swish-e configuration file such as:</p>
 
2207
<pre class="pre-section">    IndexDir e:/perl/bin/perl.exe
 
2208
    SwishProgParameters prog-bin/spider.pl default http://swish-e.org</pre>
 
2209
<p>and run indexing with the command:</p>
 
2210
<pre class="pre-section">    swish-e -c swish.cfg -S prog -v 9</pre>
 
2211
<p>The <code>IndexDir</code> command tells Swish-e the name of the program to run.  Under
 
2212
unix you can just specify the name of the script, since unix will figure out
 
2213
the program from the first line of the script.</p>
 
2214
<p>The <code>SwishProgParameters</code> are the parameters passed to the program specified
 
2215
by <code>IndexDir</code> (perl.exe in this case).  The first parameter is the perl script
 
2216
to run (<i>prog-bin/spider.pl</i>).  Perl passes the rest of the parameters
 
2217
directly to the perl script.  The second parameter <i>default</i> tells the
 
2218
<i>spider.pl</i> program to use default settings for spidering (or you could
 
2219
specify a spider config file -- see <code>perldoc spider.pl</code> for details), and
 
2220
lastly, the URL is passed into the spider program.</p>
 
2221
 
 
2222
    </div>
 
2223
 
 
2224
    <div class="sub-section">
 
2225
        
 
2226
<h2><a name="document_filter_directives"></a>Document Filter Directives</h2>
 
2227
 
 
2228
<p>Internally, Swish-e knows how to parse only text, HTML, and XML documents.
 
2229
With "filters" you can index other types of documents.  For example,
 
2230
if all your web pages are in gzip format a filter can uncompress these
 
2231
on the fly for indexing.</p>
 
2232
<p>You may wish to read the Swish-e FAQ question on filtering before continuing
 
2233
here.  <a href="swish-faq.html#how_do_i_filter_documents_">How Do I filter documents?</a></p>
 
2234
<p>There are two suggested methods for filtering.</p>
 
2235
 
 
2236
    </div>
 
2237
 
 
2238
    <div class="sub-section">
 
2239
        
 
2240
<h3><a name="filtering_with_swish_filter"></a>Filtering with SWISH::Filter</h3>
 
2241
 
 
2242
<p>The Swish-e distribution includes a Perl module called SWISH::Filter and individual
 
2243
filters located in the <i>filters</i> directory.  This system uses plug-in filters to
 
2244
extend the types of documents that Swish-e can index.  The plug-in filters do not
 
2245
actually do the filtering, but rather provide a standard interface for accessing programs that
 
2246
can filter or convert documents.  The programs that do the filtering are not part of
 
2247
the Swish-e distribution; they must be downloaded and installed separately.</p>
 
2248
<p>The advantage of this method is that new filtering methods can be installed easily.</p>
 
2249
<p>This system is designed to work with the -S http and -prog methods, but may
 
2250
also be used with the <code>FileFilter</code> feature and -S fs indexing method.  See
 
2251
<i>$prefix/share/doc/swish-e/examples/filter-bin/swish_filter.pl</i> for an
 
2252
example.</p>
 
2253
<p>See the <i>filters/README</i> file for more information.</p>
 
2254
 
 
2255
    </div>
 
2256
 
 
2257
    <div class="sub-section">
 
2258
        
 
2259
<h3><a name="filtering_with_the_filefilter_feature"></a>Filtering with the FileFilter feature</h3>
 
2260
 
 
2261
<p>A filter is an external program that Swish-e executes while processing
 
2262
a document of a given type.  Swish-e will execute the filter program
 
2263
for each file that matches the file suffix (extension) set in the
 
2264
<b>FileFilter</b> or <b>FileFilterMatch</b> directives.  <b>FileFilterMatch</b>
 
2265
matches using regular expressions and is described below.</p>
 
2266
<p>Filters may be used with any type of input method (i.e. -S fs, -S http, or -S prog).
 
2267
But because</p>
 
2268
<p>Swish-e calls the external program passing as <b>default</b> arguments:</p>
 
2269
<ul>
 
2270
<li><a name="item__0"></a><a name="_0"></a><b>$0 </b>
 
2271
<p>the name of the filter program</p>
 
2272
</li>
 
2273
<li><a name="item__1"></a><a name="_1"></a><b>$1</b>
 
2274
<p>the physical path name of the file to read.  This may be a temporary
 
2275
file location if indexing by the http method.</p>
 
2276
</li>
 
2277
<li><a name="item__2"></a><a name="_2"></a><b>$2</b>
 
2278
<p>When indexing under the file system this will be the same as $1 (the
 
2279
path to the source file), but when indexing under the http method this
 
2280
will be the URL of the source document.</p>
 
2281
</li>
 
2282
</ul>
 
2283
<p>Swish-e can also pass other parameters to the filter program.  These
 
2284
parameters can be defined using the <b>FileFilter</b> or <b>FileFilterMatch</b>
 
2285
directives.  See Filter Options below.</p>
 
2286
<p>The filter program must open the file, process its contents, and return
 
2287
it to Swish-e by printing to STDOUT.</p>
 
2288
<p>Note that this can add a significant amount of time to the indexing
 
2289
process if your external program is a perl or shell script.  If you
 
2290
have many files to filter you should consider writing your filter in C
 
2291
instead of a shell or perl script, or using the "prog" Access Method
 
2292
along with SWISH::Filter.</p>
 
2293
<ul>
 
2294
<li><a name="item_filterdir"></a><a name="filterdir"></a><b>FilterDir  *path-to-directory*</b>
 
2295
<p>Deprecated.</p>
 
2296
<p>This is the path to a directory where the filter programs are stored.
 
2297
Swish-e looks in this directory to find the filter specified in the
 
2298
<b>FileFilter</b> directive.</p>
 
2299
<p>This directive is not needed if the filter program can be found in
 
2300
your system's path.  Even if your filter is not in your system's path
 
2301
you can specify the full path to the filter in the FileFilter or
 
2302
FileFilterMatch directives.</p>
 
2303
<p>Example:</p>
 
2304
<pre class="pre-section">    FilterDir /usr/local/swish/filters</pre>
 
2305
</li>
 
2306
<li><a name="item_filefilter"></a><a name="filefilter"></a><b>FileFilter   *suffix*   "filter-prog"   ["filter-options"]</b>
 
2307
<p>This maps file suffix (extension) to a filter program.  If <i>filter-prog</i>
 
2308
starts with a directory delimiter (absolute path), Swish-e doesn't use
 
2309
the FilterDir settings, but uses the given <i>filter-prog</i> path directly.</p>
 
2310
<p>On systems that have a working fork(2) system call the filter program
 
2311
is run by forking swish then executing the filter.  This mean the shell
 
2312
is not used for running the filter and no arguments are passed through the
 
2313
shell.</p>
 
2314
<p>On other systems (e.g. Windows) the arguments are double-quoted and
 
2315
popen(3) is used to run the program.  This does pass argument though
 
2316
the shell and may be a security concern depending on the abilities of
 
2317
the shell.</p>
 
2318
<p>Filter options:</p>
 
2319
<p>Filter options are a string passed as arguments to the <i>filter-prog</i>.
 
2320
Filter options can contain variables, replaced by Swish-e.  If you omit
 
2321
<i>filter-options</i> Swish-e will use default parameters for the options
 
2322
listed above.</p>
 
2323
<pre class="pre-section">    Default:      %p %P
 
2324
    Which means:  pass   "workfile path" and "documentfile path" to filter.</pre>
 
2325
<p>Variables in filter options:</p>
 
2326
<pre class="pre-section">    %%   =  %
 
2327
    %P   =  Full document pathname (e.g. URL, or path on filesystem)  
 
2328
    %p   =  Full pathname to work file (maybe a tmpfile or the real document path on filesystem)
 
2329
    %F   =  Filename stripped from full document pathname
 
2330
    %f   =  Filename stripped from "work" pathname
 
2331
    %D   =  Directoryname stripped from full document pathname
 
2332
    %d   =  Directoryname stripped from full "work" pathname</pre>
 
2333
<p>Examples of strings passed:</p>
 
2334
<pre class="pre-section">    %P =  document pathname:  http://myserver/path1/mydoc.txt
 
2335
    %p =  work pathname:      /tmp/tmp.1234.mydoc.txt
 
2336
    %F =     mydoc.txt
 
2337
    %f =     tmp.1234.mydoc.txt
 
2338
    %D =     http://myserver/path1
 
2339
    %d =     /tmp</pre>
 
2340
<p><b>Notes when using MS Windows</b></p>
 
2341
<p>Windows uses double quotes to escape shell metacharacters, so if you need
 
2342
to use quotes then use single quotes around the entire option string.</p>
 
2343
<pre class="pre-section">    FileFiler .mydoc mydocfilter.exe '--title "text with spaces"'</pre>
 
2344
<p>You can specify the filter program using forward slashes (unix style).
 
2345
Swish will convert the slashes to backslashes before running your program.</p>
 
2346
<pre class="pre-section">    FileFilter .mydoc     c:/some/path/mydocfilter.exe  '-d "%d" -example -url "%P" "%f"'</pre>
 
2347
<p>Examples of filters:</p>
 
2348
<pre class="pre-section">    FileFilter .doc       /usr/local/bin/catdoc "-s8859-1 -d8859-1 %p"
 
2349
    FileFilter .pdf       pdftotext   "%p -"
 
2350
    FileFilter .html.gz   gzip  "-c %p"
 
2351
    FileFilter .mydoc     "/some/path/mydocfilter"  "-d %d -example -url %P %f"</pre>
 
2352
<p>The above examples are running a <i>binary</i> filter program.  For more
 
2353
complicated filtering needs you may use a scripting language such as
 
2354
Perl or a shell script.  Here's some examples of calling a shell and
 
2355
perl script:</p>
 
2356
<pre class="pre-section">    FileFilter .pdf       pdf2html.sh
 
2357
    FileFilter .ps        ghostscript-filter.pl</pre>
 
2358
<p>Using a scripting language (or any language that has a large startup cost) can
 
2359
<b>greatly increase the indexing time</b>.  For small indexing jobs, this may not
 
2360
be an issue, but for large collections of files that require processing by a
 
2361
scripting language, you may be better off using the <code>-S prog</code> access method
 
2362
where the script will only be compiled once, instead of for each document.</p>
 
2363
<p>Filters are probably easier to write than a <code>-S prog</code> program.  Which you
 
2364
decide to use depends on your requirements.  Examples of filter scripts can be
 
2365
found in the <i>filter-bin</i> directory, and examples of <code>-S prog</code> programs can
 
2366
be found in the <i>prog-bin</i> directory.</p>
 
2367
</li>
 
2368
<li><a name="item_filefiltermatch"></a><a name="filefiltermatch"></a><b>FileFilterMatch   *filter-prog*   *filter-options*  *regex* [*regex* ...]</b>
 
2369
<p>This is similar to <code>FileMatch</code> except uses regular expressions to match
 
2370
against the file name.  *filter-prog* is the path to the program.  Unlike
 
2371
<code>FileFilter</code> this does <b>not</b> use the <code>FilterDir</code> option.  Also unlike
 
2372
<code>FileFilter</code> you <b>must</b> specify the *filter-options*.</p>
 
2373
<p>Examples:</p>
 
2374
<pre class="pre-section">    FileFilterMatch ./pdftotext "%p -" /\.pdf$/</pre>
 
2375
<p>Note that will also match a file called ".pdf", so you may want to use
 
2376
something that requires a filename that has more than just an extension.
 
2377
For example:</p>
 
2378
<pre class="pre-section">    FileFilterMatch ./pdftotext "%p -" /.\.pdf$/</pre>
 
2379
<p>To specify more than one extension:</p>
 
2380
<pre class="pre-section">    FileFilterMatch ./check_title.pl "%p" /\.html$/  /\.htm$/</pre>
 
2381
<p>Or a few ways to do the same thing:</p>
 
2382
<pre class="pre-section">    FileFilterMatch ./check_title.pl %p /\.(html|html)$/
 
2383
    FileFilterMatch ./check_title.pl %p /\.html?$/</pre>
 
2384
<p>And to ignore case:</p>
 
2385
<pre class="pre-section">    FileFilterMatch ./check_title.pl %p /\.html?$/i</pre>
 
2386
<p>You may also precede an expression with "not" to negate regular expression
 
2387
that follow.  For example, to match files that do not have an extension:</p>
 
2388
<pre class="pre-section">    FileFilterMatch ./convert "%p %P" not /\..+$/</pre>
 
2389
</li>
 
2390
</ul>
 
2391
 
 
2392
    </div>
 
2393
 
 
2394
    <div class="sub-section">
 
2395
        
 
2396
<h1><a name="document_info"></a>Document Info</h1>
 
2397
 
 
2398
<p>$Id: SWISH-CONFIG.pod,v 1.91 2006/10/20 20:18:30 whmoseley Exp $</p>
 
2399
<p>.</p>
 
2400
 
 
2401
    </div>
 
2402
 
 
2403
 
 
2404
 
 
2405
 
 
2406
 
 
2407
 
 
2408
 
 
2409
 
 
2410
 
 
2411
 
 
2412
 
 
2413
 
 
2414
 
 
2415
 
 
2416
 
 
2417
</div>
 
2418
 
 
2419
<!-- ##### Footer ##### -->
 
2420
<!-- noindex -->
 
2421
 
 
2422
<div id="footer">
 
2423
    <span class="doNotPrint">
 
2424
        Swish-e is distributed with <strong>no warranty</strong> under the terms of the <br />
 
2425
        <a href='/license.html'>Swish-e License</a>.<br />
 
2426
        Questions may be posted to the 
 
2427
        <a href="http://swish-e.org/discuss.html" title="email list and list archive">Swish-e Discussion list</a>.
 
2428
    </span>
 
2429
 
 
2430
    <p>
 
2431
    <SCRIPT type='text/javascript' language='JavaScript'
 
2432
             src='http://www.ohloh.net/projects/3196;badge_js'></SCRIPT>
 
2433
    </p>
 
2434
 
 
2435
    <p>
 
2436
        <strong>URI &raquo;</strong> http://swish-e.org/ 
 
2437
        &bull; <strong>Updated &raquo;</strong> Fri, 20 Oct 2006 20:51:46 UTC
 
2438
    </p>
 
2439
</div>
 
2440
<!-- index -->
 
2441
 
 
2442
 
 
2443
 
 
2444
</body>
 
2445
</html>