Add OpenSearch search backend with hybrid neural+BM25 support
Extract a SearchBackend trait from the existing RocksDB search code and add an OpenSearch implementation supporting cross-room search, relevance ranking, fuzzy matching, English stemming, and optional hybrid neural+BM25 semantic search using sentence-transformers. Fix macOS build by gating RLIMIT_NPROC and getrusage to supported platforms.
This commit is contained in:
@@ -116,6 +116,22 @@ pub fn check(config: &Config) -> Result {
|
||||
});
|
||||
}
|
||||
|
||||
if config.search_backend == super::SearchBackendConfig::OpenSearch
|
||||
&& config.search_opensearch_url.is_none()
|
||||
{
|
||||
return Err!(Config(
|
||||
"search_opensearch_url",
|
||||
"OpenSearch URL must be set when search_backend is \"opensearch\""
|
||||
));
|
||||
}
|
||||
|
||||
if config.search_opensearch_hybrid && config.search_opensearch_model_id.is_none() {
|
||||
return Err!(Config(
|
||||
"search_opensearch_model_id",
|
||||
"Model ID must be set when search_opensearch_hybrid is enabled"
|
||||
));
|
||||
}
|
||||
|
||||
// rocksdb does not allow max_log_files to be 0
|
||||
if config.rocksdb_max_log_files == 0 {
|
||||
return Err!(Config(
|
||||
|
||||
Reference in New Issue
Block a user