|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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);
Document
, in each language:
LuceneSearchEnginePolicyFilter.getCategoryBoost(Category, String, float)
Document
'Field
, in each language:
LuceneSearchEnginePolicyFilter.getFieldBoost(Category, String, String, String, float)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jalios.jcms.search.LuceneDataSearchEngine |
---|
LuceneDataSearchEngine.MultiSearcherWrapper |
Field Summary | |
---|---|
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 |
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.LuceneDataSearchEngine.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. |
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
Constructor Detail |
---|
public LuceneCategorySearchEngine() throws Exception
Exception
- if error occurs during initializationMethod Detail |
---|
public void add(Category cat)
Category
to this lucene search engine.
add
in interface CategorySearchEngine
cat
- the Category
to index .public void update(Category cat)
Category
in this lucene search engine.
update
in interface CategorySearchEngine
cat
- the Category
to reindex .public void delete(Category cat)
Category
from this lucene search engine.
delete
in interface CategorySearchEngine
cat
- the Category
to reindex .public void add(Collection<Category> coll)
Collection
of Category
to this lucene search engine.
add
in interface CategorySearchEngine
coll
- the Collection
of Category
to index .public void update(Collection<Category> coll)
Collection
of Category
in this lucene search engine.
update
in interface CategorySearchEngine
coll
- the Collection
of Category
to reindex .public void delete(Collection<Category> coll)
Collection
of Category
from this lucene search engine.
delete
in interface CategorySearchEngine
coll
- the Collection
of Category
to reindex .public Date getIndexingDate(Category cat)
getIndexingDate
in interface CategorySearchEngine
cat
- 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 CategorySearchEngine
qh
- 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
protected org.apache.log4j.Logger getLogger()
LuceneDataSearchEngine
getLogger
in class LuceneDataSearchEngine
Logger
of this engine.protected com.jalios.jcms.search.LuceneDataSearchEngine.DataIterator<Data> getAllDataIterator()
LuceneDataSearchEngine
LuceneDataSearchEngine.reindexAll()
.
getAllDataIterator
in class LuceneDataSearchEngine
protected void indexData(org.apache.lucene.index.IndexWriter writer, Data data, String lang) throws IOException
indexData
in class LuceneDataSearchEngine
IOException
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 |