|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jalios.jcms.search.LuceneDataSearchEngine
com.jalios.jcms.search.LuceneCategorySearchEngine
public class LuceneCategorySearchEngine
This CategorySearchEngine is reponsible for the indexing and searching of JCMS
content using lucene.
Architecture and notable points:
WEB-INF/data/lucene/CategoriesIndices/<lang>/.Document per indexed Category."search-engine.optimize-schedule" (jdring's AlarmEntry cron-like format)Analyzer getAnalyzer(String lang);
| Field Summary | |
|---|---|
static String |
ALLFIELDS_FIELD
|
protected static String |
CATEGORY_INDEX_DIRECTORY
|
static String |
DESCRIPTION_FIELD
|
static String |
MATCHED_CATEGORIES_ATTRIBUTE
This variable is the attribute's key used by the LuceneCategorySearchEngine to set the matched categories HashSet in the QueryResultSet Attribute. |
static String |
NAME_FIELD
|
static String |
REVISION
|
static String |
SYNONYMS_FIELD
|
| Fields inherited from class com.jalios.jcms.search.LuceneDataSearchEngine |
|---|
alarmMgr, channel, directoryName, ID_FIELD, indexAccessLock, INDEXING_DATE_EXTRAINFO, INDEXING_DATE_FIELD, langList, langToIndexDirMap, MAX_BUFFERED_DOCS, MAX_FIELD_LENGTH, MAX_MERGE_DOCS, MERGE_FACTOR, multilingual |
| Fields inherited from interface com.jalios.util.JaliosConstants |
|---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
| Constructor Summary | |
|---|---|
LuceneCategorySearchEngine()
Initialize the Lucene Search Engine |
|
| Method Summary | |
|---|---|
void |
add(Category cat)
Add given Category to this lucene search engine. |
void |
add(Collection<Category> coll)
Add given Collection of Category to this lucene search engine. |
protected void |
addKeywordField(org.apache.lucene.document.Document doc,
Category cat,
String lang,
String fieldName,
String fieldValue,
boolean applyBoost)
This methods create a unstored Lucene Field with the given field's value
of the given Category in the given language, and add into the given Document. |
protected void |
addUnStoredField(org.apache.lucene.document.Document doc,
Category cat,
String lang,
String fieldName,
String fieldValue,
boolean applyBoost)
This methods create a unstored Lucene Field with the given field's value
of the given Category in the given language, and add into the given Document. |
void |
clearAll()
Clear indices in this searchEngine (undoable!). |
void |
delete(Category cat)
Delete given Category from this lucene search engine. |
void |
delete(Collection<Category> coll)
Delete given Collection of Category from this lucene search engine. |
protected com.jalios.jcms.search.DataIterator<Data> |
getAllDataIterator()
This methods must be implemented by the LuceneSearchEngine. |
Date |
getIndexingDate(Category cat)
Retrieve the Date at which the specified Category was indexed in the search engine. |
protected org.apache.log4j.Logger |
getLogger()
This methods must be implemented by the LuceneSearchEngine. |
protected void |
indexData(org.apache.lucene.index.IndexWriter writer,
Data data,
String lang)
This methods index the given Category in the given language, into the given index writer. |
boolean |
search(QueryHandler qh,
HashSet<? extends Publication> pubSet,
QueryResultSet resultSet)
Perform a full-text search. |
Collection<Category> |
searchCategories(org.apache.lucene.search.Query query)
Find Category matching the specified lucene Query |
Collection<Category> |
searchCategories(QueryHandler qh)
Find Category matching the specified QueryHandler search options (uses mainly the text search param) |
void |
update(Category cat)
Update given Category in this lucene search engine. |
void |
update(Collection<Category> coll)
Update given Collection of Category in this lucene search engine. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String REVISION
public static final String MATCHED_CATEGORIES_ATTRIBUTE
protected static final String CATEGORY_INDEX_DIRECTORY
public static final String NAME_FIELD
public static final String SYNONYMS_FIELD
public static final String DESCRIPTION_FIELD
public static final String ALLFIELDS_FIELD
| Constructor Detail |
|---|
public LuceneCategorySearchEngine()
throws Exception
Exception - if error occurs during initialization| Method Detail |
|---|
public void add(Category cat)
Category to this lucene search engine.
add in interface CategorySearchEnginecat - the Category to index .public void update(Category cat)
Category in this lucene search engine.
update in interface CategorySearchEnginecat - the Category to reindex .public void delete(Category cat)
Category from this lucene search engine.
delete in interface CategorySearchEnginecat - the Category to reindex .public void add(Collection<Category> coll)
Collection of Category to this lucene search engine.
add in interface CategorySearchEnginecoll - the Collection of Category to index .public void update(Collection<Category> coll)
Collection of Category in this lucene search engine.
update in interface CategorySearchEnginecoll - the Collection of Category to reindex .public void delete(Collection<Category> coll)
Collection of Category from this lucene search engine.
delete in interface CategorySearchEnginecoll - the Collection of Category to reindex .public Date getIndexingDate(Category cat)
getIndexingDate in interface CategorySearchEnginecat - the Category for which to retrieve the indexing date.
public void clearAll()
clearAll in interface CategorySearchEngine
public boolean search(QueryHandler qh,
HashSet<? extends Publication> pubSet,
QueryResultSet resultSet)
CategorySearchEngine
search in interface CategorySearchEngineqh - the Queryhandler in which to find search text and search options.pubSet - a HashSet containing all the Publication to search. Publication found will be returned. resultSet - the QueryResultSet that must be filled
with matching Publication
public Collection<Category> searchCategories(QueryHandler qh)
qh - the QueryHandler used to store
public Collection<Category> searchCategories(org.apache.lucene.search.Query query)
query - a Lucene Query
protected org.apache.log4j.Logger getLogger()
LuceneDataSearchEngine
getLogger in class LuceneDataSearchEngineLogger of this engine.protected com.jalios.jcms.search.DataIterator<Data> getAllDataIterator()
LuceneDataSearchEngineLuceneDataSearchEngine.reindexAll().
getAllDataIterator in class LuceneDataSearchEngine
protected void indexData(org.apache.lucene.index.IndexWriter writer,
Data data,
String lang)
throws IOException
indexData in class LuceneDataSearchEngineIOException
protected void addUnStoredField(org.apache.lucene.document.Document doc,
Category cat,
String lang,
String fieldName,
String fieldValue,
boolean applyBoost)
Field with the given field's value
of the given Category in the given language, and add into the given Document.
applyBoost - whether to apply the boost, useful for appendable field in which case
the boost should only be applied for the first element.
protected void addKeywordField(org.apache.lucene.document.Document doc,
Category cat,
String lang,
String fieldName,
String fieldValue,
boolean applyBoost)
Field with the given field's value
of the given Category in the given language, and add into the given Document.
applyBoost - whether to apply the boost, useful for appendable field in which case
the boost should only be applied for the first element.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||