Class EmbeddingService
java.lang.Object
fr.paris.lutece.plugins.wiki.modules.ai.service.rag.EmbeddingService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the entire Elasticsearch index.voidClears the index asynchronouslyGets the current indexing statusRetrieves statistics about the current indexvoidindexBook(fr.paris.lutece.plugins.wiki.business.item.impl.Book book) Indexes a book and all its chapters and pagesvoidindexItem(int itemId) Indexes a single item (Space, Book or Page).voidReindexes all wiki content asynchronouslyvoidreindexSpace(String spaceCode) Triggers an asynchronous reindexation of a single space and all its descendant items.voidremoveBook(int bookId) Removes a book and all its content from the index.voidremovePage(int pageId) Removes a page from the index.voidremoveSpace(int spaceId) Removes a space and all its content from the index.
-
Constructor Details
-
EmbeddingService
public EmbeddingService()
-
-
Method Details
-
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
Triggers an asynchronous reindexation of a single space and all its descendant items.- Parameters:
spaceCode- The code of the space to reindex
-
getIndexStatistics
Retrieves statistics about the current index- Returns:
- A map containing index statistics
-