Skip to content

Commit

Permalink
Merge pull request #484 from microsoft/ryonsteele/6442-search-multi-tag
Browse files Browse the repository at this point in the history
Remove extra tag quoting when passing to search function
  • Loading branch information
dayland committed Feb 3, 2024
2 parents 4494d75 + 214d02a commit 0909c4b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/backend/approaches/chatreadretrieveread.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,10 @@ async def run(self, history: Sequence[dict[str, str]], overrides: dict[str, Any]
else:
search_filter = None
if tags_filter != "" :
quoted_tags_filter = tags_filter.replace(",","','")
if search_filter is not None:
search_filter = search_filter + f" and tags/any(t: search.in(t, '{quoted_tags_filter}', ','))"
search_filter = search_filter + f" and tags/any(t: search.in(t, '{tags_filter}', ','))"
else:
search_filter = f"tags/any(t: search.in(t, '{quoted_tags_filter}', ','))"
search_filter = f"tags/any(t: search.in(t, '{tags_filter}', ','))"

# Hybrid Search
# r = self.search_client.search(generated_query, vector_queries =[vector], top=top)
Expand Down

0 comments on commit 0909c4b

Please sign in to comment.