Class EmbeddingService

java.lang.Object
fr.paris.lutece.plugins.wiki.modules.ai.service.rag.EmbeddingService

@ApplicationScoped public class EmbeddingService extends Object
  • Constructor Details

    • EmbeddingService

      public EmbeddingService()
  • Method Details

    • getIndexingStatus

      public IndexingStatus getIndexingStatus()
      Gets the current indexing status
      Returns:
      The indexing status
    • indexBook

      public void indexBook(fr.paris.lutece.plugins.wiki.business.item.impl.Book book)
      Indexes a book and all its chapters and pages
      Parameters:
      book - The book to index
    • indexItem

      public void indexItem(int itemId)
      Indexes a single item (Space, Book or Page). Throws on failure, so the daemon keeps the action queued and replays it on its next run.
      Parameters:
      itemId - The item ID
    • removeBook

      public void removeBook(int bookId)
      Removes a book and all its content from the index. Throws on failure, so the daemon keeps the action queued and replays it once Elasticsearch answers again.
      Parameters:
      bookId - The ID of the book to remove
    • removePage

      public void removePage(int pageId)
      Removes a page from the index. Throws on failure, so the daemon keeps the action queued and replays it once Elasticsearch answers again.
      Parameters:
      pageId - The ID of the page to remove
    • removeSpace

      public void removeSpace(int spaceId)
      Removes a space and all its content from the index. Throws on failure, so the daemon keeps the action queued and replays it once Elasticsearch answers again.
      Parameters:
      spaceId - The ID of the space to remove
    • clearIndex

      public void clearIndex()
      Clears the entire Elasticsearch index. Throws on failure, so a reindexation against an unreachable server aborts at once instead of failing item by item.
    • clearIndexAsync

      public void clearIndexAsync()
      Clears the index asynchronously
    • reindexAll

      public void reindexAll()
      Reindexes all wiki content asynchronously
    • reindexSpace

      public void reindexSpace(String spaceCode)
      Triggers an asynchronous reindexation of a single space and all its descendant items.
      Parameters:
      spaceCode - The code of the space to reindex
    • getIndexStatistics

      public Map<String,Object> getIndexStatistics()
      Retrieves statistics about the current index
      Returns:
      A map containing index statistics