ElasticLite.Client 1.0.1

dotnet add package ElasticLite.Client --version 1.0.1
NuGet\Install-Package ElasticLite.Client -Version 1.0.1
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="ElasticLite.Client" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ElasticLite.Client --version 1.0.1
#r "nuget: ElasticLite.Client, 1.0.1"
#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 ElasticLite.Client as a Cake Addin
#addin nuget:?package=ElasticLite.Client&version=1.0.1

// Install ElasticLite.Client as a Cake Tool
#tool nuget:?package=ElasticLite.Client&version=1.0.1

轻量版操作ElasticSearch工具

Nuget 包搜索 ElasticLite.Client 并且安装

实例化

List<string> urls = new List<string>(){ "http://localhost:9200/"};

ElasticConnection elasticConnection = new ElasticConnection(urls);

  1. 判断 index 是否存在:

    bool exists = elasticConnection.Head(indexName);

  2. 创建 index, 并且设置mapping:

    var result = elasticConnection.Put(indexName, mapping);

    if (result.Contains("\"acknowledged\":true")) return true;

  3. 索引数据:

    var result = elasticConnection.Post("person/doc/1", json);

    if (result.Contains("\"successful\":1")) return true;

  4. 删除数据:

    var result = elasticConnection.Delete("person/doc/1");

    if (result.Contains("\"successful\":1")) return true;

  5. 搜索数据:

    var result = elasticConnection.Post(indexName, json);

    或者只取需要的数据

    var result = elasticConnection.Post(indexName+ "/_search?filter_path=hits.total,hits.hits._source,hits.hits._id,hits.hits.highlight", json);

  6. 更新数据最佳实践:

    确保id一致使用索引接口来修改

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 475 11/29/2019
1.0.0 401 11/29/2019

改变描述