swish++(4)

swish++4

Usage

long	num_words;
off_t	word_offset[ num_words ];
long	num_files;
off_t	file_offset[ num_files ];
	word index
	file index

Overview

The index file format used by SWISH++ is as shown above. Every word_offset is an offset into the word index pointing at the first character of a word entry; similarly, every file_offset is an offset into the file index pointing at the first character of a file entry.

The index file is written as it is so that it can be mapped into memory via the mmap(2) Unix system call enabling ``instantaneous'' access.

Word Entries

Every word entry in the word index is of the form:

word0{file-index rank }...0

that is: a null-terminated word followed by one or more file-index/rank integer pairs followed by a null byte. The file-index/rank integers are in ASCII, not binary, since this takes less space. Every integer is followed by a single space character (ASCII 32 decimal). The file-index is an index into the file_offset table.

File Entries

Every file entry in the file index is of the form:

path-name file-size file-title0

that is: the pathname for a file relative to where the indexing was performed (unless absolute paths were used) followed by the file's size in bytes followed by by the file's title followed by a null byte. All the information is in ASCII.

For an HTML file, the title is what is between <TITLE> ... </TITLE> pairs. If a file is not an HTML file, or is but does not have a title, the title is simply the file (not path) name.

Caveat

Generated index files are machine-dependent (size of data types and byte-order).

Releases

Unchanged in 2 releases since Debian 2.0 (Hamm).

  1. 2.0–2.1

Author

Paul J. Lucas <[email protected]>

From swish++ 1.1b3-3 in Debian 2.1 (Slink). Parsed by carta from the page's man source.