[TR-110] TRECDocnoOutputFormat assumes metadata key is "docno" Created: 30/Mar/10  Updated: 06/May/10  Resolved: 06/May/10

Status: Resolved
Project: Terrier Core
Component/s: .applications
Affects Version/s: 3.0
Fix Version/s: 3.5

Type: Improvement Priority: Minor
Reporter: Craig Macdonald Assignee: Craig Macdonald
Resolution: Fixed  
Labels: None


 Description   
TRECOutputFormat assumes metadata key is "docno"

This is a problem when amother type of collection is used in batch evaluation.

See discussion on http://terrier.org/forum//read.php?3,1418

 Comments   
Comment by Craig Macdonald [ 06/May/10 ]

Here is trivial patch:

Index: src/core/org/terrier/applications/TRECQuerying.java
===================================================================
--- src/core/org/terrier/applications/TRECQuerying.java	(revision 2991)
+++ src/core/org/terrier/applications/TRECQuerying.java	(working copy)
@@ -130,9 +130,12 @@
  * generate a results file should be dumped to a .settings file in conjunction
  * with the .res file. Defaults to true. 
  * 
- * <li><tt>trec.querying.outputformat</tt>- controls class to write the results file. Defaults to
+ * <li><tt>trec.querying.outputformat</tt> - controls class to write the results file. Defaults to
  * TRECQuerying$TRECDocnoOutputFormat.</li> 
  * 
+ * <li><tt>trec.querying.outputformat.docno.meta.key</tt> - for TRECDocnoOutputFormat, defines the
+ * MetaIndex key to use as the docno. Defaults to "docno".
+ * 
  * <li><tt>trec.querying.resultscache</tt> - controls cache to use for query caching. 
  * Defaults to TRECQuerying$NullQueryResultCache</li> 
  * 
@@ -954,7 +957,7 @@
 		public void printResults(final PrintWriter pw, final SearchRequest q,
 				String method, String iteration, int RESULTS_LENGTH) throws IOException {
 			final ResultSet set = q.getResultSet();
-			final String metaIndexDocumentKey = "docno";
+			final String metaIndexDocumentKey = ApplicationSetup.getProperty("trec.querying.outputformat.docno.meta.key", "docno");
 			final double[] scores = set.getScores();
 			if (set.getResultSize() == 0) {
 				logger.warn("No results retrieved for query " + q.getQueryID());
Comment by Craig Macdonald [ 06/May/10 ]

Committed to trunk.

Generated at Mon Dec 11 00:23:21 GMT 2017 using JIRA 7.1.1#71004-sha1:d6b2c0d9b7051e9fb5e4eb8ce177ca56d91d7bd8.