diff options
author | Tom N Harris <tnharris@whoopdedo.org> | 2010-11-17 17:02:31 -0500 |
---|---|---|
committer | Tom N Harris <tnharris@whoopdedo.org> | 2010-11-17 17:02:31 -0500 |
commit | 7c2ef4e8d524fb9262c5a08831220f9fb2dc11fe (patch) | |
tree | 675816d1de209d15d6131d8a2f7b43eca10e266f /inc | |
parent | 1c07b9e622d139fa815c955c89569f96342475fb (diff) | |
download | rpg-7c2ef4e8d524fb9262c5a08831220f9fb2dc11fe.tar.gz rpg-7c2ef4e8d524fb9262c5a08831220f9fb2dc11fe.tar.bz2 |
Use a different indexer version when external tokenizer is enabled
Diffstat (limited to 'inc')
-rw-r--r-- | inc/indexer.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/inc/indexer.php b/inc/indexer.php index 1c955a99d..4914c9fc6 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -8,6 +8,9 @@ if(!defined('DOKU_INC')) die('meh.'); +// Version tag used to force rebuild on upgrade +define('INDEXER_VERSION', 2); + // set the minimum token length to use in the index (note, this doesn't apply to numeric tokens) if (!defined('IDX_MINWORDLENGTH')) define('IDX_MINWORDLENGTH',2); @@ -43,6 +46,20 @@ define('IDX_ASIAN3','['. // Hiragana/Katakana (can be two charact define('IDX_ASIAN', '(?:'.IDX_ASIAN1.'|'.IDX_ASIAN2.'|'.IDX_ASIAN3.')'); /** + * 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> + */ +function idx_get_version(){ + global $conf; + if($conf['external_tokenizer']) + return INDEXER_VERSION . '+' . trim($conf['tokenizer_cmd']); + else + return INDEXER_VERSION; +} + +/** * Measure the length of a string. * Differs from strlen in handling of asian characters. * |