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

Bringing filenames when running batchretrieve on a SimpleFileCollection

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      Currently, I have a collection of files and I used SimpleFileCollection while indexing them. But when I run batchretrieve on a set of topics, I want to see the filenames printed in the result file but they are not shown. Now, I just see a serial number starting from 0. For example.

      1 Q0 0 11.50097265099281 DPH
      1 Q0 1 11.469235918479812 DPH
      1 Q0 2 11.28699064708556 DPH
      ....

      But when I write a query using interactive search. I can see the filenames in the result. For example.

      0 <filename> 11.50097265099281
      1 <another-filename> 11.469235918479812
      2 <yet-another-filename> 11.28699064708556


      So my question, how can I see the filenames when I run batchretrieve?

        Attachments

          Activity

          Hide
          craigm Craig Macdonald added a comment -

          Hi Mahmoud,

          The property
          trec.querying.outputformat.docno.meta.key
          should do what you want.

          See https://github.com/terrier-org/terrier-core/blob/5.x/modules/batch-retrieval/src/main/java/org/terrier/structures/outputformat/TRECDocnoOutputFormat.java

          Otherwise, its fairly easy to make a new OutputFormat that gives the format you want.

          Kind regards

          Craig

          Show
          craigm Craig Macdonald added a comment - Hi Mahmoud, The property trec.querying.outputformat.docno.meta.key should do what you want. See https://github.com/terrier-org/terrier-core/blob/5.x/modules/batch-retrieval/src/main/java/org/terrier/structures/outputformat/TRECDocnoOutputFormat.java Otherwise, its fairly easy to make a new OutputFormat that gives the format you want. Kind regards Craig
          Hide
          mfayoub Mahmoud F. Sayed added a comment -

          Yes that worked for me by setting this property to 'filename'.

          Thanks for your reply Prof. Macdonald!

          Show
          mfayoub Mahmoud F. Sayed added a comment - Yes that worked for me by setting this property to 'filename'. Thanks for your reply Prof. Macdonald!
          Hide
          craigm Craig Macdonald added a comment -

          Question - where would you have expected to find this in the documentation?

          Craig

          Show
          craigm Craig Macdonald added a comment - Question - where would you have expected to find this in the documentation? Craig
          Hide
          mfayoub Mahmoud F. Sayed added a comment -

          I would say in http://ir.dcs.gla.ac.uk/wiki/Terrier/CollectionOfFiles

          In that link, it helped me when I first tried to index a SimpleFileCollection.

          Show
          mfayoub Mahmoud F. Sayed added a comment - I would say in http://ir.dcs.gla.ac.uk/wiki/Terrier/CollectionOfFiles In that link, it helped me when I first tried to index a SimpleFileCollection.
          Hide
          craigm Craig Macdonald added a comment -

          Great. I have updated that wiki page. We're going to migrate these wiki pages to Github soon.

          Show
          craigm Craig Macdonald added a comment - Great. I have updated that wiki page. We're going to migrate these wiki pages to Github soon.
          Hide
          mfayoub Mahmoud F. Sayed added a comment -

          Great. Thanks for the update!

          Show
          mfayoub Mahmoud F. Sayed added a comment - Great. Thanks for the update!

            People

            • Assignee:
              craigm Craig Macdonald
              Reporter:
              mfayoub Mahmoud F. Sayed
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: