MeilisearchDotnet 0.0.3-a

This is a prerelease version of MeilisearchDotnet.
There is a newer version of this package available.
See the version list below for details.
dotnet add package MeilisearchDotnet --version 0.0.3-a                
NuGet\Install-Package MeilisearchDotnet -Version 0.0.3-a                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MeilisearchDotnet" Version="0.0.3-a" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MeilisearchDotnet --version 0.0.3-a                
#r "nuget: MeilisearchDotnet, 0.0.3-a"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MeilisearchDotnet as a Cake Addin
#addin nuget:?package=MeilisearchDotnet&version=0.0.3-a&prerelease

// Install MeilisearchDotnet as a Cake Tool
#tool nuget:?package=MeilisearchDotnet&version=0.0.3-a&prerelease                

MeiliSearchDotnet is a client for MeiliSearch written in .NET standard 2.0. MeiliSearch is a powerful, fast, open-source, easy to use and deploy search engine. Both searching and indexing are highly customizable. Features such as typo-tolerance, filters, and synonyms are provided out-of-the-box.

Table of Contents

🔧 Installation

It's available as NuGet package :

dotnet add package MeilisearchDotnet --version 0.0.4

https://www.nuget.org/packages/MeilisearchDotnet

🏃‍♀️ Run MeiliSearch

There are many easy ways to download and run a MeiliSearch instance.

For example, if you use Docker:

docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey

NB: you can also download MeiliSearch from Homebrew or APT.

🎬 Getting started

Here is a quickstart how to add / update documents

using System.Collections.Generic;
using System.Threading.Tasks;

using MeilisearchDotnet;

namespace console
{
    public class Doc
    {
        public int key1 { get; set; }
        public string value { get; set; }
    }
    class Program
    {
        static async Task Main(string[] args)
        {
            Meilisearch ms = new Meilisearch("http://localhost:7700", "masterKey");
            MeilisearchDotnet.Index index = await ms.CreateIndex(new MeilisearchDotnet.Types.IndexRequest
            {
                uid = "kero",
                primaryKey = "key1"
            });

            MeilisearchDotnet.Types.EnqueuedUpdate ret = await index.AddDocuments<Doc>(new List<Doc>() {
                new Doc { key1 = 222, value = "aaa" },
                new Doc { key1 = 333, value = "bbb" }
            });

            await index.WaitForPendingUpdate(ret.UpdateId);

            Doc doc = await index.GetDocument<Doc>("222");

            // doc => { key1 = 222, value = "aaa" }

            ret = await index.AddDocuments<Doc>(new List<Doc>() {
                new Doc { key1 = 444, value = "aaa" },
                new Doc { key1 = 555, value = "bbb" }
            }, new MeilisearchDotnet.Types.AddDocumentParams
            {
                primaryKey = "key1"
            });

            await index.WaitForPendingUpdate(ret.UpdateId);

            ret = await index.UpdateDocuments(new List<Doc>() {
                new Doc { key1 = 222, value = "tpayet" },
                new Doc { key1 = 444, value = "tutu" }
            });

            await index.WaitForPendingUpdate(ret.UpdateId);

            doc = await index.GetDocument<Doc>("222");

            // doc => { key1 = 222, value = "tpayet" }
        }
    }
}
Search in index
// MeiliSearch is typo-tolerant:
MeilisearchDotnet.Types.SearchResponse<Doc> result = await index.Search<Doc>("tpyaet");
// result => {
//   "Hits": [{"key1": 222,"value": "tpayet"}],
//   "Offset": 0,
//   "Limit": 20,
//   "ProcessingTimeMs": 1,
//   "Query": "tpyaet"
// }

⚙️ Development Workflow

If you want to contribute, this sections describes the steps to follow.

Tests

# Tests
docker run -d -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics
dotnet restore
dotnet test

Release

MeiliSearch tools follow the Semantic Versioning Convention.

You must do a PR modifying the file meilisearch-dotnet.csproj with the right version.<br>

<Version>x.x.x</Version>

🤖 Compatibility with MeiliSearch

This package works for MeiliSearch >=0.10.x

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.