Class IndexConfig


  • public class IndexConfig
    extends Object
    A IndexConfig is used to provide different index configurations for different folders.
    Author:
    Matthias Müller
    • Constructor Detail

      • IndexConfig

        public IndexConfig​(String tagPrefix)
        Creates a new ParseTags using the given tag-prefix (usually appNG).
        Parameters:
        tagPrefix - the tag prefix to use
    • Method Detail

      • getInstance

        public static IndexConfig getInstance​(String configString,
                                              String tagPrefix)
        Parses a given String to an IndexConfig, using the pipe '|' for separating folders.
        format:
        <folder>;<language>;<analyzer-class>|
        Example:
        /de;de-DE;GermanAnalyzer|/en;en-US;org.apache.lucene.analysis.en.EnglishAnalyzer|/assets;de-DE;GermanAnalyzer

        If the analyzer class isn't fully qualified, the following name-schema is applied:
        org.apache.lucene.analysis.<folder>.<analyzer-class>
        Parameters:
        configString - the string to parse the IndexConfig from
        tagPrefix - the tag prefix to use
        Returns:
        the IndexConfig instance
      • getInstance

        public static IndexConfig getInstance​(List<String> configEntries,
                                              String tagPrefix)
        Parses a list of strings to an IndexConfig. Each string has the following format:
        <folder>;<language>;<analyzer-class>
        Example:
        /en;en-US;org.apache.lucene.analysis.en.EnglishAnalyzer
        Parameters:
        configEntries - a list of config entries
        tagPrefix - the tag prefix to use
        Returns:
        the IndexConfig instance
      • addEntry

        public void addEntry​(String folder,
                             String language,
                             String analyzerClass)
      • getOpenMode

        public org.apache.lucene.index.IndexWriterConfig.OpenMode getOpenMode()
      • setOpenMode

        public void setOpenMode​(org.apache.lucene.index.IndexWriterConfig.OpenMode openMode)
      • getTagPrefix

        public String getTagPrefix()