@@ -94,6 +94,8 @@ def test_find_by_text(storage, config, start_storage):
9494 assert isinstance (results , DocumentArray )
9595 assert len (results ) == 2
9696 assert set (results [:, 'id' ]) == {'1' , '3' }
97+ results = da .find ('token3 token4' , limit = 1 )
98+ assert len (results ) == 1
9799
98100 results = da .find (['token4' , 'token' ])
99101 assert isinstance (results , list )
@@ -109,7 +111,7 @@ def test_find_by_text(storage, config, start_storage):
109111 ('elasticsearch' , {'n_dim' : 32 , 'tag_indices' : ['attr1' , 'attr2' , 'attr3' ]}),
110112 ],
111113)
112- def test_find_by_tag (storage , config ):
114+ def test_find_by_tag (storage , config , start_storage ):
113115 da = DocumentArray (storage = storage , config = config )
114116 da .extend (
115117 [
@@ -146,6 +148,9 @@ def test_find_by_tag(storage, config):
146148 assert results [0 ].id == '1'
147149 assert results [1 ].id == '2'
148150
151+ results = da .find ('token1 token2' , index = 'attr1' , limit = 1 )
152+ assert len (results ) == 1
153+
149154 results = da .find ('token2 token4' , index = 'attr1' )
150155 assert len (results ) == 2
151156 assert set (results [:, 'id' ]) == {'1' , '3' }
@@ -159,6 +164,9 @@ def test_find_by_tag(storage, config):
159164 assert results [0 ].id == '2'
160165 assert results [1 ].id == '1'
161166
167+ results = da .find ('token6' , index = 'attr3' , limit = 1 )
168+ assert len (results ) == 1
169+
162170 results = da .find ('token5' , index = 'attr3' )
163171 assert len (results ) == 2
164172 assert set (results [:, 'id' ]) == {'1' , '3' }
0 commit comments