Class DidYouMeanIndexer
- java.lang.Object
-
- org.silverpeas.core.index.indexing.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
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
clearSpellIndex(String pathSpellChecker)
Clears all the entries from given spelling indexstatic void
clearSpellIndex(String[] paths)
Allows to empty several indexes at once. if the operation fails for an index, it will continue for the other indexesstatic 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.
-
-
-
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 indexoriginalIndexDirectory
- represents the source index pathspellIndexDirectory
- 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 indexoriginalIndexDirectory
- represents the source index path- See Also:
DidYouMeanIndexer
-
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 indexoriginalIndexDirectory
- represents the source index path- See Also:
DidYouMeanIndexer
-
-