mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-06-29 10:13:03 -04:00
* chore: generate embeddings * chore: save embedding * chore: vec sqlite * chore: clippy * chore: init vector * chore: create vector db * chore: periodically write embedding * chore: fix compile * chore: skip write * chore: impl search * fix: test * fix: stop scheduler * fix: search * chore: add test * chore: update schema * chore: index all * chore: index * chore: search document content * chore: index document content and title * chore: index all view * chore: rename trait * refactor: remove folder index manager * chore: index folder changes * chore: delete folder search * chore: update logs * chore: update logs * chore: search * chore: add search test * chore: fmt * chore: fix test * chore: fix ios build
23 lines
464 B
Rust
23 lines
464 B
Rust
mod local_test;
|
|
|
|
mod af_cloud_test;
|
|
|
|
use rand::{distributions::Alphanumeric, thread_rng, Rng};
|
|
|
|
pub fn generate_random_string(len: usize) -> String {
|
|
let rng = rand::thread_rng();
|
|
rng
|
|
.sample_iter(&Alphanumeric)
|
|
.take(len)
|
|
.map(char::from)
|
|
.collect()
|
|
}
|
|
|
|
pub fn generate_random_bytes(size: usize) -> Vec<u8> {
|
|
let s: String = thread_rng()
|
|
.sample_iter(&Alphanumeric)
|
|
.take(size)
|
|
.map(char::from)
|
|
.collect();
|
|
s.into_bytes()
|
|
}
|