Package com.mindstore.backend.service
Class TextIndexServiceImpl
java.lang.Object
com.mindstore.backend.service.TextIndexServiceImpl
- All Implemented Interfaces:
TextIndexService
Implementation of the TextIndexService interface, implements relevant functions for rest controller
-
Constructor Summary
ConstructorsConstructorDescriptionTextIndexServiceImpl(org.opensearch.client.opensearch.OpenSearchClient client) text index service implementation -
Method Summary
Modifier and TypeMethodDescriptionvoiddeletes a single text document by idvoiddeletes all text documents in the indexbooleanexistsByTitle(String title) function that returns a boolean to indicate if a documents exists by a titlevoidindexText(TextDocument text) used to index texts into the opensearch index
-
Constructor Details
-
TextIndexServiceImpl
public TextIndexServiceImpl(org.opensearch.client.opensearch.OpenSearchClient client) text index service implementation- Parameters:
client- opensearchclient
-
-
Method Details
-
indexText
used to index texts into the opensearch index- Specified by:
indexTextin interfaceTextIndexService- Parameters:
text- the TextDocument we want to index
-
existsByTitle
function that returns a boolean to indicate if a documents exists by a title- Specified by:
existsByTitlein interfaceTextIndexService- Parameters:
title- string- Returns:
- true or false
-
deleteAll
deletes all text documents in the index- Specified by:
deleteAllin interfaceTextIndexService- Throws:
IOException- when deletion fails
-
delete
deletes a single text document by id- Specified by:
deletein interfaceTextIndexService- Parameters:
id- - the textDocument id to delete- Throws:
IOException- when deletion fails
-