[Previous: Terrier Components] [Contents] [Next: Configuring Indexing]

Configuring Terrier

Configuring Overview

Terrier is configured overall by a few files, all in the etc/ directory. Some of these contain information specific to various applications, such as collection.spec (indexing). However, the most central two files are terrier.properties and terrier-log.xml. In terrier.properties, you can specify any of the various properties that are defined in Terrier. The Properties documentation page lists a great number of the properties, while the javadoc for any class lists the properties that directly affect the class. The default terrier.properties file is given below:


#default controls for query expansion
querying.postprocesses.order=QueryExpansion
querying.postprocesses.controls=qe:QueryExpansion

#default and allowed controls
querying.default.controls=
querying.allowed.controls=qe,start,end,qemodel

#document tags specification
#for processing the contents of
#the documents, ignoring DOCHDR
TrecDocTags.doctag=DOC
TrecDocTags.idtag=DOCNO
TrecDocTags.skip=DOCHDR

#query tags specification
TrecQueryTags.doctag=TOP
TrecQueryTags.idtag=NUM
TrecQueryTags.process=TOP,NUM,TITLE
TrecQueryTags.skip=DESC,NARR

#stop-words file
stopwords.filename=stopword-list.txt

#the processing stages a term goes through
termpipelines=Stopwords,PorterStemmer

In the terrier.properties file, properties are specified in the format name=value. Comments are lines starting with #.

Scripting Properties

TrecTerrier supports properties specified on the command line. This allows the easy over-riding of properties, even if they are specified in the etc/terrier.properties file. For example, to create an index without using a stemmer, you could use the command line:

[user@machine]$ bin/trec_terrier.sh -i -Dtermpipelines=Stopwords

Aside: When looking for properties, Terrier also checks the System properties provided by Java. This means that you can set a property anywhere within Java code, or on the Java command line.

As another example, you can use shell scripting (e.g. Bash) to run Terrier with many settings for the expansion.terms property of query expansion:

[user@machine]$ for((i=2;i<10;i++)); do 
	bin/trec_terrier.sh -r -q -Dexpansion.terms=$i 
done

Configuring Logging

Terrier uses Log4j for logging. You can control the amount of logging information that Terrier outputs by altering the log4j config in etc/terrier-log.xml. For more information about configuring Log4j, see the Log4j documentation.

[Previous: Terrier Components] [Contents] [Next: Configuring Indexing]