SWISH-CONFIG - Configuration File Directives
Swish-e version 2.4.7Table of Contents
- OVERVIEW
-
CONFIGURATION FILE
- Alphabetical Listing of Directives
- Directives that Control Swish
- Administrative Headers Directives
- Document Source Directives
- Document Contents Directives
- Directives for the File Access method only
- Directives for the HTTP Access Method Only
- Directives for the prog Access Method Only
- Document Filter Directives
- Document Info
CONFIGURATION FILE
What files Swish-e indexes and how they are indexed, and where the index is written can be controlled by a configuration file.
The configuration file is a text file composed of comments, blank lines, and configuration directives. The order of the directives is not important. Some directives may be used more than once in the configuration file, while others can only be used once (e.g. additional directives will overwrite preceding directives). Case of the directive is not important -- you may use upper, lower, or mixed case.
Comments are any line that begin with a "#".
# This is a comment
As of 2.4.3 lines may be continued by placing a backslas as the last character on the line:
IgnoreWords \
am \
the \
foo
Directives may take more than one parameter. Enclose single parameters that include whitespace in quotes (single or double). Inside of quotes the backslash escapes the next character.
ReplaceRules append "foo bar" <- define "foo bar" as a single parameter
If you need to include a quote character in the value either use a backslash to escape it, or enclose it in quotes of the other type.
Backslashes also have special meaning in regular expressions.
FileFilterMatch pdftotext "'%p' -" /\.pdf$/
This says that the dot is a real dot (instead of matching any character). If you place the regular expression in quotes then you must use double-backslashes.
FileFilterMatch pdftotext "'%p' -" "/\\.pdf$/"
Swish-e will convert the double backslash into a single backslash before passing the parameter to the regular expression compiler.
Commented example configuration files are included in the conf directory of the Swish-e distribution.
Some command line arguments can override directives specified in the configuration file. Please see also the SWISH-RUN for instructions on running Swish-e, and the SWISH-SEARCH page for information and examples on how to search your index.
The configuration file is specified to Swish-e by the -c switch. For
example,
swish-e -c myconfig.conf
You may also split your directives up into different configuration files. This
allows you to have a master configuration file used for many different indexes,
and smaller configuration files for each separate index. You can specify the
different configuration files when running from the command line with the -c
switch (see SWISH-RUN), or you may include other Configuration
file with the IncludeConfigFile directive below.
Typically, in a configuration file the directives are grouped together in some logical order -- that is, directives that control the source of the documents would be grouped together first, and directives that control how each document is filtered or its words index in another group of directives. (The directives listed below are grouped in this order).
The configuration file directives are listed below in these groups:
-
Administrative Headers Directives -- You may add administrative information to the header of the index file.
-
Document Source Directives -- Directives for selecting the source documents and the location of the index file.
-
Document Contents Directives -- Directives that control how a document content is indexed.
-
Directives for the File Access method only -- These directives are only applicable to the File Access indexing method.
-
Directives for the HTTP Access Method Only -- Likewise, these only apply to the HTTP Access method.
-
Directives for the prog Access Method Only -- These only apply to the prog Access method.
-
Document Filter Directives -- This is a special section that describes using document filters with Swish-e.
Alphabetical Listing of Directives
-
AbsoluteLinks [yes|NO]
-
BeginCharacters *string of characters*
-
BumpPositionCounterCharacters *string*
-
Buzzwords [*list of buzzwords*|File: path]
-
CompressPositions [yes|NO]
-
ConvertHTMLEntities [YES|no]
-
DefaultContents [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*]
-
Delay *seconds*
-
DontBumpPositionOnEndTags *list of names*
-
DontBumpPositionOnStartTags *list of names*
-
EnableAltSearchSyntax [yes|NO]
-
EndCharacters *string of characters*
-
EquivalentServer *server alias*
-
ExtractPath *metaname* [replace|remove|prepend|append|regex]
-
FileFilter *suffix* *program* [options]
-
FileFilterMatch *program* *options* *regex* [*regex* ...]
-
FileInfoCompression [yes|NO]
-
FileMatch [contains|is|regex] *regular expression*
-
FileRules [contains|is|regex] *regular expression*
-
FuzzyIndexingMode [NONE|Stemming|Soundex|Metaphone|DoubleMetaphone]
-
FollowSymLinks [yes|NO]
-
HTMLLinksMetaName *metaname*
-
IgnoreFirstChar *string of characters*
-
IgnoreLastChar *string of characters*
-
IgnoreLimit *integer integer*
-
IgnoreMetaTags *list of names*
-
IgnoreNumberChars *list of characters*
-
IgnoreTotalWordCountWhenRanking [YES|no]
-
IgnoreWords [*list of stop words*|File: path]
-
ImageLinksMetaName *metaname*
-
IndexAdmin *text*
-
IndexAltTagMetaName *tagname*|as-text
-
IndexComments [yes|NO]
-
IndexContents [TXT|HTML|XML|TXT2|HTML2|XML2|TXT*|HTML*|XML*] *file extensions*
-
IndexDescription *text*
-
IndexDir [URL|directories or files]
-
IndexFile *path*
-
IndexName *text*
-
IndexOnly *list of file suffixes*
-
IndexPointer *text*
-
IndexReport [0|1|2|3]
-
MaxDepth *integer*
-
MaxWordLimit *integer*
-
MetaNameAlias *meta name* *list of aliases*
-
MetaNames *list of names*
-
MinWordLimit *integer*
-
NoContents *list of file suffixes*
-
obeyRobotsNoIndex [yes|NO]
-
ParserWarnLevel [0|1|2|3]
-
PreSortedIndex *list of property names*
-
PropCompressionLevel [0-9]
-
PropertyNameAlias *property name* *list of aliases*
-
PropertyNames *list of meta names*
-
PropertyNamesCompareCase *list of meta names*
-
PropertyNamesIgnoreCase *list of meta names*
-
PropertyNamesNoStripChars *list of meta names*
-
PropertyNamesDate *list of meta names*
-
PropertyNamesNumeric *list of meta names*
-
PropertyNamesMaxLength integer *list of meta names*
-
PropertyNamesSortKeyLength integer *list of meta names*
-
ReplaceRules [replace|remove|prepend|append|regex]
-
ResultExtFormatName name -x format string
-
SpiderDirectory *path*
-
StoreDescription [XML <tag>|HTML <meta>|TXT size]
-
"SwishProgParameters *list of parameters*
-
SwishSearchDefaultRule [<AND-WORD>|<or-word>]
-
TmpDir *path*
-
TranslateCharacters [*string1 string2*|:ascii7:]
-
TruncateDocSize *number of characters*
-
UndefinedMetaTags [error|ignore|INDEX|auto]
-
UndefinedXMLAttributes [DISABLE|error|ignore|index|auto]
-
UseStemming [yes|NO]
-
UseSoundex [yes|NO]
-
UseWords [*list of words*|File: path]
-
WordCharacters *string of characters*
-
XMLClassAttributes *list of XML attribute names*
Directives that Control Swish
These configuration directives control the general behavior of Swish-e.
- IncludeConfigFile *path to config file*
This directive can be used to include configuration directives located in another file.
IncludeConfigFile /usr/local/swish/conf/site_config.config
- IndexReport [0|1|2|3]
This is how detailed you want reporting while indexing. You can specify numbers 0 to 3. 0 is totally silent, 3 is the most verbose. The default is 1.
This may be overridden from the command line via the
-vswitch (see SWISH-RUN). - ParserWarnLevel [0|1|2|3]
Sets the error level when using the libxml2 parser for XML and HTML. libxml2 will point out structural errors in your documents.
0 = no report 1 = fatal errors 2 = errors 3 = warningsCurrently (as of 2.4.4 - early 2005) libxml2 only reports errors at level 2. The default as of 2.4.4 is "2" which should report any errors that might indicate a problem parsing a document.
The exception to this is UTF-8 to Latin-1 conversion errors are reported at level 3 (changed from 1 in 2.4.4). Although these errors indicate a problem indexing text, they are only reported at level 3 because they can be very common.
It is recommended that you index at ParserWarnLevel 3 when first starting out to see what errors and warnings are reported. Then reduce the level when you understand what documents are causing parsing problems and why.
- IndexFile *path*
Index file specifies the location of the generated index file. If not specified, Swish-e will create the file index.swish-e in the current directory.
IndexFile /usr/local/swish/site.index
- obeyRobotsNoIndex [yes|NO]
When enabled, Swish-e will not index any HTML file that contains:
<meta name="robots" content="noindex">
The default is to ignore these meta tags and index the document. This tag is described at http://www.robotstxt.org/wc/exclusion.html.
Note: This feature is only available with the libxml2 HTML parser.
Also, if you are using the libxml2 parser (HTML2 and XML2) then you can use the following comments in your documents to prevent indexing:
<!-- SwishCommand noindex --> <!-- SwishCommand index -->and/or these may be used also:
<!-- noindex --> <!-- index -->For example, these are very helpful to prevent indexing of common headers, footers, and menus.
NOTE: This following items are currently not available. These items require Swish-e to parse the configuration file while searching.
- EnableAltSearchSyntax [yes|NO]
NOTE: This following item is currently not available.
Enable alternate search syntax. Allows the usage of a basic "Altavista(c)", "Lycos(c)", etc. like search syntax. This means a search query can contain "+" and "-" as syntax parameter.
Example:
swish-e -w "+word1 +word2 -word3 word4 word5" "+" = following word has to be in all found documents "-" = following word may not be in any document found " " = following word will be searched in documents - SwishSearhOperators <: same sitr, and will actually spidered and indexed
as:
http://www.mysite.edu/path/to/file.html
Note: This should probably be called same_host_port because it compares the URI
host:portagainst the list of host names inSwish-e rg"> ish_debuSwis-config h Candidaend of indns shousearchsyis na title="Sme">Resul ay O]
If it still isn't working as you expect, try to reduce the test document to a very small example. This wil want this ler configuration filea vrror iemove__words | leduc s leis lwhen spie -i testdoc.htves, comarch lire>
class itemO
Fetches the next result from the list of results. Returns undef if no more results are available. $result is an object blessed into the SWISH::API::Result class.