When any query is evaluated, each search keyword in the query is used to derive a list of all news headlines which contain a matching indexed keyword. Every such list is known as a match-list. As seen already, a simple query is comprised of only a single search keyword; therefore, the result of a simple query is nothing more than the match-list derived from the given search keyword. A complex query, however, contains two or more search keywords joined by special characters known as query operators, or operators. When multiple search keywords are given, an equal number of match-lists will be derived during evaluation of the query; query operators are necessary to govern how all of the match-lists should be combined to eventually form only a single match-list as the result of the query. When building and working with queries, however, it is more convenient to think in terms of an abstraction known as a query element. Match-lists are circumstantial, derivative values whereas query elements are a fundamental unit of a query We define a query element to be either simple or compound. A simple query element is composed of a single search keyword specification. A compound query element contains two or more query elements joined by one or more query operators. The number of operators is always one less than the number of elements. (When three or more query elements occur in a compound query element, we refer to that element as a chained query element; such elements are discussed later.) In fact, a complete search query (simple or complex) is always nothing more than a solitary query element; because there is no further operation to be performed on that elementAdvanced Search Concepts and Complex Queries
Every query element (simple or compound) in a search query is ultimately used to derive a single match-list of news stories when the query is evaluated. Simple query elements evaluate directly to a single match-list. For compound query elements, every query operator requires two query elements, one on either side of the operator; after the two query elements have been evaluated to produce a single match-list each, the query operator combines the two match-lists into a new, single match-list. When there are no more operators within the same compound query element, then the match-list resulting from the last-performed operation becomes the value for the entire compound query element.