XAO::IndexerSupport - utility functions for XAO::Indexer
use XAO::IndexerSupport;
This is a very specific module used by XAO::Indexer internally.
C-optimized variant of finding the intersection of multiple arrays sorted in the same way (all being sub-sets of some master sorted set). Used when finding multiple words search results.
Pure-perl variant of finding the intersection of multiple arrays sorted in the same way (all being sub-sets of some master sorted set). Used when finding multiple words search results.
Not used except for benchmarking.
Clears data from the internal index, but keeps the memory still allocated. Useful if a different ordering of the same data is about to be used.
This is called automatically in template_sort_prepare(), no need to call it manually.
Compares positions of two U32 arguments in the array template_sort_prepare() was called on.
Frees memory occupied by the internal index.
For a given unsigned integer returns its position in the array template_sort_prepare() was called on.
Gets a reference to an array of unsigned integers (U32) and prepares internal index for later sorting of its subsets using this array as a template.
The C routine underneath is optimised for the case of relatively sequential distribution of integers in the array -- meaning that the order can be anything, but they are not randomly distributed over the entire U32 range, they form a couple of clusters instead. This is usually the case with auto-increment database IDs.
Performance wise there is no difference, but it will take much more memory if the distribution is random.
For debugging only -- prints the internal index representation to the standard error.
Takes a reference to an array of integers -- a subset of array earlier given to template_sort_prepare(). Returns a reference to an sorted array.
Values that are not in the template array will be grouped in the end in random order.
Andrew Maltsev <am@xao.com>
XAO::Indexer.
To install XAO::Indexer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XAO::Indexer
CPAN shell
perl -MCPAN -e shell install XAO::Indexer
For more information on module installation, please visit the detailed CPAN module installation guide.