Class LuceneMemberSearchEngine
- All Implemented Interfaces:
JcmsConstants,JaliosConstants
- Since:
- jcms-6.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jalios.jcms.search.LuceneDataSearchEngine
LuceneDataSearchEngine.IndexingLatch, LuceneDataSearchEngine.ReindexOptions -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringQueryHandler handler attribute indicating that the maximum number of results allowed in a member search was exceeded.static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.jalios.jcms.search.LuceneDataSearchEngine
alarmMgr, BACKGROUND_PROCESS_MGR, channel, directoryName, engineName, langList, multilingualFields 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_YEARFields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, CLASS_PROPERTY, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CS_TYPOLOGY_ROOT_CAT_VID, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DATA_DIRECTORY, DEFAULT_PHOTO_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GENERATIONAL_STORE_DIRECTORY, GLYPH_ICON_PREFIX, ICON_ARCHIVE, ICON_ICON_PREFIX, ICON_LOCK, ICON_LOCK_STRONG, ICON_PREFIX_PROP, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, IS_IN_FRONT_OFFICE, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JCMS_TOASTR_COLLECTION, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LANG_SPRITE, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, ORGANIZATION_ROOT_GROUP_PROP, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_PROP_PREFIX, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_PROP_PREFIX, PHOTO_LARGE_WIDTH, PHOTO_MINI, PHOTO_MINI_HEIGHT, PHOTO_MINI_PROP_PREFIX, PHOTO_MINI_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_PROP_PREFIX, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_PROP_PREFIX, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_PROP_PREFIX, PHOTO_TINY_WIDTH, PHOTO_XLARGE, PHOTO_XLARGE_HEIGHT, PHOTO_XLARGE_PROP_PREFIX, PHOTO_XLARGE_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, RAW_CONTENT_ICON_PREFIX, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SECURITY_LOG_FILE, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, SVGSPRITE_ICON_PREFIX, TEMPLATE_TAB, THEME_DIR, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TTCARD_MEDIA_HEIGHT, TTCARD_MEDIA_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, TYPES_UNKNOWN_CLASS_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, UPLOAD_PERMISSION_COUNT_PROP_PREFIX, UPLOAD_PERMISSION_SIZE_PROP_PREFIX, URL_REGEXP, VID_LOGGED_MEMBER, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the specified Member to the lucene index.protected DataIterator<Data> Returns aDataIteratorover allDataobjects to be indexed, filtered according to the givenLuceneDataSearchEngine.ReindexOptions.org.apache.lucene.store.FSDirectoryReturns the lucene directory used by this LuceneMemberSearchEngine.getIndexingDate(Member mbr) Retrieve the Date at which the specified Member was indexed.static LuceneMemberSearchEngineRetrieve the LuceneMemberSearchEngine singleton.protected org.apache.log4j.LoggerReturns theLoggerused for all log messages emitted by this engine.org.apache.lucene.document.DocumentgetLuceneDocument(Member mbr) Retrieve a new lucene Document for the specified Member in preparation of indexing.static intRetrieve the maximum number of results allowed to be return for a search.protected AdminSearchEnginesHandler.ActionReturns theAdminSearchEnginesHandler.Actionto use when starting anAdminSearchEngineProcessfor a full reindex.protected voidindexData(org.apache.lucene.index.IndexWriter writer, Data data, String lang, boolean isFullReindexing) This methods index the specified Member.voidoptimize()Realize a Lucene optimization of the Lucene Member Index.voidRemove the specified Member from the lucene index.search(AllMemberQueryHandler amqh) Search all members (Member and DBMember) using the specified criteria (paging excepted).Search all members (Member and DBMember) using the specified criteria.voidUpdate the specified Member in the lucene index.Methods inherited from class com.jalios.jcms.search.LuceneDataSearchEngine
acquireSearcher, addData, addDataCollection, clearIndices, createSnapshot, deleteData, deleteDataCollection, getAnalyzer, getDirectory, getIndexingDate, getIndexingDate, getIndexingLatch, getIndexWriter, getLastOptimizeDateSinceRestart, getLastOptimizeDuration, getLastReindexDateSinceRestart, getLastReindexDuration, getLuceneDocument, getOperationStartTime, getPrimaryTerm, getProgressState, getSearcherManager, getSimilarity, getSortFieldName, index, index, isOperationRunning, optimizeIndices, reindex, reindexAll, releaseSearcher, remove, updateData, updateDataCollection
-
Field Details
-
MEMBER_ENGINE_NAME
- See Also:
-
MEMBER_INDEX_DIRECTORY
- See Also:
-
ID_FIELD
- See Also:
-
CDATE_FIELD
- See Also:
-
MDATE_FIELD
- See Also:
-
ALLFIELDS_FIELD
- See Also:
-
INDEXING_DATE_FIELD
- See Also:
-
INDEXING_DATE_EXTRAINFO
- See Also:
-
TYPE_FIELD
- See Also:
-
LOGIN_FIELD
- See Also:
-
FIRSTNAME_FIELD
- See Also:
-
LASTNAME_FIELD
- See Also:
-
EMAIL_FIELD
- See Also:
-
JOBTITLE_FIELD
- See Also:
-
DEPARTMENT_FIELD
- See Also:
-
ORGANIZATION_FIELD
- See Also:
-
POSTALCODE_FIELD
- See Also:
-
LOCALITY_FIELD
- See Also:
-
REGION_FIELD
- See Also:
-
GROUPS_FIELD
- See Also:
-
USAGE_FIELD
- See Also:
-
PHONES_FIELD
- See Also:
-
ENABLED_FIELD
- See Also:
-
ADMIN_FIELD
- See Also:
-
EXTERNALAUTH_FIELD
- See Also:
-
LDAP_FIELD
- See Also:
-
CLEARANCE_LEVEL_FIELD
- See Also:
-
MAXIMUM_RESULTS_NUMBER_REACHED
QueryHandler handler attribute indicating that the maximum number of results allowed in a member search was exceeded.Attribute value is the number of results obtained.
Authorized limit can be retrieved usinggetMaximumResults().- Since:
- jcms-9.0.1 JCMS-4321
- See Also:
-
-
Method Details
-
getInstance
Retrieve the LuceneMemberSearchEngine singleton.After engine has been started during Channel startup, use
Channel.getMemberSearchEngine()to retrieve singleton getter without having to catch exception.- Returns:
- the LuceneMemberSearchEngine singleton.
- Throws:
Exception- if was not initialized and the initialization failed.- Since:
- jcms-6.1.0
-
getDirectory
public org.apache.lucene.store.FSDirectory getDirectory()Returns the lucene directory used by this LuceneMemberSearchEngine.
Warning!!! you should not modify the index, use this method only to access the directory in readonly !.- Returns:
- the instance of the FSDirectory used internally.
- Since:
- jcms-6.1.0
-
getIndexingDate
Retrieve the Date at which the specified Member was indexed.- Parameters:
mbr- theMemberfor which to retrieve the indexing date.- Returns:
- the indexing date of the Member or null if was not indexed.
- Since:
- jcms-6.1.0
-
getReindexAllAction
Description copied from class:LuceneDataSearchEngineReturns theAdminSearchEnginesHandler.Actionto use when starting anAdminSearchEngineProcessfor a full reindex.- Specified by:
getReindexAllActionin classLuceneDataSearchEngine
-
searchPage
Search all members (Member and DBMember) using the specified criteria.No more than
getMaximumResults()Members will be returned, if this limit is reached, attributeMAXIMUM_RESULTS_NUMBER_REACHEDis added to theAllMemberQueryHandlerwith the total count of Member retrieved.- Parameters:
amqh- the AllMemberQueryHandler instance specifying search criteria.- Returns:
- a new PageResult of Member, never return null
- Since:
- jcms-6.1.0
-
search
Search all members (Member and DBMember) using the specified criteria (paging excepted).No more than
getMaximumResults()Members will be returned, if this limit is reached, attributeMAXIMUM_RESULTS_NUMBER_REACHEDis added to theAllMemberQueryHandlerwith the total count of Member retrieved.- Parameters:
amqh- the AllMemberQueryHandler instance specifying search criteria.- Returns:
- a new map of Member id to relevance, never return null
- Since:
- jcms-6.1.0
-
getMaximumResults
public static int getMaximumResults()Retrieve the maximum number of results allowed to be return for a search.Can be configured using property
query.lucene.mbr.max-results- Returns:
- a maximum number of result retrieve (result beyong this limit are ignored)
-
add
Add the specified Member to the lucene index.- Parameters:
mbr- the Member to be added to lucene.- Since:
- jcms-6.1
-
update
Update the specified Member in the lucene index.- Parameters:
mbr- the Member to be update in lucene.- Since:
- jcms-6.1
-
remove
Remove the specified Member from the lucene index.- Parameters:
mbr- the Member to be removed from lucene.- Since:
- jcms-6.1
-
getLuceneDocument
Retrieve a new lucene Document for the specified Member in preparation of indexing.- Parameters:
mbr- the Member to index (must no be null).- Returns:
- A new instance of Document suitable for indexation
- Since:
- jcms-6.1.0
-
optimize
public void optimize()Realize a Lucene optimization of the Lucene Member Index.Warning: This is a potentially long and heavy process on large index, do not call without being sure of what you do. It is run against the indexing thread, it will not return as long as the indexing process is not done, and will block the indexing thread from running when doing its job.
- Since:
- jcms-6.1.0
-
getLogger
protected org.apache.log4j.Logger getLogger()Description copied from class:LuceneDataSearchEngineReturns theLoggerused for all log messages emitted by this engine.- Specified by:
getLoggerin classLuceneDataSearchEngine- Returns:
Loggerof this engine.
-
getDataIterator
Description copied from class:LuceneDataSearchEngineReturns aDataIteratorover allDataobjects to be indexed, filtered according to the givenLuceneDataSearchEngine.ReindexOptions.- Specified by:
getDataIteratorin classLuceneDataSearchEngine- Parameters:
options- reindex configuration- Returns:
- a non-null
DataIterator
-
indexData
protected void indexData(org.apache.lucene.index.IndexWriter writer, Data data, String lang, boolean isFullReindexing) throws IOException This methods index the specified Member.- Specified by:
indexDatain classLuceneDataSearchEngine- Parameters:
writer- target Lucene writerdata- theDatato indexlang- ISO-639 language codeisFullReindexing- true if operation is for a full reindexing with a empty index, false if updating an existing index- Throws:
IOException- on I/O error
-