org.silverpeas.search.indexEngine.model
Class IndexManager

java.lang.Object
  extended by org.silverpeas.search.indexEngine.model.IndexManager

public class IndexManager
extends Object

An IndexManager manage all the web'activ's index. An IndexManager is NOT thread safe : to share an IndexManager between several threads use an IndexerThread.


Field Summary
static int ADD
           
static String ALIAS
           
static String CONTENT
           
static String CREATIONDATE
           
static String CREATIONUSER
           
static String EMBEDDED_FILE_IDS
           
static String ENDDATE
           
static String FIELDS_FOR_FACETS
           
static String FILENAME
           
static String HEADER
           
static String ID
          The fields names used by lucene to store each element of an index entry.
static String KEY
           
static String KEYWORDS
           
static String LANG
           
static String LASTUPDATEDATE
           
static String LASTUPDATEUSER
           
static int NONE
          Exhaustive list of indexation's operations Used by objects which must be indexed
static String PATH
           
static String PREVIEW
           
static int READD
           
static int REMOVE
           
static String SERVER_NAME
           
static String STARTDATE
           
static String THUMBNAIL
           
static String THUMBNAIL_DIRECTORY
           
static String THUMBNAIL_MIMETYPE
           
static String TITLE
           
 
Constructor Summary
IndexManager()
          The constructor takes no parameters and all the index engine parameters are taken from the properties file "com/stratelia/webactiv/util/indexEngine/indexEngine.properties".
 
Method Summary
 void addIndexEntry(FullIndexEntry indexEntry)
          Add an entry index.
 void flush()
          Optimize all the modified index.
 org.apache.lucene.analysis.Analyzer getAnalyzer(String language)
          Return the analyzer used to parse indexed texts and queries in the given language.
 String getIndexDirectoryPath(IndexEntry indexEntry)
          Return the path to the directory where are stored the index for the given index entry.
 String getIndexDirectoryPath(IndexEntryPK indexEntry)
          Return the path to the directory where are stored the index for the given index entry.
 String getIndexDirectoryPath(String space, String component)
          Return the path to the directory where are stored the index for the given index entry .
 Reader getReader(FileDescription file)
          Get the reader specific of the file described by the file description
 void removeIndexEntry(IndexEntryPK indexEntry)
          Remove an entry index .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
The fields names used by lucene to store each element of an index entry.

See Also:
Constant Field Values

KEY

public static final String KEY
See Also:
Constant Field Values

TITLE

public static final String TITLE
See Also:
Constant Field Values

PREVIEW

public static final String PREVIEW
See Also:
Constant Field Values

KEYWORDS

public static final String KEYWORDS
See Also:
Constant Field Values

LANG

public static final String LANG
See Also:
Constant Field Values

CREATIONDATE

public static final String CREATIONDATE
See Also:
Constant Field Values

CREATIONUSER

public static final String CREATIONUSER
See Also:
Constant Field Values

LASTUPDATEDATE

public static final String LASTUPDATEDATE
See Also:
Constant Field Values

LASTUPDATEUSER

public static final String LASTUPDATEUSER
See Also:
Constant Field Values

STARTDATE

public static final String STARTDATE
See Also:
Constant Field Values

ENDDATE

public static final String ENDDATE
See Also:
Constant Field Values

HEADER

public static final String HEADER
See Also:
Constant Field Values

CONTENT

public static final String CONTENT
See Also:
Constant Field Values

THUMBNAIL

public static final String THUMBNAIL
See Also:
Constant Field Values

THUMBNAIL_MIMETYPE

public static final String THUMBNAIL_MIMETYPE
See Also:
Constant Field Values

THUMBNAIL_DIRECTORY

public static final String THUMBNAIL_DIRECTORY
See Also:
Constant Field Values

SERVER_NAME

public static final String SERVER_NAME
See Also:
Constant Field Values

EMBEDDED_FILE_IDS

public static final String EMBEDDED_FILE_IDS
See Also:
Constant Field Values

FIELDS_FOR_FACETS

public static final String FIELDS_FOR_FACETS
See Also:
Constant Field Values

FILENAME

public static final String FILENAME
See Also:
Constant Field Values

PATH

public static final String PATH
See Also:
Constant Field Values

ALIAS

public static final String ALIAS
See Also:
Constant Field Values

NONE

public static final int NONE
Exhaustive list of indexation's operations Used by objects which must be indexed

See Also:
Constant Field Values

ADD

public static final int ADD
See Also:
Constant Field Values

REMOVE

public static final int REMOVE
See Also:
Constant Field Values

READD

public static final int READD
See Also:
Constant Field Values
Constructor Detail

IndexManager

public IndexManager()
The constructor takes no parameters and all the index engine parameters are taken from the properties file "com/stratelia/webactiv/util/indexEngine/indexEngine.properties".

Method Detail

addIndexEntry

public void addIndexEntry(FullIndexEntry indexEntry)
Add an entry index.

Parameters:
indexEntry -

flush

public void flush()
Optimize all the modified index.


removeIndexEntry

public void removeIndexEntry(IndexEntryPK indexEntry)
Remove an entry index .

Parameters:
indexEntry -

getIndexDirectoryPath

public String getIndexDirectoryPath(IndexEntry indexEntry)
Return the path to the directory where are stored the index for the given index entry.

Parameters:
indexEntry - the index entry.
Returns:
the path to the directory where are stored the index for the given index entry.

getIndexDirectoryPath

public String getIndexDirectoryPath(IndexEntryPK indexEntry)
Return the path to the directory where are stored the index for the given index entry.

Parameters:
indexEntry -
Returns:
the path to the directory where are stored the index for the given index entry.

getIndexDirectoryPath

public String getIndexDirectoryPath(String space,
                                    String component)
Return the path to the directory where are stored the index for the given index entry .

Parameters:
space -
component -
Returns:
the path to the directory where are stored the index for the given index entry .

getAnalyzer

public org.apache.lucene.analysis.Analyzer getAnalyzer(String language)
Return the analyzer used to parse indexed texts and queries in the given language.

Parameters:
language - the language used in a document or a query.
Returns:
the analyzer for the required language or a default analyzer.

getReader

public Reader getReader(FileDescription file)
Get the reader specific of the file described by the file description

Parameters:
file -
Returns:
the reader specific of the file described by the file description


Copyright © 2016 Silverpeas. All Rights Reserved.