public class InMemoryRepository extends java.lang.Object implements RepositoryStorable, RepositoryLifecycle
构造器和说明 |
---|
InMemoryRepository(EmbeddingModel embeddingModel) |
限定符和类型 | 方法和说明 |
---|---|
void |
deleteById(java.lang.String... ids)
删除文档
|
void |
dropRepository()
注销仓库
|
boolean |
existsById(java.lang.String id)
是否存在文档
|
void |
initRepository()
初始化仓库
|
void |
save(java.util.List<Document> documents,
java.util.function.BiConsumer<java.lang.Integer,java.lang.Integer> progressCallback)
保存文档
|
java.util.List<Document> |
search(QueryCondition condition)
检索
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asyncInsert, asyncSave, delete, exists, insert, insert, insert, save, save
search
public InMemoryRepository(EmbeddingModel embeddingModel)
public void save(java.util.List<Document> documents, java.util.function.BiConsumer<java.lang.Integer,java.lang.Integer> progressCallback) throws java.io.IOException
RepositoryStorable
save
在接口中 RepositoryStorable
documents
- 文档集progressCallback
- 进度回调java.io.IOException
public void initRepository()
RepositoryLifecycle
initRepository
在接口中 RepositoryLifecycle
public void dropRepository()
RepositoryLifecycle
dropRepository
在接口中 RepositoryLifecycle
public void deleteById(java.lang.String... ids)
RepositoryStorable
deleteById
在接口中 RepositoryStorable
ids
- 文档IDspublic boolean existsById(java.lang.String id)
RepositoryStorable
existsById
在接口中 RepositoryStorable
id
- 文档IDpublic java.util.List<Document> search(QueryCondition condition) throws java.io.IOException
Repository
search
在接口中 Repository
condition
- 查询条件java.io.IOException