Package sk.iway.iwcm.rag.service
Class IndexQueueService
java.lang.Object
sk.iway.iwcm.rag.service.IndexQueueService
Service for managing the RAG indexing queue.
Provides methods to add, remove, and query entries in the rag_index_queue table.
Entries are processed asynchronously by
RagIndexCronTask.-
Constructor Summary
ConstructorsConstructorDescriptionIndexQueueService(IndexQueueRepository queueRepository, EmbeddingChunkRepository chunkRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToQueue(int entityId, RagEntityType entityType, RagIndexAction action, int domainId) Add a single entity to the indexing queue.voidaddToQueue(List<Integer> entityIds, RagEntityType entityType, RagIndexAction action, int domainId) Add multiple entities to the indexing queue.getQueued(RagEntityType entityType, RagIndexAction action, Integer domainId) Get the list of entity IDs currently queued for the given entity type, action and domain.
-
Constructor Details
-
IndexQueueService
@Autowired public IndexQueueService(IndexQueueRepository queueRepository, EmbeddingChunkRepository chunkRepository)
-
-
Method Details
-
addToQueue
public void addToQueue(List<Integer> entityIds, RagEntityType entityType, RagIndexAction action, int domainId) Add multiple entities to the indexing queue. Removes any existing queue entries for these entities first. For DELETE actions, only entities that actually have stored chunks are queued.- Parameters:
entityIds- list of entity IDs to queueentityType- the entity type (e.g. DOCUMENT)action- the action to perform (INDEX or DELETE)domainId- the domain ID- Throws:
IllegalArgumentException- if any parameter is invalid
-
addToQueue
Add a single entity to the indexing queue. Removes any existing queue entry for this entity first.- Parameters:
entityId- the entity ID to queueentityType- the entity type (e.g. DOCUMENT)action- the action to perform (INDEX or DELETE)domainId- the domain ID- Throws:
IllegalArgumentException- if any parameter is invalid
-
getQueued
Get the list of entity IDs currently queued for the given entity type, action and domain.- Parameters:
entityType- the entity type to filter byaction- the action to filter bydomainId- the domain ID to filter by- Returns:
- list of queued entity IDs
- Throws:
IllegalArgumentException- if any parameter is invalid
-