Package org.appng.search.indexer
Class IndexConfig
- java.lang.Object
-
- org.appng.search.indexer.IndexConfig
-
public class IndexConfig extends Object
AIndexConfig
is used to provide different index configurations for different folders.- Author:
- Matthias Müller
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
IndexConfig.ConfigEntry
AConfigEntry
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 LuceneAnalyzer
to use.
-
Constructor Summary
Constructors Constructor Description IndexConfig(String tagPrefix)
Creates a newParseTags
using the given tag-prefix (usuallyappNG
).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEntry(String folder, String language, String analyzerClass)
IndexConfig.ConfigEntry
getEntry(String folder)
SortedSet<String>
getFolders()
static IndexConfig
getInstance(String configString, String tagPrefix)
Parses a given String to anIndexConfig
, 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
static IndexConfig
getInstance(List<String> configEntries, String tagPrefix)
Parses a list of strings to anIndexConfig
.org.apache.lucene.index.IndexWriterConfig.OpenMode
getOpenMode()
String
getTagPrefix()
void
setOpenMode(org.apache.lucene.index.IndexWriterConfig.OpenMode openMode)
-
-
-
Constructor Detail
-
IndexConfig
public IndexConfig(String tagPrefix)
Creates a newParseTags
using the given tag-prefix (usuallyappNG
).- Parameters:
tagPrefix
- the tag prefix to use
-
-
Method Detail
-
getInstance
public static IndexConfig getInstance(String configString, String tagPrefix)
Parses a given String to anIndexConfig
, 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 theIndexConfig
fromtagPrefix
- 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 anIndexConfig
. 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 entriestagPrefix
- the tag prefix to use- Returns:
- the
IndexConfig
instance
-
getEntry
public IndexConfig.ConfigEntry getEntry(String folder)
-
getOpenMode
public org.apache.lucene.index.IndexWriterConfig.OpenMode getOpenMode()
-
setOpenMode
public void setOpenMode(org.apache.lucene.index.IndexWriterConfig.OpenMode openMode)
-
getTagPrefix
public String getTagPrefix()
-
-