org.terrier.structures
Interface MetaIndex

All Superinterfaces:
Closeable
All Known Implementing Classes:
CompressingMetaIndex

public interface MetaIndex
extends Closeable

Interface for document metadata. Metadata is stored compressed on disk. Document offsets are stored in memory. Use getItem() methods to get metadata for a given document. Use getDocument() method to determine docid for a given metadata value.

Examples:

 MetaIndex meta = index.getMetaIndex();
 //get docno of document with id 10
 String docno = meta.getItem("docno", 10);
 //get URL of document with id 100
 String url = meta.getItem("url", 100);
 //get docid of documet with url http://www.bbc.co.uk/
 int docid = meta.getDocument("url", "http://www.bbc.co.uk/");
 

Since:
3.0
Author:
Craig Macdonald

Method Summary
 String[] getAllItems(int docid)
          Obtain all metadata for specified document.
 int getDocument(String key, String value)
          Obtain docid where document has specified metadata value in the specified type.
 String getItem(String Key, int docid)
          Obtain metadata of specified type for specified document.
 String[] getItems(String[] keys, int docid)
          Obtain metadata of specified types for specified document.
 String[][] getItems(String[] Key, int[] docids)
          Obtain metadata of specified types for specified documents.
 String[] getItems(String Key, int[] docids)
          Obtain metadata of specified type for specified documents.
 String[] getKeys()
          Returns the keys of this meta index
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

getItem

String getItem(String Key,
               int docid)
               throws IOException
Obtain metadata of specified type for specified document.

Throws:
IOException

getAllItems

String[] getAllItems(int docid)
                     throws IOException
Obtain all metadata for specified document.

Throws:
IOException

getItems

String[] getItems(String Key,
                  int[] docids)
                  throws IOException
Obtain metadata of specified type for specified documents.

Throws:
IOException

getItems

String[] getItems(String[] keys,
                  int docid)
                  throws IOException
Obtain metadata of specified types for specified document.

Throws:
IOException

getItems

String[][] getItems(String[] Key,
                    int[] docids)
                    throws IOException
Obtain metadata of specified types for specified documents.

Throws:
IOException

getDocument

int getDocument(String key,
                String value)
                throws IOException
Obtain docid where document has specified metadata value in the specified type. Returns -1 if the value cannot be found for the specified key type.

Throws:
IOException

getKeys

String[] getKeys()
Returns the keys of this meta index



Terrier 3.6. Copyright © 2004-2011 University of Glasgow