public class TRECQuerying extends AbstractQuerying
In the following, we list the main ways for configuring TRECQuerying, before exhaustively listing the properties that can affect TRECQuerying.
<top> <num> Number 1 </num> <title> Query terms </title> <desc> Description : A sentence about the information need </desc> <narr> Narrative: More sentences about what is relevant or not</narr> </top>If you have a topic files in a different format, you can used a differed QuerySource by setting the property trec.topics.parser. For instance trec.topics.parser=SingleLineTRECQuery should be used for topics where one line is one query. See
TRECQuery
and SingleLineTRECQuery
for more information.
InL2
retrieval model for all runs.
If the trec.model property is specified, then all runs will be made
using that weighting model. You can change this by specifying another
model using the property trec.model. E.g., to use
PL2
, set trec.model=PL2.
Similarly, when query expansion is enabled, the
default query expansion model is Bo1
, controlled by the property
trec.qe.model.
TRECQuery
by default. Subclass the TRECQuery
class and alter this property if
your topics come in a very different format to those of TREC. TRECDocnoOutputFormat
. Alternatives: TRECDocnoOutputFormat
, TRECDocidOutputFormat
, NullOutputFormat
TRECDocnoOutputFormat
, defines the
MetaIndex key to use as the docno. Defaults to "docno".
NullQueryResultCache
Modifier and Type | Class and Description |
---|---|
static class |
TRECQuerying.Command |
AbstractQuerying.AbstractQueryingCommand
Modifier and Type | Field and Description |
---|---|
static String |
BATCHRETRIEVE_COMMAND |
static String |
BATCHRETRIEVE_PROP_PREFIX |
protected String |
defaultQEModel
The name of the query expansion model used.
|
protected static boolean |
DUMP_SETTINGS
Dump the current settings along with the results.
|
protected static String |
ITERATION
A TREC specific output field.
|
protected static org.slf4j.Logger |
logger
The logger used
|
protected String |
method
The method - ie the weighting model and parameters.
|
protected String |
mModel
The name of the matching model that is used for retrieval.
|
protected OutputFormat |
printer
Where results of the stream of queries are output to.
|
protected Manager |
queryingManager
The manager object that handles the queries.
|
protected QuerySource |
querySource
Where the stream of queries is obtained from.
|
protected static Random |
random
random number generator
|
protected static boolean |
removeQueryPeriods |
protected PrintWriter |
resultFile
The file to store the output to.
|
protected OutputStream |
resultFileRaw |
protected static int |
RESULTS_LENGTH
The number of results to output.
|
protected QueryResultCache |
resultsCache
results are obtained a query cache is one is enabled.
|
protected String |
resultsFilename
The filename of the last file results were output to.
|
controls, indexref, matchingCount, matchopQl
Constructor and Description |
---|
TRECQuerying()
Deprecated.
|
TRECQuerying(IndexRef _indexref)
TRECQuerying constructor initialises the specified inverted index, the
lexicon and the document index structures.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the used structures.
|
protected void |
createManager()
Create a querying manager.
|
protected void |
finishedQueries()
After finishing with a batch of queries, close the result file
|
IndexRef |
getIndexRef()
Get the index pointer.
|
Manager |
getManager()
Get the querying manager.
|
protected String |
getNextQueryCounter(String resultsFolder)
Get the sequential number of the next result file in the results folder.
|
protected OutputFormat |
getOutputFormat() |
static QuerySource |
getQueryParser(String parserName)
Get the query parser that is being used.
|
protected String |
getRandomQueryCounter()
Get a random number between 0 and 1000.
|
PrintWriter |
getResultFile(String predefinedName)
Returns a PrintWriter used to store the results.
|
protected QueryResultCache |
getResultsCache()
Obtain the query cache.
|
protected String |
getSequentialQueryCounter(String resultsFolder)
Get the sequential number of the current result file in the results
folder.
|
String |
getTopicsParser() |
protected void |
initSearchRequestModification(String queryId,
SearchRequest srq) |
void |
intialise() |
protected void |
loadIndex()
Loads index(s) from disk.
|
protected void |
preQueryingSearchRequestModification(String queryId,
SearchRequest srq) |
void |
printSettings(SearchRequest default_q,
String[] topicsFiles,
String otherComments)
prints the current settings to a file with the same name as the current
results file.
|
String |
processQueries()
Performs the matching using the specified weighting model from the setup
and possibly a combination of evidence mechanism.
|
String |
processQueries(QuerySource _qs) |
SearchRequest |
processQuery(String queryId,
String query)
According to the given parameters, it sets up the correct matching class
and performs retrieval for the given query.
|
protected void |
processQueryAndWrite(String queryId,
String query)
According to the given parameters, it sets up the correct matching class
and performs retrieval for the given query.
|
void |
setTopicsParser(String topicsParser) |
protected void |
startingBatchOfQueries()
Before starting a batch of queries, this method is called by
processQueries()
|
controls
public static final String BATCHRETRIEVE_COMMAND
public static final String BATCHRETRIEVE_PROP_PREFIX
protected String defaultQEModel
protected static final org.slf4j.Logger logger
protected static boolean removeQueryPeriods
protected static final Random random
protected volatile PrintWriter resultFile
protected OutputStream resultFileRaw
protected String resultsFilename
protected static boolean DUMP_SETTINGS
protected Manager queryingManager
protected String mModel
LocalManager
protected static int RESULTS_LENGTH
protected static String ITERATION
protected String method
protected QuerySource querySource
protected OutputFormat printer
protected QueryResultCache resultsCache
public TRECQuerying()
public TRECQuerying(IndexRef _indexref)
_indexref
- The specified index reference.public void intialise()
protected QueryResultCache getResultsCache()
protected OutputFormat getOutputFormat()
protected void createManager()
AbstractQuerying
createManager
in class AbstractQuerying
protected void loadIndex()
public IndexRef getIndexRef()
public Manager getManager()
public void close()
protected String getNextQueryCounter(String resultsFolder)
resultsFolder
- The path of the results folder.protected String getRandomQueryCounter()
protected String getSequentialQueryCounter(String resultsFolder)
resultsFolder
- The path of the results folder.public PrintWriter getResultFile(String predefinedName)
predefinedName
- java.lang.String a non-standard prefix for the result file.protected void processQueryAndWrite(String queryId, String query)
queryId
- the identifier of the query to process.query
- the query to process.public SearchRequest processQuery(String queryId, String query)
processQuery
in class AbstractQuerying
queryId
- the identifier of the query to process.query
- the query to process.protected void preQueryingSearchRequestModification(String queryId, SearchRequest srq)
protected void initSearchRequestModification(String queryId, SearchRequest srq)
public static QuerySource getQueryParser(String parserName)
public String processQueries()
Queries
Queries are parsed from file, specified by the trec.topics property
(comma delimited)
public String processQueries(QuerySource _qs)
protected void startingBatchOfQueries()
protected void finishedQueries()
public void printSettings(SearchRequest default_q, String[] topicsFiles, String otherComments)
public String getTopicsParser()
public void setTopicsParser(String topicsParser)
Terrier Information Retrieval Platform 5.2. Copyright © 2004-2019, University of Glasgow