C# 如何在azure搜索列表中添加包含逻辑<;int>;

C# 如何在azure搜索列表中添加包含逻辑<;int>;,c#,asp.net-core,azure-search-.net-sdk,C#,Asp.net Core,Azure Search .net Sdk,这是我在azure搜索索引上的文档。。。我有集合列表followedUsers=new List(){1,3};。。。我想在azure搜索中实现的是这样的 { "@search.score": 1, "id": "1", "FullName": "Adam", "UserName&quo

这是我在azure搜索索引上的文档。。。我有集合列表followedUsers=new List(){1,3};。。。我想在azure搜索中实现的是这样的

   {
            "@search.score": 1,
            "id": "1",
            "FullName": "Adam",
            "UserName": "Adam1903",
            "IsVerified": true,
            "PartitionKey": "32fbq",
            "IsSearchableUser": true
        }

您可以将所有搜索结果检索到列表中,并使用以下代码按数组列表中的id进行筛选

Select * from User where Id is in(1,2,3)

我不认为它会有用,因为我需要这样的筛选器=$“search.in(id,{string.Join(',',followedUsersId)}”,我希望在搜索时进行筛选,而不是在搜索结果返回后进行筛选。但是如果您希望使用带有筛选器的列表,则需要首先在其中填充筛选器值。为什么不使用
Filter=$“search.in
?var searchParameters=new searchParameters(){SearchFields=new List(){FullName”,“UserName”},Filter=$“search.in(id,{string.Join(',',followeduserids)})”,ScoringProfile=“SearchProfile”};
var s = new List<Search>();
var exceptions = new int[] {1,2,3};
var filtered = s.Where(x=> exceptions.Contains(x.id));
parameters = new SearchParameters()
{
    SearchFields = new[] { "id" }
};
results = indexClient.Documents.Search<Hotel>("1", parameters);