
| Query Language | 
Terrier offers a flexible and powerful query language for searching with phrases, fields, or specifying that terms are required to appear in the retrieved documents. Some examples of queries are the following:
| term1 term2 | retrieves documents that contains 1 or more term1 and term2 (they need not contain both) | 
| term1^2.3 | the weight of term1 is boosted 2.3. | 
| +term1 +term2 | retrieves documents that contain both term1 and term2. | 
| +term1 -term2 | retrieves documents that contain term1 and do not contain term2. | 
| "term1 term2" | retrieves documents where the terms term1 and term2 appear in a phrase. | 
| "term1 term2"~n | retrieves documents where the terms term1 and term2 appear within a distance of n blocks. The order of the terms is not considered. | 
Combinations of the different constructs are possible as well. For example, the query term1 term2 -"term1 term2" would retrieve all the documents that contain at least one of the terms term1 and term2, but not the documents where the phrase "term1 term2" appears.
[Previous: Configuring Retrieval] [Contents] [Next: Evaluation of Experiments]Copyright © 2015 University of Glasgow | All Rights Reserved