[ 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: 369 lines (11 kb)
Included or required: 1 time
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.

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

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

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

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

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

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).

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

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.

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

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.

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

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.

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