Skip to content

Commit

Permalink
Fix the issue of incorrect vector returns in combined search
Browse files Browse the repository at this point in the history
  • Loading branch information
pk5ls20 committed Jul 2, 2024
1 parent 7f0e76a commit 8a6111d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Controllers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def calculate_and_sort_by_combined_scores(model: CombinedSearchModel,
case SearchBasisEnum.ocr:
extra_vector = itm.img.image_vector
case SearchBasisEnum.vision:
extra_vector = itm.img.text_contain_vector if itm.img.text_contain_vector else None
extra_vector = itm.img.text_contain_vector
case _: # pragma: no cover
raise NotImplementedError()
if extra_vector is not None:
Expand Down
2 changes: 1 addition & 1 deletion app/Services/vector_db_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async def querySimilar(self,
mode == SearchModelEnum.average else RecommendStrategy.BEST_SCORE)
# since only combined_search need return vectors, We can define _combined_search_need_vectors like below
_combined_search_need_vectors = [
self.IMG_VECTOR if query_vector_name == self.TEXT_VECTOR else self.IMG_VECTOR] if with_vectors else None
self.IMG_VECTOR if query_vector_name == self.TEXT_VECTOR else self.TEXT_VECTOR] if with_vectors else None
logger.info("Querying Qdrant... top_k = {}", top_k)
result = await self._client.recommend(collection_name=self.collection_name,
using=query_vector_name,
Expand Down

0 comments on commit 8a6111d

Please sign in to comment.