Home > Net >  Filter search results by array of ids
Filter search results by array of ids

Time:11-30

I am planning to implement a search filter by an array of ids using Azure Cognitive search. This array could have up to 1 - 10000 ids and other filters as well. Is the recommended way to filter based on id´s like this?

$filter=Id eq 'ID1' or Id eq 'ID2'

Also I have tride it and I usually hit the filter limit which result in an error so is there anothere way of filtering the search results based on an array of ids

CodePudding user response:

You can use OData search.in function available in Azure Cognitive Search instead of writing this big OR filter. In fact it is the recommended approach.

You can learn more about this function here: https://learn.microsoft.com/en-us/azure/search/search-query-odata-search-in-function.

  • Related