internal package Foswiki::Query::QueryAlgorithms

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::QueryAlgorithms

Interface to query algorithms (documentation only, this class does nothing). Implementations of this interface are found in Foswiki/Store/QueryAlgorithms.

The contract with query algorithms is specified by this interface description, plus the 'query' unit tests in Fn_SEARCH.

StaticMethod query( $query, $web, $inputTopicSet, $session, $options ) → $infoCache

  • $query - A Foswiki::Query::Node object
  • $web - name of the web being searched
  • $inputTopicSet - iterator over names of topics in that web to search
  • $session - reference to the store object
  • $options - hash of requested options
This is the top-level interface to a query algorithm. A store module can call this method to start the 'hard work' query process. That process will call back to the getField method in this module to evaluate leaf data in the store.

To monitor the evaluation process, use the MONITOR_EVAL setting in Foswiki::Query::Node

StaticMethod getField($class, $node, $data, $field ) → $result

  • $class is this package
  • $node is the query node
  • $data is the indexed object
  • $field is the scalar being used to index the object
getField is used by the query evaluation code in Foswiki::Query::Node to get information about a leaf node, or 'field'. A field can be a name, or a literal, and the information it refers to can be a scalar, a reference to a hash, or a reference to an array. The exact interpretation of fields is context-dependant, according to reasonably complex rules best documented by the Fn_SEARCH unit test and QuerySearch.

StaticMethod getRefTopic($class, $relativeTo, $web, $topic) → $topic

  • $class is this package
  • $relativeTo is a pointer into the data structure of this module where the ref is relative to; for example, in the expression "other/'Web.Topic'" then $relativeTo is other.
  • $web the web; Web in the above example
  • $topic the topic; Topic in the above example
This method supports the Foswiki::Query::OP_ref operator by abstracting the loading of a topic referred to using the '/' operator. For more information on the '/' operator, see QuerySearch.

Topic revision: r1 - 19 Apr 2011, ProjectContributor
This site is powered by FoswikiCopyright © CC-BY-SA by the contributing authors. All material on this collaboration platform is copyrighted under CC-BY-SA by the contributing authors unless otherwise noted.
Ideas, requests, problems regarding Foswiki? Send feedback