fix: default 'search_type' to 'None' in 'client.search.search'
Apply 'hybrid' default only for text queries.
This commit is contained in:
parent
5079205d3d
commit
b331dd0b76
1 changed files with 7 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue