org.silverpeas.search.indexEngine.model
Class DidYouMeanIndexer

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

public class DidYouMeanIndexer
extends Object

This class allows to manage the specific index of "did you mean" functionality.
creates new entry into index
clear all the entries from index


Field Summary
static String SUFFIX_SPELLING_INDEX_PATH
          Suffix used to differentiate the standard index path's and the spelling index path's
 
Method Summary
static boolean clearSpellIndex(String pathSpellChecker)
          Clears all the entries from given spelling index
static void clearSpellIndex(String[] paths)
          Allows to empty several indexes at once. if the operation fails for an index, it will continue for the other indexes
static void createSpellIndex(String field, String originalIndexDirectory)
          creates or updates a spelling index.
static void createSpellIndex(String field, String originalIndexDirectory, String spellIndexDirectory)
          creates or updates a spelling index.
static void createSpellIndexForAllLanguage(String field, String originalIndexDirectory)
          Tries to creates or updates a spelling index for all language manage by the application instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUFFIX_SPELLING_INDEX_PATH

public static final String SUFFIX_SPELLING_INDEX_PATH
Suffix used to differentiate the standard index path's and the spelling index path's

See Also:
Constant Field Values
Method Detail

createSpellIndex

public static void createSpellIndex(String field,
                                    String originalIndexDirectory,
                                    String spellIndexDirectory)
creates or updates a spelling index. The spelling index is created or updated from an existing index. The spelling index is used to suggest words when an user executes a query that returns unsatisfactory results. if a spelling index already exists, only the new words contained in the index source will be added. otherwise a new index will be created

Parameters:
field - name of the field of the index source that will be used to feed the spelling index
originalIndexDirectory - represents the source index path
spellIndexDirectory - represents the spelling index path

createSpellIndex

public static void createSpellIndex(String field,
                                    String originalIndexDirectory)
creates or updates a spelling index. The spelling index is created or updated from an existing index. The spelling index is used to suggest words when an user executes a query that returns unsatisfactory results. if a spelling index already exists, only the new words contained in the index source will be added. otherwise a new index will be created.
This method create an spelling index from the original index path by the adding a suffix to the original path index. The suffix is already the same

Parameters:
field - name of the field of the index source that will be used to feed the spelling index
originalIndexDirectory - represents the source index path
See Also:
DidYouMeanIndexer.SUFFIX_SPELLING_INDEX_PATH

clearSpellIndex

public static boolean clearSpellIndex(String pathSpellChecker)
Clears all the entries from given spelling index

Parameters:
pathSpellChecker - The SpellChecker's path to clear. The path must be a directory path.
Returns:
true whether the index have been cleared otherwise false.

clearSpellIndex

public static void clearSpellIndex(String[] paths)
Allows to empty several indexes at once. if the operation fails for an index, it will continue for the other indexes

Parameters:
paths - array of index path. List of index path to empty

createSpellIndexForAllLanguage

public static void createSpellIndexForAllLanguage(String field,
                                                  String originalIndexDirectory)
Tries to creates or updates a spelling index for all language manage by the application instance.
The spelling index is created or updated from an existing index. The spelling index is used to suggest words when an user executes a query that returns unsatisfactory results. if a spelling index already exists, only the new words contained in the index source will be added. otherwise a new index will be created.
This method create an spelling index from the original index path by the adding a suffix to the original path index. The suffix is already the same

Parameters:
field - name of the field of the index source that will be used to feed the spelling index
originalIndexDirectory - represents the source index path
See Also:
DidYouMeanIndexer.SUFFIX_SPELLING_INDEX_PATH


Copyright © 2016 Silverpeas. All Rights Reserved.