Algolia - Push Data

Following the example of how to push data to algolia, tried to connect only to Algolia with SearchClient, have installed the Algolia with .NET CLI (dotnet add package Algolia.Search) in VS Code.

The code is the follow:

using System;
using System.Threading.Tasks;
using Algolia.Search;
using System.Net.Http;
using Newtonsoft.Json.Linq;

namespace Example
{
    class Program
    {
        static async Task Main(string[] args)
        {
            SearchClient client = new SearchClient("SUMI5AMP4H", "ADMIN API KEY");
            SearchIndex index = client.InitIndex("demo_ecommerce");
            
            Console.WriteLine("Hello World!");
        }
    }
}

with command dotnet run

that returns:

Program.cs(13,13): error CS0246: The type or namespace name
‘SearchClient’ could not be found (are you missing a using directive
or an assembly reference?)

Program.cs(14,13): error CS0246: The type or namespace name
‘SearchIndex’ could not be found (are you missing a using directive or
an assembly reference?)

The project was created with dotnet new console

So having the Algolia.Search package installed how does it not recognize SearchClient and SearchIndex?

the Solution is the follow:

Hello @henrique.corte,

As you discovered, there was an issue with the provided snippet. I’ve just updated it and my colleagues deployed it. You should now see the correct snippets appear on the https://www.algolia.com/doc/onboarding/ page.

Thank you very much for letting us know.

Have a nice day,