GithubHelp home page GithubHelp logo

algolia / algoliasearch-client-csharp Goto Github PK

View Code? Open in Web Editor NEW
118.0 80.0 61.0 5.14 MB

⚡️ A fully-featured and blazing-fast C# API client to interact with Algolia.

Home Page: https://www.algolia.com/doc/api-client/getting-started/install/csharp/

License: MIT License

C# 99.99% Dockerfile 0.01%
c-sharp algolia algolia-search api-client dotnet dotnet-core dotnet-standard csharp search-engine dotnet-library

algoliasearch-client-csharp's Introduction

Algolia for C#

The perfect starting point to integrate Algolia within your .NET project

Nuget CircleCI Licence

DocumentationCommunity ForumStack OverflowReport a bugFAQSupport

✨ Features

  • Targets .NET Standard:
    • .NET Standard 1.3 to .NET Standard 2.1.
    • For more details about supported .NET implementations, please see .NET Standard official page.
  • Asynchronous and synchronous methods to interact with Algolia's API
  • Thread-safe clients
  • Typed requests and responses
  • Injectable HTTP client

Migration note from v5.x to v6.x

In January 2019, we released v6 of our .NET client. If you are using version 5.x of the client, read the migration guide to version 6.x. Version 5.x will no longer be under active development.

💡 Getting Started

Install the library with the .NET CLI:

dotnet add package Algolia.Search

or with the Nuget Package Manager Console:

Install-Package Algolia.Search

In 30 seconds, this quick start tutorial will show you how to index and search objects.

Initialize the cient

To start, you need to initialize the client. To do this, you need your Application ID and API Key. You can find both on your Algolia account.

SearchClient client = new SearchClient("YourApplicationID", "YourAPIKey");
SearchIndex index = client.InitIndex("your_index_name");

Push data

Without any prior configuration, you can start indexing contacts in the contacts index using the following code:

public class Contact
{
  public string ObjectID { get; set; }
  public string Name { get; set; }
  public int Age { get; set; }
}

SearchIndex index = client.InitIndex("contacts");

index.SaveObject(new Contact
{
    ObjectID = "ID1",
    Name = "Jimmie",
    Age = 30
});

Search

You can now search for contacts by firstname, lastname, company, etc. (even with typos):

// Synchronous
index.Search<Contact>(new Query { "jimmie" });

// Asynchronous
await index.SearchAsync<Contact>(new Query { "jimmie" });

For full documentation, visit the Algolia .NET API Client documentation.

ASP.NET

If you're using ASP.NET, checkout the following tutorial.

❓ Troubleshooting

Encountering an issue? Before reaching out to support, we recommend heading to our FAQ where you will find answers for the most common issues and gotchas with the client.

Use the Dockerfile

If you want to contribute to this project without installing all its dependencies, you can use our Docker image. Please check our dedicated guide to learn more.

📄 License

Algolia .NET API Client is an open-sourced software licensed under the MIT license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.