org.appng.search.indexer

## Class IndexConfig

- java.lang.Object
- - org.appng.search.indexer.IndexConfig

-     public class IndexConfig
      extends Object

  A `IndexConfig` is used to provide different index configurations for different folders.
  Author:
    Matthias Müller

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `IndexConfig.ConfigEntry` A `ConfigEntry` provides informations about how to index a certion folder, which includes the name of the folder itself, the language-code for the contents of this folder, and the name of the Lucene `Analyzer` to use.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexConfig(String tagPrefix)` Creates a new `ParseTags` using the given tag-prefix (usually `appNG`).

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEntry(String folder, String language, String analyzerClass)`
    `IndexConfig.ConfigEntry` | `getEntry(String folder)`
    `SortedSet<String>` | `getFolders()`
    `static IndexConfig` | `getInstance(List<String> configEntries, String tagPrefix)` Parses a list of strings to an `IndexConfig`.
    `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`
    `org.apache.lucene.index.IndexWriterConfig.OpenMode` | `getOpenMode()`
    `String` | `getTagPrefix()`
    `void` | `setOpenMode(org.apache.lucene.index.IndexWriterConfig.OpenMode openMode)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

    - #### getFolders

          public SortedSet<String> getFolders()

    - #### getEntry

          public IndexConfig.ConfigEntry getEntry(String folder)

    - #### 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()

Copyright © 2011–2023 aiticon GmbH. All rights reserved.