[ Index ]

PHP Cross Reference of DokuWiki




/inc/ -> indexer.php (summary)

Functions to create the fulltext search index

Author: Andreas Gohr
Author: Tom N Harris
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
File Size: 382 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 10 functions


Functions that are not part of a class:

idx_get_version()   X-Ref
Version of the indexer taking into consideration the external tokenizer.
The indexer is only compatible with data written by the same version.

author: Tom N Harris <tnharris@whoopdedo.org>
author: Michael Hamann <michael@content-space.de>
return: int|string

wordlen($w)   X-Ref
Measure the length of a string.
Differs from strlen in handling of asian characters.

author: Tom N Harris <tnharris@whoopdedo.org>
return: int
param: string $w

idx_get_indexer()   X-Ref
Create an instance of the indexer.

author: Tom N Harris <tnharris@whoopdedo.org>
return: Indexer    an Indexer

idx_addPage($page, $verbose = false, $force = false)   X-Ref
No description

idx_lookup(&$words)   X-Ref
Find tokens in the fulltext index

Takes an array of words and will return a list of matching
pages for each one.

Important: No ACL checking is done here! All results are
returned, regardless of permissions

return: array             list of pages found, associated with the search terms
param: array      $words  list of words to search for

idx_tokenizer($string, $wc = false)   X-Ref
Split a string into tokens

return: array
param: string $string
param: bool $wc

idx_getIndex($idx, $suffix)   X-Ref
Read the list of words in an index (if it exists).

author: Tom N Harris <tnharris@whoopdedo.org>
return: array
param: string $idx
param: string $suffix

idx_listIndexLengths()   X-Ref
Get the list of lengths indexed in the wiki.

Read the index directory or a cache file and returns
a sorted array of lengths of the words used in the wiki.

author: YoBoY <yoboy.leguesh@gmail.com>
return: array

idx_indexLengths($filter)   X-Ref
Get the word lengths that have been indexed.

Reads the index directory and returns an array of lengths
that there are indices for.

author: YoBoY <yoboy.leguesh@gmail.com>
return: array
param: array|int $filter

idx_cleanName($name)   X-Ref
Clean a name of a key for use as a file name.

Romanizes non-latin characters, then strips away anything that's
not a letter, number, or underscore.

author: Tom N Harris <tnharris@whoopdedo.org>
return: string
param: string $name