Text::Query::BuildSQL - Base class for SQL query builders
package Text::Query::BuildSQLsqldb; use Text::Query::BuildSQL; use vars qw(@ISA); @ISA = qw(Text::Query::BuildSQL);
Defines all the
build_* functions to build a syntax tree. The tree nodes are [ operator scope operand operand... ]. The
build_final_expression function translate the syntax tree in a
where clause using the
resolve method. If the scope of the search is not specified (simple query or advanced query without scope operator), the scope is set to the list of comma separated fields provided by the
-fields_searched option. The resulting
where clause is placed in the
select order provided with the
-select option, if any.
The string enclosed in single quotes must match exactly. The <string> token stands for an arbitrary string. A description enclosed in [something ...] means repeated 0 or N times.
expr: 'or' scope expr [expr ...] 'and' scope expr [expr ...] 'not' scope expr 'near' scope expr_literal expr_literal 'forbiden' scope expr_literal [expr_literal ...] 'mandatory' scope expr_literal [expr_literal ...] 'optional' scope expr_literal [expr_literal ...] 'literal' scope <string> expr_literal: literal scope <string> scope: <string>
- resolve(, Q1)
whereclause string corresponding to the
- sortplusminus(, Q1)
forbidensyntactic nodes to their boolean equivalents. If it
has_relevancereturns false and there is at least one
mandatoryword, the first
mandatoryword is added to the list of
Returns true if relevance ranking is possible, false if not. It is used by the
sortplusminusfunction. Returns false by default.
If relevance ranking is not possible, the semantic of the simple search is slighthly modified. When asking for
+a b cit shows all the documents containing
The normal behaviour is to return all the documents containing
aand to sort them to show first those containing (
c). When relevance ranking is not available the
csearch terms are therefore useless. That is why we decided to change the semantic of the query if no relevance ranking is available.
- -select STRING
If provided the string returned by
__WHERE__tag with the
wherestring generated by the
resolvefunction. The substituted string is the return value of the
If not set the return value of the
build_final_expressionis the result of the
- -fields_searched FIELDS_LIST
FIELDS_LISTis a list of comma separated field names. It is used as the default scope if no scope is provided in the query string. The
croakif this option is not provided and no scope operator were used.
Loic Dachary (email@example.com)