diff --git a/vechord/pipeline.py b/vechord/pipeline.py index e9848fc..ed98171 100644 --- a/vechord/pipeline.py +++ b/vechord/pipeline.py @@ -93,8 +93,7 @@ async def run_dynamic_pipeline(request: RunRequest, vr: "VechordRegistry"): # n dim = emb.get_dim() index: IndexOption = calls.get("index") search: SearchOption = calls.get("search") - # configure the registry - vr.ns = request.name + vr.reset_namespace(request.name) if index is None and search is None: raise ValueError("No index or search option specified in the request") @@ -133,7 +132,7 @@ class Chunk(_DefaultChunk): vec=vec, doc_id=doc.uid, text=chunks[i], - keyword=Keyword(text=chunks[i]) if use_keyword_index else None, + keyword=Keyword(chunks[i]) if use_keyword_index else None, ) ) return RunAck(name=request.name, msg="succeed", uid=doc.uid) diff --git a/vechord/registry.py b/vechord/registry.py index 107f041..a5146ab 100644 --- a/vechord/registry.py +++ b/vechord/registry.py @@ -78,6 +78,10 @@ async def process_shutdown(self, scope, event): """Falcon ASGI middleware lifespan hook.""" await self.__aexit__(None, None, None) + def reset_namespace(self, namespace: str): + self.ns = namespace + self.client.ns = namespace + async def init_table_index(self, tables: Optional[Iterable[type[Table]]] = None): if tables is None: tables = self.tables