fix: correct Azure AI search _in delimiter #1729
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.