<<

NAME

OpenILS::QueryParser - basic QueryParser class

SYNOPSIS

use OpenILS::QueryParser; my $QParser = OpenILS::QueryParser->new(%args);

DESCRIPTION

Main entrypoint into the QueryParser functionality.

FUNCTIONS

facet_class_count

    $count = $QParser->facet_class_count();

search_class_count

    $count = $QParser->search_class_count();

filter_count

    $count = $QParser->filter_count();

modifier_count

    $count = $QParser->modifier_count();

custom_data

    $data = $QParser->custom_data($class);

operators

    $operators = $QParser->operators();

Returns hashref of the configured operators.

filters

    $filters = $QParser->filters();

Returns arrayref of the configured filters.

filter_callbacks

    $filter_callbacks = $QParser->filter_callbacks();

Returns hashref of the configured filter callbacks.

modifiers

    $modifiers = $QParser->modifiers();

Returns arrayref of the configured modifiers.

new

    $QParser = OpenILS::QueryParser->new(%args);

Creates a new QueryParser object.

new_plan

    $query_plan = $QParser->new_plan();

Create a new query plan.

add_search_filter

    $QParser->add_search_filter($filter, [$callback]);

Adds a filter with the specified name and an optional callback to the QueryParser configuration.

add_search_modifier

    $QParser->add_search_modifier($modifier);

Adds a modifier with the specified name to the QueryParser configuration.

add_facet_class

    $QParser->add_facet_class($facet_class);

Adds a facet class with the specified name to the QueryParser configuration.

add_search_class

    $QParser->add_search_class($class);

Adds a search class with the specified name to the QueryParser configuration.

add_search_modifier

    $op = $QParser->operator($operator, [$newvalue]);

Retrieves or sets value for the specified operator. Valid operators and their defaults are as follows:

facet_classes

    $classes = $QParser->facet_classes([\@newclasses]);

Returns arrayref of all configured facet classes after optionally replacing configuration.

search_classes

    $classes = $QParser->search_classes([\@newclasses]);

Returns arrayref of all configured search classes after optionally replacing the previous configuration.

add_query_normalizer

    $function = $QParser->add_query_normalizer($class, $field, $func, [\@params]);

query_normalizers

    $normalizers = $QParser->query_normalizers($class, $field);

Returns a list of normalizers associated with the specified search class and field

add_filter_normalizer

    $normalizer = $QParser->add_filter_normalizer($filter, $func, [\@params]);

Adds a normalizer function to the specified filter.

filter_normalizers

    $normalizers = $QParser->filter_normalizers($filter);

Return arrayref of normalizer functions associated with the specified filter.

default_search_class

    $default_class = $QParser->default_search_class([$class]);

Set or return the default search class.

remove_facet_class

    $QParser->remove_facet_class($class);

Remove the specified facet class from the configuration.

remove_search_class

    $QParser->remove_search_class($class);

Remove the specified search class from the configuration.

add_facet_field

    $QParser->add_facet_field($class, $field);

Adds the specified field (and facet class if it doesn't already exist) to the configuration.

facet_fields

    $fields = $QParser->facet_fields($class);

Returns arrayref with list of fields for specified facet class.

add_search_field

    $QParser->add_search_field($class, $field);

Adds the specified field (and facet class if it doesn't already exist) to the configuration.

search_fields

    $fields = $QParser->search_fields();

Returns arrayref with list of configured search fields.

add_search_class_alias

    $QParser->add_search_class_alias($class, $alias);

search_class_aliases

    $aliases = $QParser->search_class_aliases($class);

add_search_field_alias

    $QParser->add_search_field_alias($class, $field, $alias);

search_field_aliases

    $aliases = $QParser->search_field_aliases();

remove_facet_field

    $QParser->remove_facet_field($class, $field);

remove_search_field

    $QParser->remove_search_field($class, $field);

remove_search_field_alias

    $QParser->remove_search_field_alias($class, $field, $alias);

remove_search_class_alias

    $QParser->remove_search_class_alias($class, $alias);

debug

    $debug = $QParser->debug([$debug]);

Return or set whether debugging output is enabled.

query

    $query = $QParser->query([$query]);

Return or set the query.

parse_tree

    $parse_tree = $QParser->parse_tree([$parse_tree]);

Return or set the parse tree associated with the QueryParser.

parse

    $QParser->parse([$query]);

Parse the specified query, or the query already associated with the QueryParser object.

decompose

    ($struct, $remainder) = $QParser->decompose($querystring, [$current_class], [$recursing], [$phrase_helper]);

This routine does the heavy work of parsing the query string recursively. Returns the top level query plan, or the query plan from a lower level plus the portion of the query string that needs to be processed at a higher level.

find_class_index

    $index = $QParser->find_class_index($class, $query);

core_limit

    $limit = $QParser->core_limit([$limit]);

Return and/or set the core_limit.

superpage

    $superpage = $QParser->superpage([$superpage]);

Return and/or set the superpage.

superpage_size

    $size = $QParser->superpage_size([$size]);

Return and/or set the superpage size.

<<