Skip to content

Commit

Permalink
Fixed test search and removed redundant test
Browse files Browse the repository at this point in the history
Fixed search criteria and removed the final test that was redundant WRT prior test
  • Loading branch information
chimezie committed Nov 30, 2023
1 parent ac3cb40 commit 9eb65d8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions test/embedding/test_pgvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,12 @@ async def test_PGv_search_filtered():
assert sim_search is not None, Exception("No results returned from filtered search")

#Test conjunctive semantics
await vDB.insert(content='Foo', title='Some text', page_numbers=[1], tags=['tag1'])
await vDB.insert(content='Baz', title='Some mo text', page_numbers=[1], tags=['tag2', 'tag3'])
await vDB.insert(content='Bar', title='Even mo text', page_numbers=[1], tags=['tag3'])
await vDB.insert(content='Text', title='Some text', page_numbers=[1], tags=['tag1'])
await vDB.insert(content='Text', title='Some mo text', page_numbers=[1], tags=['tag2', 'tag3'])
await vDB.insert(content='Text', title='Even mo text', page_numbers=[1], tags=['tag3'])

sim_search = await vDB.search(query_string='text', query_tags=['tag1', 'tag3'], conjunctive=False)
sim_search = await vDB.search(query_string='Text', query_tags=['tag1', 'tag3'], conjunctive=False)
assert sim_search is not None, Exception("No results returned from filtered search")
assert len(sim_search) == 3, Exception("There should be 3 results")

sim_search = await vDB.search(query_string='text', query_tags=['tag1'], conjunctive=False)
assert sim_search is not None, Exception("No results returned from filtered search")
assert len(sim_search) == 1, Exception("There should be 1 result")
assert len(sim_search) == 3, Exception(f"There should be 3 results, received {sim_search}")

await vDB.drop_table()

0 comments on commit 9eb65d8

Please sign in to comment.