Package com.jalios.jcms.search
Class LucenePublicationSearchEngine
- java.lang.Object
-
- com.jalios.jcms.search.LuceneDataSearchEngine
-
- com.jalios.jcms.search.LucenePublicationSearchEngine
-
- All Implemented Interfaces:
JcmsConstants,PublicationSearchEngine,JaliosConstants
public class LucenePublicationSearchEngine extends LuceneDataSearchEngine implements PublicationSearchEngine, JcmsConstants
ThisPublicationSearchEngineis reponsible for the indexing and searching of JCMS content using lucene.
Architecture and notable points:- 1 lucene index per language:
WEB-INF/data/lucene/PublicationsIndices/<lang>/. - 1
Documentper indexedPublication. - Date fields are indexed using "yyyyMMdd" format.
- Only String and String[] fields are added to the common appendable field
ALLFIELDS_FIELDused for searching. - Indices' optimization occurs using schedule specified by property
"search-engine.optimize-schedule"(jdring's AlarmEntry cron-like format)
Possible Hooks/Modification:- Specify analyzer for each language:
Analyzer getAnalyzer(String lang);
- Since:
- jcms-5.5.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jalios.jcms.search.LuceneDataSearchEngine
LuceneDataSearchEngine.IndexingLatch, LuceneDataSearchEngine.ReindexOptions
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringABSTRACT_FIELDstatic java.lang.StringADATE_FIELDstatic java.lang.StringALLFIELDS_FIELDstatic java.lang.StringAUTHORID_FIELDstatic java.lang.StringCATEGORYID_FIELDstatic java.lang.StringCDATE_FIELDstatic java.lang.StringCLASS_FIELDstatic java.lang.StringCLASSIFICATIONLEVEL_FIELDstatic java.text.DateFormatdateFormatterstatic java.lang.StringEDATE_FIELDstatic java.lang.StringFILEDOCUMENT_CONTENTField name for the content of the file as extracted with additionnal parser in FileProcessorstatic java.lang.StringFILEDOCUMENT_CONTENT_TYPE_FIELDField name for the extension of the file , e.g.static java.lang.StringFILEDOCUMENT_FILE_EXTENSION_FIELDField name for the extension of the file , e.g.static java.lang.StringFILEDOCUMENT_FILENAME_FIELDField name for the relative path in jcms, e.g.static java.lang.StringFILEDOCUMENT_INDEXING_DATE_FIELDField name for the date at which the FileDocument has been indexed with a non empty contentstatic java.lang.StringFILEDOCUMENT_MODIFIED_FIELDField name for the last modified date of the file (time in ms) when it was indexedstatic java.lang.StringFILEDOCUMENT_ORIGINAL_FILENAME_FIELDField name for the original filename as upload by user eg "My file.txt", or fileDoc.getOriginalFilename()protected static longHITS_TIMEOUTstatic java.lang.StringHITS_TIMEOUT_PROPstatic java.lang.StringISDBDATA_FIELDstatic java.lang.StringLIMIT_REACHED_DURING_DB_SEARCHQueryHandler attribute set (to boolean value) if the maximum number of lucene result authorized (as specified by propertyquery.lucene.pub.max-results) was reached during DB search.static java.lang.StringLIMIT_REACHED_DURING_JSTORE_SEARCHQueryHandler attribute set (to boolean value) if the maximum number of lucene result authorized (as specified by propertyquery.lucene.pub.max-results) was reached during JStore search.static java.lang.StringMDATE_FIELDstatic java.lang.StringOPAUTHORID_FIELDstatic java.lang.StringPDATE_FIELDstatic java.lang.StringPSTATUS_FIELDprotected static java.lang.StringPUBLICATION_ENGINE_NAMEprotected static java.lang.StringPUBLICATION_INDEX_DIRECTORYstatic java.lang.StringSDATE_FIELDstatic java.lang.StringSPELLSUGGEST_ATTRIBUTEThis variable is the attribute's key used by the LucenePublicationSearchEngine to set the suggested search string in the QueryResultSet Attribute.protected SpellSuggestEnginespellSuggestEnginestatic java.lang.StringTITLE_FIELDstatic java.lang.StringTOTAL_HITS_DURING_DB_SEARCHQueryHandler attribute set to Long value indicating the total number of hits found in the lucene index for current DB search.static java.lang.StringTOTAL_HITS_DURING_JSTORE_SEARCHQueryHandler attribute set to Long value indicating the total number of hits found in the lucene index for current JStore search.static java.lang.StringUDATE_FIELDstatic java.lang.StringVERSION_FIELDstatic java.lang.StringWORKSPACEID_FIELD-
Fields inherited from class com.jalios.jcms.search.LuceneDataSearchEngine
alarmMgr, BACKGROUND_PROCESS_MGR, channel, directoryName, engineName, ID_FIELD, indexAccessLock, INDEXING_DATE_EXTRAINFO, INDEXING_DATE_FIELD, langList, langToIndexDirMap, langToIndexWriterMap, 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
-
Fields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADMIN_NOTES_PROP, 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, 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, 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_DIR, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, TEMPLATE_TAB, 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, 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
-
-
Constructor Summary
Constructors Constructor Description LucenePublicationSearchEngine()Initialize the Lucene Search Engine
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Publication pub)Add givenPublicationto this lucene search engine.voidadd(java.util.Collection<? extends Publication> coll)Add givenCollectionofPublicationto this lucene search engine.voidaddStringFieldNotStored(org.apache.lucene.document.Document doc, Publication pub, java.lang.String lang, java.lang.String fieldName, java.lang.String fieldValue)This methods create a unstored and untokenized LuceneFieldwith the given field's value of the givenPublicationin the given language, and add into the givenDocument.voidaddStringFieldStored(org.apache.lucene.document.Document doc, Publication pub, java.lang.String lang, java.lang.String fieldName, java.lang.String fieldValue)This methods create a stored LuceneFieldwith the given field's value of the givenPublicationin the given language, and add into the givenDocument.voidaddTextFieldNotStored(org.apache.lucene.document.Document doc, Publication pub, java.lang.String lang, java.lang.String fieldName, java.lang.String fieldValue)This methods create a unstored LuceneFieldwith the given field's value of the givenPublicationin the given language, and add into the givenDocument.voidaddTextFieldStored(org.apache.lucene.document.Document doc, Publication pub, java.lang.String lang, java.lang.String fieldName, java.lang.String fieldValue)This methods create a stored LuceneFieldwith the given field's value of the givenPublicationin the given language, and add into the givenDocument.voiddelete(Publication pub)Delete givenPublicationfrom this lucene search engine.voiddelete(java.util.Collection<? extends Publication> coll)Delete givenCollectionofPublicationfrom this lucene search engine.protected DataIterator<Data>getDataIterator(LuceneDataSearchEngine.ReindexOptions options)This methods must be implemented by the LuceneSearchEngine.java.util.DategetIndexingDate(Publication pub)Retrieve the Date at which the specified Publication was indexed in the search engine.protected org.apache.log4j.LoggergetLogger()This methods must be implemented by the LuceneSearchEngine.static intgetMaximumResults()Retrieve the maximum number of results allowed to be return for a search.protected AdminSearchEnginesHandler.ActiongetReindexAllAction()Retrieve the Action to use when starting aAdminSearchEngineProcessfor full reindexing.SpellSuggestEnginegetSpellSuggestEngine()protected voidindexData(org.apache.lucene.index.IndexWriter writer, Data data, java.lang.String lang)This methods index the given publication in the given language, into the given index writer.java.util.LinkedHashMap<java.lang.String,java.lang.Float>search(QueryHandler qh)Search for JcmsDBPublicationusing lucene search engine.booleansearch(QueryHandler qh, java.util.HashSet<? extends Publication> pubSet, QueryResultSet resultSet)Search for JStorePublicationusing lucene search engine.voidupdate(Publication pub)Update givenPublicationin this lucene search engine.voidupdate(java.util.Collection<? extends Publication> coll)Update givenCollectionofPublicationin this lucene search engine.-
Methods inherited from class com.jalios.jcms.search.LuceneDataSearchEngine
acquireSearcher, addData, addDataCollection, clearIndices, clearSearcher, createSnapshot, deleteData, deleteDataCollection, getAllDataIterator, getAnalyzer, getDirectory, getIndexingDate, getIndexingDate, getIndexingLatch, getIndexWriter, getLastOptimizeDateSinceRestart, getLastOptimizeDuration, getLastReindexDateSinceRestart, getLastReindexDuration, getLuceneDocument, getOperationStartTime, getPrimaryTerm, getProgressState, getSearcherManager, getSimilarity, index, index, isOperationRunning, optimizeIndices, reindex, reindexAll, releaseSearcher, remove, updateData, updateDataCollection
-
-
-
-
Field Detail
-
SPELLSUGGEST_ATTRIBUTE
public static final java.lang.String SPELLSUGGEST_ATTRIBUTE
This variable is the attribute's key used by the LucenePublicationSearchEngine to set the suggested search string in the QueryResultSet Attribute.- See Also:
- Constant Field Values
-
PUBLICATION_ENGINE_NAME
protected static final java.lang.String PUBLICATION_ENGINE_NAME
- See Also:
- Constant Field Values
-
PUBLICATION_INDEX_DIRECTORY
protected static final java.lang.String PUBLICATION_INDEX_DIRECTORY
- See Also:
- Constant Field Values
-
TITLE_FIELD
public static final java.lang.String TITLE_FIELD
- See Also:
- Constant Field Values
-
ABSTRACT_FIELD
public static final java.lang.String ABSTRACT_FIELD
- See Also:
- Constant Field Values
-
ALLFIELDS_FIELD
public static final java.lang.String ALLFIELDS_FIELD
- See Also:
- Constant Field Values
-
CLASS_FIELD
public static final java.lang.String CLASS_FIELD
- See Also:
- Constant Field Values
-
ISDBDATA_FIELD
public static final java.lang.String ISDBDATA_FIELD
- See Also:
- Constant Field Values
-
AUTHORID_FIELD
public static final java.lang.String AUTHORID_FIELD
- See Also:
- Constant Field Values
-
OPAUTHORID_FIELD
public static final java.lang.String OPAUTHORID_FIELD
- See Also:
- Constant Field Values
-
PSTATUS_FIELD
public static final java.lang.String PSTATUS_FIELD
- See Also:
- Constant Field Values
-
WORKSPACEID_FIELD
public static final java.lang.String WORKSPACEID_FIELD
- See Also:
- Constant Field Values
-
CATEGORYID_FIELD
public static final java.lang.String CATEGORYID_FIELD
- See Also:
- Constant Field Values
-
CLASSIFICATIONLEVEL_FIELD
public static final java.lang.String CLASSIFICATIONLEVEL_FIELD
- See Also:
- Constant Field Values
-
CDATE_FIELD
public static final java.lang.String CDATE_FIELD
- See Also:
- Constant Field Values
-
MDATE_FIELD
public static final java.lang.String MDATE_FIELD
- See Also:
- Constant Field Values
-
UDATE_FIELD
public static final java.lang.String UDATE_FIELD
- See Also:
- Constant Field Values
-
PDATE_FIELD
public static final java.lang.String PDATE_FIELD
- See Also:
- Constant Field Values
-
SDATE_FIELD
public static final java.lang.String SDATE_FIELD
- See Also:
- Constant Field Values
-
EDATE_FIELD
public static final java.lang.String EDATE_FIELD
- See Also:
- Constant Field Values
-
ADATE_FIELD
public static final java.lang.String ADATE_FIELD
- See Also:
- Constant Field Values
-
VERSION_FIELD
public static final java.lang.String VERSION_FIELD
- See Also:
- Constant Field Values
-
FILEDOCUMENT_CONTENT_TYPE_FIELD
public static final java.lang.String FILEDOCUMENT_CONTENT_TYPE_FIELD
Field name for the extension of the file , e.g. "txt", or IOUtil.getExtension(fileDoc.getFile())- See Also:
- Constant Field Values
-
FILEDOCUMENT_FILE_EXTENSION_FIELD
public static final java.lang.String FILEDOCUMENT_FILE_EXTENSION_FIELD
Field name for the extension of the file , e.g. "txt", or IOUtil.getExtension(fileDoc.getFile())- See Also:
- Constant Field Values
-
FILEDOCUMENT_FILENAME_FIELD
public static final java.lang.String FILEDOCUMENT_FILENAME_FIELD
Field name for the relative path in jcms, e.g. "upload/docs/file.txt", or fileDoc.getFilename()- See Also:
- Constant Field Values
-
FILEDOCUMENT_ORIGINAL_FILENAME_FIELD
public static final java.lang.String FILEDOCUMENT_ORIGINAL_FILENAME_FIELD
Field name for the original filename as upload by user eg "My file.txt", or fileDoc.getOriginalFilename()- See Also:
- Constant Field Values
-
FILEDOCUMENT_MODIFIED_FIELD
public static final java.lang.String FILEDOCUMENT_MODIFIED_FIELD
Field name for the last modified date of the file (time in ms) when it was indexed- See Also:
- Constant Field Values
-
FILEDOCUMENT_INDEXING_DATE_FIELD
public static final java.lang.String FILEDOCUMENT_INDEXING_DATE_FIELD
Field name for the date at which the FileDocument has been indexed with a non empty content- See Also:
- Constant Field Values
-
FILEDOCUMENT_CONTENT
public static final java.lang.String FILEDOCUMENT_CONTENT
Field name for the content of the file as extracted with additionnal parser in FileProcessor- See Also:
- Constant Field Values
-
HITS_TIMEOUT_PROP
public static final java.lang.String HITS_TIMEOUT_PROP
- See Also:
- Constant Field Values
-
dateFormatter
public static final java.text.DateFormat dateFormatter
-
HITS_TIMEOUT
protected static final long HITS_TIMEOUT
-
spellSuggestEngine
protected SpellSuggestEngine spellSuggestEngine
-
LIMIT_REACHED_DURING_JSTORE_SEARCH
public static final java.lang.String LIMIT_REACHED_DURING_JSTORE_SEARCH
QueryHandler attribute set (to boolean value) if the maximum number of lucene result authorized (as specified by propertyquery.lucene.pub.max-results) was reached during JStore search.- Since:
- JCMS-6660
- See Also:
- Constant Field Values
-
TOTAL_HITS_DURING_JSTORE_SEARCH
public static final java.lang.String TOTAL_HITS_DURING_JSTORE_SEARCH
QueryHandler attribute set to Long value indicating the total number of hits found in the lucene index for current JStore search.- Since:
- JCMS-6660, Long used since JCMS-7415 (was Integer before)
- See Also:
- Constant Field Values
-
LIMIT_REACHED_DURING_DB_SEARCH
public static final java.lang.String LIMIT_REACHED_DURING_DB_SEARCH
QueryHandler attribute set (to boolean value) if the maximum number of lucene result authorized (as specified by propertyquery.lucene.pub.max-results) was reached during DB search.- Since:
- JCMS-6660
- See Also:
- Constant Field Values
-
TOTAL_HITS_DURING_DB_SEARCH
public static final java.lang.String TOTAL_HITS_DURING_DB_SEARCH
QueryHandler attribute set to Long value indicating the total number of hits found in the lucene index for current DB search.- Since:
- JCMS-6660, Long used since JCMS-7415 (was Integer before)
- See Also:
- Constant Field Values
-
-
Method Detail
-
add
public void add(Publication pub)
Add givenPublicationto this lucene search engine. This method is asynchronous, the given data may not be (and will certainly not be) added immediately after call.- Specified by:
addin interfacePublicationSearchEngine- Parameters:
pub- thePublicationto index .
-
update
public void update(Publication pub)
Update givenPublicationin this lucene search engine. This method is asynchronous, the given data may not be (and will certainly not be) updated immediately after call.- Specified by:
updatein interfacePublicationSearchEngine- Parameters:
pub- thePublicationto reindex .
-
delete
public void delete(Publication pub)
Delete givenPublicationfrom this lucene search engine. This method is asynchronous, the given data may not be (and will certainly not be) deleted immediately after call.- Specified by:
deletein interfacePublicationSearchEngine- Parameters:
pub- thePublicationto reindex .
-
add
public void add(java.util.Collection<? extends Publication> coll)
Add givenCollectionofPublicationto this lucene search engine. This method is asynchronous, the given datas may not be (and will certainly not be) added immediately after call.- Specified by:
addin interfacePublicationSearchEngine- Parameters:
coll- theCollectionofPublicationto index .
-
update
public void update(java.util.Collection<? extends Publication> coll)
Update givenCollectionofPublicationin this lucene search engine. This method is asynchronous, the given datas may not be (and will certainly not be) updated immediately after call.- Specified by:
updatein interfacePublicationSearchEngine- Parameters:
coll- theCollectionofPublicationto reindex .
-
delete
public void delete(java.util.Collection<? extends Publication> coll)
Delete givenCollectionofPublicationfrom this lucene search engine. This method is asynchronous, the given datas may not be (and will certainly not be) deleted immediately after call.- Specified by:
deletein interfacePublicationSearchEngine- Parameters:
coll- theCollectionofPublicationto reindex .
-
getIndexingDate
public java.util.Date getIndexingDate(Publication pub)
Retrieve the Date at which the specified Publication was indexed in the search engine.- Specified by:
getIndexingDatein interfacePublicationSearchEngine- Parameters:
pub- thePublicationfor which to retrieve the indexing date.- Returns:
- the indexing date of the publication or null if was not indexed.
- Since:
- jcms-6.0.1
-
getReindexAllAction
protected AdminSearchEnginesHandler.Action getReindexAllAction()
Description copied from class:LuceneDataSearchEngineRetrieve the Action to use when starting aAdminSearchEngineProcessfor full reindexing.- Specified by:
getReindexAllActionin classLuceneDataSearchEngine- Returns:
-
search
public boolean search(QueryHandler qh, java.util.HashSet<? extends Publication> pubSet, QueryResultSet resultSet)
Search for JStorePublicationusing lucene search engine.- Perform lucene text search using of
QueryHandler.getText()which is required. - Add
Publicationinto returned Set only if they are already in the givenpubSetor ifpubSetis null. - Caution! This method ignores all JcmsDB Publication.
- Specified by:
searchin interfacePublicationSearchEngine- Parameters:
qh- the Queryhandler in which to find search text and search options.pubSet- a HashSet containing all thePublicationto search.
if empty, search is not performed at all.
if null, allPublicationfound will be returned.
This set MUST NOT be modified by implementation.resultSet- theQueryResultSetthat must be filled with matchingPublication- Returns:
- true if a search was performed in the PublicationSearchEngine. Useful to differenciate a query returning zero result from a query not performed due to missing paramerters (text for example).
- Since:
- jcms-5.5.0
- Perform lucene text search using of
-
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.pub.max-results- Returns:
- a maximum number of result retrieve (result beyong this limit are ignored)
- Since:
- jcms-10.0.0
-
search
public java.util.LinkedHashMap<java.lang.String,java.lang.Float> search(QueryHandler qh)
Search for JcmsDBPublicationusing lucene search engine.- Perform lucene text search using of
QueryHandler.getText()which is required. - Add
Publicationinto returned Set only if they are already in the givenpubSetor ifpubSetis null. - Caution! This method ignores all JStore Publication.
- Specified by:
searchin interfacePublicationSearchEngine- Parameters:
qh- the Queryhandler in which to find search text and search options.- Returns:
- a map of publication id and their score.
- Perform lucene text search using of
-
getSpellSuggestEngine
public SpellSuggestEngine getSpellSuggestEngine()
-
getLogger
protected org.apache.log4j.Logger getLogger()
Description copied from class:LuceneDataSearchEngineThis methods must be implemented by the LuceneSearchEngine. It must return the logger to be used for log messages.- Specified by:
getLoggerin classLuceneDataSearchEngine- Returns:
Loggerof this engine.
-
getDataIterator
protected DataIterator<Data> getDataIterator(LuceneDataSearchEngine.ReindexOptions options)
Description copied from class:LuceneDataSearchEngineThis methods must be implemented by the LuceneSearchEngine. It must return a DataIterator used to iterate on Data to index. Used byLuceneDataSearchEngine.reindex(ReindexOptions).- Specified by:
getDataIteratorin classLuceneDataSearchEngine
-
indexData
protected void indexData(org.apache.lucene.index.IndexWriter writer, Data data, java.lang.String lang) throws java.io.IOExceptionThis methods index the given publication in the given language, into the given index writer.- Specified by:
indexDatain classLuceneDataSearchEngine- Throws:
java.io.IOException
-
addTextFieldStored
public void addTextFieldStored(org.apache.lucene.document.Document doc, Publication pub, java.lang.String lang, java.lang.String fieldName, java.lang.String fieldValue)This methods create a stored LuceneFieldwith the given field's value of the givenPublicationin the given language, and add into the givenDocument.- Parameters:
doc- the lucene Document in which field will be addedpub- the publication for which field is addedlang- the language in which field is added, if relevantfieldName- the name of the field in the lucene indexfieldValue- the value of the field in the lucene index
-
addTextFieldNotStored
public void addTextFieldNotStored(org.apache.lucene.document.Document doc, Publication pub, java.lang.String lang, java.lang.String fieldName, java.lang.String fieldValue)This methods create a unstored LuceneFieldwith the given field's value of the givenPublicationin the given language, and add into the givenDocument.- Parameters:
doc- the lucene Document in which field will be addedpub- the publication for which field is addedlang- the language in which field is added, if relevantfieldName- the name of the field in the lucene indexfieldValue- the value of the field in the lucene index
-
addStringFieldStored
public void addStringFieldStored(org.apache.lucene.document.Document doc, Publication pub, java.lang.String lang, java.lang.String fieldName, java.lang.String fieldValue)This methods create a stored LuceneFieldwith the given field's value of the givenPublicationin the given language, and add into the givenDocument.- Parameters:
doc- the lucene Document in which field will be addedpub- the publication for which field is addedlang- the language in which field is added, if relevantfieldName- the name of the field in the lucene indexfieldValue- the value of the field in the lucene index
-
addStringFieldNotStored
public void addStringFieldNotStored(org.apache.lucene.document.Document doc, Publication pub, java.lang.String lang, java.lang.String fieldName, java.lang.String fieldValue)This methods create a unstored and untokenized LuceneFieldwith the given field's value of the givenPublicationin the given language, and add into the givenDocument.- Parameters:
doc- the lucene Document in which field will be addedpub- the publication for which field is addedlang- the language in which field is added, if relevantfieldName- the name of the field in the lucene indexfieldValue- the value of the field in the lucene index
-
-