internal package Foswiki::Query::HoistREs

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

internal package Foswiki::Query::HoistREs

Static functions to extract regular expressions from queries. The REs can be used in caching stores that use the Foswiki standard inline meta-data representation to pre-filter topic lists for more efficient query matching.

See Store/QueryAlgorithms/BruteForce.pm for an example of usage.

ObjectMethod collatedHoist($query) → $hasRef

retuns a hashRef where the keys are the node's (web|name|text) for which we have hoisted regex's and who's values are a list of regex's

and also keys of "(web|name|text)_source" where the list contains the non-regex version (ie what the user entered)

ObjectMethod hoist($query) → @hashRefs

Extract useful filter REs from the given query. The list returned is a list of filter expressions that can be used with a cache search to refine the list of topics. The full query should still be applied to topics that remain after the filter match has been applied; this is purely an optimisation.

each hash in the array contains the node the regex is for, and a regex string

{ node => 'web|name|text', regex => 'Web.*' source => 'Web*' }

Topic revision: r1 - 19 Apr 2011, ProjectContributor
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding FAIR Wiki? Send feedback