Provides an efficient probability index filter for fields
The monogram index is used by the relationfilter function.
It is better suited than the bloom filter for short length data.
3.8.4 monogram uses more exensive digrams
swOpenMonogram()
Opens the monogram database.swClearMonogram()
Resets the monogram database.swIndexMonogram($numberofrevisions=,$continue=false)
Indexes 1000 revisions for the monogram index.
For each revision, the field values are indexed.
A value is indexed as bitmap of each character (monogram) in url syntax a-z0-9- (uncompressed 36bit per revision)
The data is stored in a Sqlite3 database.swGetMonogramBitmapFromTerm($field,$term)
Returns an array with 0 with all probable revisions for a given field and term and 1 the checked bitmap.
Finds for each characters all revisions that have the character.
All results are logically combined as and-operation.
The construction of the index is inherently independent of the position of the characters.
This makes it suited for any substring searches. The search finds all positives.
The downsize is that it may also find false positives, the longer the indexed value is.s
This makes the monogram filter suited for field search, the bloom filter is still useful for longer text.swMonogramFields()
Returns a list of fields (key) indexed with monogram as well as the letters present (value)
swBitmap, swExpressionError, swWiki
echotime, swDbaFetch, swDbaFirstKey, swDbaNextKey, swDbaOpen, swDbaReplace, swDbaSync, swGetLastRevision, swNameURL, swOpenMonogram
$db, $swMaxSearchTime, $swMemoryLimit, $swMonogramIndex, $swMonogramIndexWritable, $swOvertime, $swRoot
$bitmap, $bitmaps, $checkedbitmap, $counter, $field, $fieldlist, $found, $keys, $list, $notchecked, $nowtime, $numberofrevisions, $overtime, $path, $record, $result, $starttime, $term
Short variables: $bc, $bm, $bm0, $c, $ci, $dur, $i, $k, $key, $ks, $l, $ns, $s, $v, $vs, $vu
array, exception, file, php, str, string, time, variable