fix: add document
All checks were successful
build-packages / meilisearch-dotnet-packages (push) Successful in 4m11s
All checks were successful
build-packages / meilisearch-dotnet-packages (push) Successful in 4m11s
This commit is contained in:
parent
a8aa7ddf0d
commit
63dfbd8762
@ -13,6 +13,7 @@ MeiliSearch .NET Integration is a NuGet package that seamlessly embeds MeiliSear
|
||||
|
||||
- [x] **Embedded MeiliSearch**: Integrate MeiliSearch directly into your application.
|
||||
- [x] **Manage Indexes**: Manage your indexs and documents through the SDK, you can still use the default Meilisearch SDK.
|
||||
- [x] **Add Documents**: Ability to add documents and have validation on if the index is loaded.
|
||||
- [x] **Background Process Management**: Automatically handles the lifecycle of the MeiliSearch process.
|
||||
- [x] **Health Monitoring**: Regular checks on the health of the MeiliSearch instance to ensure it stays running.
|
||||
- [x] **API Key Management**: An API key is automatically regenerated every time the MeiliSearch service starts unless one is specified in the configuration.
|
||||
|
@ -3,6 +3,7 @@ using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using meilisearch.NET;
|
||||
using meilisearch.NET.Configurations;
|
||||
using meilisearch.NET.example;
|
||||
using meilisearch.NET.Extensions;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@ -61,7 +62,42 @@ public class test
|
||||
Task.Delay(1000).Wait(); // Wait for 1 second before checking again
|
||||
}
|
||||
|
||||
service.CreateIndex("test");
|
||||
service.CreateIndex<document>("test");
|
||||
service.AddDocument("test", new document()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
message = "Hello, Meilisearch!"
|
||||
});
|
||||
service.AddDocument("test", new document()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
message = "Hello, Meilisearch!"
|
||||
});
|
||||
service.AddDocument("test", new document()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
message = "Hello, Meilisearch!"
|
||||
});
|
||||
service.AddDocument("test", new document()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
message = "Hello, Meilisearch!"
|
||||
});
|
||||
service.AddDocument("test", new document()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
message = "Hello, Meilisearch!"
|
||||
});
|
||||
service.AddDocument("test", new document()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
message = "Hello, Meilisearch!"
|
||||
});
|
||||
service.AddDocument("test", new document()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
message = "Hello, Meilisearch!"
|
||||
});
|
||||
_logger.LogInformation("Test service initialized.");
|
||||
}
|
||||
}
|
||||
|
8
meilisearch.NET.example/document.cs
Normal file
8
meilisearch.NET.example/document.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using meilisearch.NET.Interfaces;
|
||||
|
||||
namespace meilisearch.NET.example;
|
||||
|
||||
public class document:IDocument
|
||||
{
|
||||
public string message { get; set; }
|
||||
}
|
@ -40,6 +40,7 @@ public class MeilisearchService:IDisposable
|
||||
_documentCollection.CollectionChanged += CheckIfNeedDocumentSync;
|
||||
StartMeilisearch().Wait();
|
||||
EnsureRepositoryIndexExists().Wait();
|
||||
_logger.LogTrace("API Key: " + _apiKey);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user