public class IndexUtil extends Object
Constructor and Description |
---|
IndexUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
close(Object o)
Check to see if an object is closeable, and if so, close it.
|
static void |
configure(Index index,
Object o)
Configures an object with the index, if the object implements IndexConfigurable
|
static boolean |
copyStructure(Index sourceIndex,
Index destIndex,
String sourceStructureName,
String destinationStructureName)
Copies an index structure from one index to another.
|
static void |
deleteIndex(String path,
String prefix)
Delete an existing index
|
static boolean |
deleteStructure(Index index,
String structureName)
Delete the named structure from the specified index.
|
static void |
forceReloadStructure(Index index,
String structureName)
Forces a structure to be reloaded, by removing it from the index's structure cache
|
static void |
forceStructure(Index index,
String structureName,
Object structure)
Force the specified object into the structure cache of the specified object,
as the given structure name
|
static String[] |
getStructures(Index index)
Returns a list of the structures in the given index
|
static void |
main(String[] args)
Has some handy utilities for printing various index structures to System.out.
|
static void |
printDocumentIndex(Index index,
String structureName)
Print the contents of the document index
|
static void |
printMetaIndex(Index index,
String structureName)
Print the contents of the meta index
|
static void |
renameIndex(String srcPath,
String srcPrefix,
String dstPath,
String dstPrefix)
Move an index from one location to another
|
static boolean |
renameIndexStructure(Index index,
String sourceStructureName,
String destinationStructureName)
Rename a structure within a given index.
|
static Index |
reOpenIndex(Index index)
Reopen an existing index
|
public static void main(String[] args) throws Exception
Exception
public static void forceStructure(Index index, String structureName, Object structure)
index
- Index to operate onstructureName
- which structure name to usestructure
- which object to put into the structure cachepublic static void forceReloadStructure(Index index, String structureName)
public static Index reOpenIndex(Index index) throws IOException
IOException
public static String[] getStructures(Index index)
public static void renameIndex(String srcPath, String srcPrefix, String dstPath, String dstPrefix) throws IOException
IOException
public static void deleteIndex(String path, String prefix) throws IOException
IOException
public static void printDocumentIndex(Index index, String structureName) throws IOException
IOException
public static boolean deleteStructure(Index index, String structureName) throws IOException
index
- - index to operate onstructureName
- name of structure to deleteIOException
public static boolean copyStructure(Index sourceIndex, Index destIndex, String sourceStructureName, String destinationStructureName) throws IOException
sourceIndex
- destIndex
- sourceStructureName
- destinationStructureName
- IOException
- if an IO problem occurspublic static void printMetaIndex(Index index, String structureName) throws IOException
IOException
public static boolean renameIndexStructure(Index index, String sourceStructureName, String destinationStructureName) throws IOException
IOException
public static void configure(Index index, Object o)
public static void close(Object o) throws IOException
o
- object to check for being closeable.IOException
- if exception thrown while closing.Terrier 4.0. Copyright © 2004-2014 University of Glasgow