I have recently upgraded Elasticsearch.Net and NEST in my application from Version 5.5.0 to 7.5.1 and I am getting a bunch of build errors. I've managed to resolve some of them but the following ones remain unclear to me:
1) ElasticLowLevelClient.Msearch
MultiSearchRequest multiSearchRequest = new MultiSearchRequest { Operations = operations };
MultiSearchResponseData response = Converter.ToMultiSearchResponseData(client.Msearch<byte[]>("articles", multiSearchRequest));
Where operations is of type Dictionary<string, Nest.ISearchRequest>, I am getting the following error:
Severity Code Description Project File Line Suppression State Error CS1061 'ElasticLowLevelClient' does not contain a definition for 'Msearch' and no accessible extension method 'Msearch' accepting a first argument of type 'ElasticLowLevelClient' could be found (are you missing a using directive or an assembly reference?)
2) Elasticsearch.Net.PostData
SearchRequest request = new SearchRequest
{
Size = 1,
Query = new QueryStringQuery { DefaultField = new Field("urlName"), Query = "(" + articleUrl + ")" },
};
ElasticsearchResponse<string> response = client.Search<string>("detailarticle", new PostData<object>(request));
I am getting the following error:
Severity Code Description Project File Line Suppression State Error CS1729 'PostData' does not contain a constructor that takes 1 arguments
3) BulkUpdateOperation and PostDate:
public void UpdateArticlesIndex(IEnumerable<ArticleUpdateModel> articles)
{
if (articles == null || articles.Count() == 0)
return;
List<IBulkOperation> operations = new List<IBulkOperation>();
foreach (var a in articles)
{
operations.Add(new BulkUpdateOperation<object, object>(a.DocumentId)
{
Index = "articles",
Type = "_doc",
Doc = a.Value,
});
}
BulkRequest request = new BulkRequest
{
Operations = operations,
};
client.Bulk<string>(new PostData<object>(request));
}
I am getting the following two erros:
Severity Code Description Project File Line Suppression State Error CS0117 'BulkUpdateOperation<object, object>' does not contain a definition for 'Type'
and
Severity Code Description Project File Line Suppression State Error CS1729 'PostData' does not contain a constructor that takes 1 arguments
I have tried messing with constructors and altering declarations but it did not yield any desired results. I have also looked into Elasticsearch documentation but did not find anything relevant
Any help about resolving those build errors would be highly appreciated