Skip to content

fix: correct Azure AI search _in delimiter #1729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 4, 2025
Merged

Conversation

sggerard
Copy link
Contributor

https://learn.microsoft.com/en-us/azure/search/search-query-odata-search-in-function

The azure search.in() filter accepts a list of strings to match against. However the way that the function to normalize the haystack 'in' operator to the azure 'in' operator appears to be incorrect. Despite some of the documentation Microsoft has provided it appears we do need to provide the delimiter to use (In this case ',') as the third parameter.

image

Proposed Changes:

Specify the delimiter to use when building the search.in string.
Remove the extra space used in the join function that would prevent matching.

How did you test it?

I identified this bug when some of my project filters were failing and I couldn't see any reason as to why. I identified this as the issue and after some local debugging and hot fixing the library, and have concluded that at least for my project/ use case this is the appropriate fix.

Notes for the reviewer

This has only been tested against my haystack project and Azure AI search and is no means exhaustive.

@sggerard sggerard requested a review from a team as a code owner May 13, 2025 02:22
@sggerard sggerard requested review from vblagoje and removed request for a team May 13, 2025 02:22
@CLAassistant
Copy link

CLAassistant commented May 13, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@Amnah199 Amnah199 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG! @sggerard Thanks for the fix!

@Amnah199 Amnah199 merged commit 8e5fda8 into deepset-ai:main Jun 4, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants