Seimas of the Republic of Lithuania

HELP: Query Expressions

A query expression defines the search criteria for retrieving documents using this system. A query expression consists of query terms (words and phrases) and other components such as operators and special characters which allow users to specify exactly which documents are retrieved.

Query Terms

Query terms can consist of words and phrases.

Words and Phrases

The words in a query expression are the individual tokens on which the query expression operators perform an action. If multiple words are contained in a query expression, separated only by blank spaces (no operators), the string of words is considered a phrase and the entire string is searched for during a query.

Query Expression Components

In addition to query terms, a query expression may contain any or all of the following components:
Component Purpose
Logical Operators Define the relationships between the terms in a query expression and specify the output returned by the query.
Wildcard Characters Expand query terms using pattern matching.
Grouping Characters Group terms and operators in a query expression.

Logical Operators

Logical operators combine the terms in a query expression. All single words and phrases may be combined with logical operators. When query terms are combined, the number of spaces around the logical operator is not significant.

Operands can be any query terms, as well as other operators.

AND Operator

Use the AND operator to search for documents that contain at least one occurrence of each of the query terms. For example, to obtain all the documents that contain the terms seimas and republic and lithuania, issue the following query: 'seimas & republic & lithuania'

OR Operator

Use the OR operator to search for documents that contain at least one occurrence of any of the query terms. For example, to obtain the documents that contain the term seimas or the term parliament, use the following expression: 'seimas | parliament'

NOT Operator

Use the NOT operator to search for documents that contain one query term and not another. For example, to obtain the documents that contain the term parliament but not government, use the following expression: 'parliament ~ government'

Similarly, to obtain the documents that contain the term transportation but not automobiles or trains, use the following expression: 'transportation not (automobiles or trains)'

Equivalence Operator

Use the equivalence operator to specify an acceptable substitution for a word in a search. For example, if you want all the documents that contain the phrase parliament issues the law or seimas issues the law, you can write: 'parliament=seimas issues the law'
Precedence of Equivalence Operator
The equivalence operator has higher precedence that all other operators.
Operator Syntax Description
AND term1&term2
term1 and term2
Returns documents that contain term1 and term2. All query terms must occur.
OR term1|term2
term1 or term2
Returns documents that contain term1 or term2. At least one term must exist.
NOT term1~term2
term1 not term2
Returns documents that contain term1 and not term2
EQUIVALENCE term1=term2
term1 equiv term2
Specifies that term2 is an acceptable substitution for term1.

NEAR Operator

Use the NEAR operator to search for documents that contain both of the query terms and they are near each other - within 100 words. For example, to obtain the documents that contain the terms parliamentary and sitting situated near each other, use the following expression: 'parliamentary ; sitting' or 'parliamentary and sitting'. The result does not depend on the order of query terms in NEAR expression.

Wildcard Characters

Wildcard characters can be used in query expressions to expand word searches into pattern searches. The wildcard characters are:
Wildcard Character Description
% The percent wildcard specifies that any characters can appear in multiple positions represented by the wildcard.
* The asterisk wildcard has the same meaning as the percent wildcard.
Note: To expand the wildcard query, system uses the word list for the text or title and rewrites the query with these terms. When your wildcard query expands to a number of terms greater than the maximum allowed in a query, system returns an error "query too complex".

Grouping Characters

The grouping characters control operator precedence by grouping query terms and operators in a query expression. The grouping characters are: The beginning of a group of terms and operators is indicated by an open character from one of the sets of grouping characters. The ending of a group is indicated by the occurrence of the appropriate close character for the open character that started the group. Between the two characters, other groups may occur.

For example, the open parenthesis indicates the beginning of a group. The first close parenthesis encountered is the end of the group. Any open parentheses encountered before the close parenthesis indicate nested groups.

Operator Precedence

Operator precedence is the order in which the components of a query expression are evaluated.

In all cases, query expressions are evaluated in order from left to right according to the precedence of their operators. Operators with higher precedence are applied first. Operators of equal precedence are applied in order of their appearance in the expression from left to right.

  1. EQUIV =
  2. NOT ~
  3. AND &
  4. OR |

© Office of Seimas of the Republic of Lithuania.
Comments and suggestions