Search in sources :

Example 1 with DeleteAssociated

use of io.zulia.client.command.DeleteAssociated in project zuliasearch by zuliaio.

the class FileStorageTest method storeFile.

private void storeFile(String documentId, String filename, Document meta, byte[] content) throws Exception {
    zuliaWorkPool.delete(new DeleteAssociated(documentId, TEST_INDEX, filename));
    if (content.length > 32 * 1024 * 1024) {
        StoreLargeAssociated storeLargeAssociated = new StoreLargeAssociated(documentId, TEST_INDEX, filename, content);
        storeLargeAssociated.setMeta(meta);
        zuliaWorkPool.storeLargeAssociated(storeLargeAssociated);
    } else {
        Store associatedDocStore = new Store(documentId, TEST_INDEX);
        associatedDocStore.addAssociatedDocument(AssociatedBuilder.newBuilder().setDocument(content).setFilename(filename).setMetadata(meta));
        zuliaWorkPool.store(associatedDocStore);
    }
}
Also used : Store(io.zulia.client.command.Store) StoreLargeAssociated(io.zulia.client.command.StoreLargeAssociated) DeleteAssociated(io.zulia.client.command.DeleteAssociated)

Aggregations

DeleteAssociated (io.zulia.client.command.DeleteAssociated)1 Store (io.zulia.client.command.Store)1 StoreLargeAssociated (io.zulia.client.command.StoreLargeAssociated)1