[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/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

  idx_get_version()
  wordlen()
  idx_get_indexer()
  idx_addPage()
  idx_lookup()
  idx_tokenizer()
  idx_getIndex()
  idx_listIndexLengths()
  idx_indexLengths()
  idx_cleanName()

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.

triggers: INDEXER_VERSION_GET
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.

param: string $w
return: int
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

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

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

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

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

param: string $idx
param: string $suffix
return: array
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.

param: array|int $filter
return: array
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.

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