Skip to content

Commit

Permalink
return no results with empty search string (#206)
Browse files Browse the repository at this point in the history
* return no results with empty search string

* update

* bump version
  • Loading branch information
prasmussen15 authored Nov 4, 2024
1 parent b8f5267 commit 6536401
Show file tree
Hide file tree
Showing 3 changed files with 461 additions and 454 deletions.
6 changes: 6 additions & 0 deletions graphiti_core/search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ async def search(
bfs_origin_node_uuids: list[str] | None = None,
) -> SearchResults:
start = time()
if query.strip() == '':
return SearchResults(
edges=[],
nodes=[],
communities=[],
)
query_vector = await embedder.create(input_data=[query.replace('\n', ' ')])

# if group_ids is empty, set it to None
Expand Down
Loading

0 comments on commit 6536401

Please sign in to comment.