Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
21
RediSearch is a Redis module providing full-text search, secondary indexing, and vector similarity search.
Sign in to like and favorite skills
RediSearch is a Redis module providing full-text search, secondary indexing, and vector similarity search. The primary development focus is porting C code from
src/ to Rust in src/redisearch_rs/.
./build.sh # Full build (C + Rust) ./build.sh DEBUG=1 # Debug build ./build.sh FORCE # Rebuild discarding previous artifacts
./build.sh RUN_UNIT_TESTS # C/C++ unit tests ./build.sh RUN_UNIT_TESTS TEST=unit_test_name # Specific C/C++ unit tests ./build.sh RUN_PYTEST # Python behavioral tests ./build.sh RUN_PYTEST TEST=test_name # Specific Python test cargo nextest run # Rust tests, from `src/redisearch_rs/` cargo +nightly miri test # Rust tests under `miri`, from `src/redisearch_rs/`
Run Rust tests from workspace root (
src/redisearch_rs/):
# All Rust tests cd src/redisearch_rs && cargo nextest run # Rust tests for a specific crate cd src/redisearch_rs && cargo nextest run -p <crate_name>
make lint # Run clippy and cargo doc checks make fmt # Format all code make fmt CHECK=1 # Check formatting without changes cd src/redisearch_rs && cargo license-fix # Add missing license headers
unsafe blocks with // SAFETY: comments#[expect(...)] over #[allow(...)] for lint suppressionstracing macros for logging (debug!, info!, warn!, error!)int* p;)src/ # C source code (being ported) src/redisearch_rs/ # Rust codebase ├── ... # New Rust-native functionality ├── ffi/ # Rust bindings for C types and functions ├── headers/ # Autogenerated C headers for Rust types and functions in *_ffi crates ├── c_entrypoint/ # FFI layer (C bindings for Rust types and functions) │ └── *_ffi/ # Per-module FFI crates │ └── redisearch_rs/ # Entrypoint for Rust-native functionality used by the C codebase └── Cargo.toml # Workspace root
Each ported module has a corresponding
*_ffi crate in c_entrypoint/:
src/redisearch_rs/ ├── trie_rs/ # Pure Rust implementation └── c_entrypoint/ └── triemap_ffi/ # C-callable wrapper
Follow /rust-docs-guidelines when writing documentation for Rust code. Invoke /port-c-module to plan the porting of a C module. Invoke /write-rust-tests to add tests to Rust code. Invoke /verify to verify the correctness of your work before wrapping up.
/* * Copyright (c) 2006-Present, Redis Ltd. * All rights reserved. * * Licensed under your choice of the Redis Source Available License 2.0 * (RSALv2); or (b) the Server Side Public License v1 (SSPLv1); or (c) the * GNU Affero General Public License v3 (AGPLv3). */