diff --git a/haiku_rag_slim/haiku/rag/client/search.py b/haiku_rag_slim/haiku/rag/client/search.py index 5886c421..7d5592d8 100644 --- a/haiku_rag_slim/haiku/rag/client/search.py +++ b/haiku_rag_slim/haiku/rag/client/search.py @@ -15,7 +15,7 @@ async def search( client: "HaikuRAG", query: "str | bytes | PILImage.Image", limit: int | None = None, - search_type: SearchType = "hybrid", + search_type: SearchType | None = None, filter: str | None = None, include_images: bool = True, ) -> list[SearchResult]: @@ -26,7 +26,8 @@ async def search( query: Text (``str``) or image (``bytes`` / ``PIL.Image.Image``). Image queries require a multimodal embedder and run vector-only. limit: Maximum number of results to return. Defaults to config.search.limit. - search_type: "vector", "fts", or "hybrid" (default). Text queries only. + search_type: "vector", "fts", or "hybrid". + Applicable onlly for text queries, where the default is "hybrid". filter: Optional SQL WHERE clause to filter documents before searching chunks. include_images: When True, populate ``SearchResult.image_data`` with base64 picture bytes for picture-labeled chunks. @@ -38,6 +39,10 @@ async def search( limit = client._config.search.limit if isinstance(query, str): + + if search_type is None: + search_type = "hybrid" + reranker = get_reranker(config=client._config) if reranker is None: