Class LuceneArchiveEngine

java.lang.Object
com.jalios.jcms.archive.LuceneArchiveEngine
All Implemented Interfaces:
ArchiveEngine, JcmsConstants, JaliosConstants

@Deprecated(since="11.0 / JCMS-8887", forRemoval=true) public class LuceneArchiveEngine extends Object implements ArchiveEngine, JcmsConstants
Deprecated, for removal: This API element is subject to removal in a future version.
Since:
jcms-4.1.1
Author:
Olivier Jaquemet
  • Constructor Details

    • LuceneArchiveEngine

      public LuceneArchiveEngine()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • init

      public void init() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Initialize Lucene Index
      Specified by:
      init in interface ArchiveEngine
      Throws:
      Exception
    • getDirectory

      public org.apache.lucene.store.FSDirectory getDirectory()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the lucene directory used by this LuceneArchiveEngine.
      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.
    • indexPublication

      public void indexPublication(Publication pub, ArchivedPublication archive) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Index a Publication
      Specified by:
      indexPublication in interface ArchiveEngine
      Parameters:
      pub - the Publication to index
      archive - the newly created ArchivedPublication corresponding
      Throws:
      Exception
    • search

      public Set<Long> search(String text, String mode)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Perform a full-text search on archives.
      Specified by:
      search in interface ArchiveEngine
      Parameters:
      text - the text to search
      mode - the search mode
      Returns:
      a Set of Long (the rowid of the matching ArchivedPublication)
      Since:
      jcms-6.0
    • getMaximumResults

      public static int getMaximumResults()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Retrieve the maximum number of results allowed to be return for a search.

      Can be configured using property query.lucene.archive.max-results

      Returns:
      a maximum number of result retrieve (result beyong this limit are ignored)
    • getLuceneQuery

      public static String getLuceneQuery(String text, String mode)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a lucene query from the given parameters.

      Very naive implementation.

      Parameters:
      text - the search string
      mode - the query mode (all, any, word, exact)
      Returns:
      a String which contains the lucene-compliant query
    • deleteArchiveIndex

      public void deleteArchiveIndex(ArchivedPublication pub)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Delete every information associated with the publication
      Specified by:
      deleteArchiveIndex in interface ArchiveEngine
      Parameters:
      pub - the ArchivedPublication being deleted