Class IndexingBase

java.lang.Object
org.ctan.site.services.search.base.IndexingBase
Direct Known Subclasses:
IndexingService, IndexingSession, SearchService

public abstract class IndexingBase extends Object
The class IndexingBase contains the base class for indexing.
  • Constructor Details

    • IndexingBase

      public IndexingBase(@NonNull @NonNull File indexBase)
      This is the constructor for IndexingBase.
      Parameters:
      indexBase - the base directory
    • IndexingBase

      public IndexingBase(@NonNull @NonNull CtanConfiguration.IndexConfig config) throws FileNotFoundException
      This is the constructor for IndexingBase.
      Parameters:
      config - the configuration
      Throws:
      FileNotFoundException - in case of an improper base directory
  • Method Details

    • checkIndexDirectory

      protected File checkIndexDirectory(File dir) throws FileNotFoundException
      The method checkIndexDirectory provides means to check whether the index exists.
      Parameters:
      dir - the directory denoting the base directory for the index
      Returns:
      the argument
      Throws:
      FileNotFoundException - in case of an error
    • directory

      protected String directory(IndexType type, String locale)
      The method directory provides means to get the name of the directory.
      Parameters:
      type - the type
      locale - the language
      Returns:
      the directory name
    • indexPath

      protected Path indexPath(IndexType type, String locale)
      The method indexPath provides means to get the index path.
      Parameters:
      type - the type
      locale - the language
      Returns:
      the path
    • open

      protected org.apache.lucene.store.FSDirectory open(IndexType type, String locale) throws IOException
      The method open provides means to open an index.
      Parameters:
      type - the type
      locale - the language
      Returns:
      the directory
      Throws:
      IOException - in case of an I/O error
    • open

      protected org.apache.lucene.store.FSDirectory open(String index) throws IOException
      The method open provides means to open an index.
      Parameters:
      index - the index
      Returns:
      the directory
      Throws:
      IOException - in case of an I/O error