Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-110

TRECDocnoOutputFormat assumes metadata key is "docno"

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.5
    • Component/s: .applications
    • 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

        Attachments

          Activity

          craigm Craig Macdonald created issue -
          craigm Craig Macdonald made changes -
          Field Original Value New Value
          Summary TRECOutputFormat assumes metadata key is "docno" TRECDocnoOutputFormat assumes metadata key is "docno"
          Hide
          craigm Craig Macdonald added a comment -

          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());
          
          Show
          craigm Craig Macdonald added a comment - 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());
          Hide
          craigm Craig Macdonald added a comment -

          Committed to trunk.

          Show
          craigm Craig Macdonald added a comment - Committed to trunk.
          craigm Craig Macdonald made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 3.1 [ 10040 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              craigm Craig Macdonald
              Reporter:
              craigm Craig Macdonald
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: