diff --git a/.gitignore b/.gitignore
index b0ee1b7f0c2..c7f519db787 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,6 +34,9 @@ _ReSharper*/
_NCrunch*/
[Tt]est[Rr]esult*
+keypair.snk
+private.snk
+*.snk
build/keys/private.snk
build/keys/keypair.snk
build/*
@@ -41,9 +44,15 @@ build/*
build/tools/*
!build/tools/sn
!build/tools/ilmerge
+!build/*.fsx
+!build/*.fsx
+!build/*.ps1
+!build/*.nuspec
+
/dep/Newtonsoft.Json.4.0.2
!new_docs/build
new_docs/node_modules
+doc/Help
/src/Nest.Tests.Unit/*.ncrunchproject
*.ncrunchproject
diff --git a/build/Elasticsearch.Net.Connection.Thrift.nuspec b/build/Elasticsearch.Net.Connection.Thrift.nuspec
new file mode 100644
index 00000000000..804945c28a3
--- /dev/null
+++ b/build/Elasticsearch.Net.Connection.Thrift.nuspec
@@ -0,0 +1,26 @@
+
+
+
+ Elasticsearch.Net.Connection.Thrift
+ 1.0.0-beta1
+ Elasticsearch.Net.Connection.Thrift - Thrift support for Elasticsearch.Net
+ Martijn Laarman and contributors
+ Martijn Laarman
+ http://nest.azurewebsites.net/images/elasticsearch-net-nuget-icon.png
+ http://mpdreamz.mit-license.org/
+ https://github.com/Mpdreamz/NEST
+ An IConnection implementation that utilizes Apache Thrift to talk with elasticsearch
+ false
+ An IConnection implementation that utilizes Apache Thrift to talk with elasticsearch
+
+
+
+
+ elasticsearch elastic search lucene thrift nest
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/Elasticsearch.Net.nuspec b/build/Elasticsearch.Net.nuspec
new file mode 100644
index 00000000000..c4050c440f3
--- /dev/null
+++ b/build/Elasticsearch.Net.nuspec
@@ -0,0 +1,25 @@
+
+
+
+ Elasticsearch.Net
+ 1.0.0-beta1
+ Elasticsearch.Net - official low level elasticsearch client
+ Martijn Laarman and contributors
+ Martijn Laarman
+ http://nest.azurewebsites.net/images/elasticsearch-net-nuget-icon.png
+ http://mpdreamz.mit-license.org/
+ https://github.com/elasticsearch/elasticsearch-net
+ Exposes all the api endpoints but leaves you in control of building the request and response bodies. Comes with built in cluster failover/connection pooling support.
+
+ false
+ Exposes all the api endpoints but leaves you in control of building the request and response bodies. Comes with built in cluster failover/connection pooling support.
+
+ elasticsearch elastic search lucene nest
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/InheritDoc.fsx b/build/InheritDoc.fsx
new file mode 100644
index 00000000000..a9b1dc5a7ac
--- /dev/null
+++ b/build/InheritDoc.fsx
@@ -0,0 +1,25 @@
+#r "System.Xml.Linq.dll"
+open System.Xml
+open System.Xml.XPath
+open System.Linq
+open System.Xml.Linq
+open System.Text.RegularExpressions
+
+let PatchXmlDoc = fun (file: string) ->
+ let xml = XDocument.Load file
+ let nodes = xml.XPathSelectElements("//inheritdoc")
+ |> Seq.map (fun n ->
+ let methodName = n.Parent.Attribute(XName.Get("name")).Value
+ let interfaceName = Regex.Replace(methodName, @"\.([^.]+\.[^.]+\()", ".I$1")
+ let interfaceNode = xml.XPathSelectElement (sprintf "//member[@name='%s']" interfaceName)
+ (n.Parent, interfaceNode)
+ )
+ |> Seq.filter (fun (implementationElement, interfaceElement) ->
+ interfaceElement <> null && implementationElement.HasElements && interfaceElement.HasElements
+ )
+ let nodesReplace = nodes
+ |> Seq.iter (fun (implementationElement, interfaceElement) ->
+ implementationElement.Add (interfaceElement.Descendants().ToList())
+ )
+
+ xml.Save file
\ No newline at end of file
diff --git a/build/NEST.nuspec b/build/NEST.nuspec
index bdb654ec3af..1736801f9e2 100644
--- a/build/NEST.nuspec
+++ b/build/NEST.nuspec
@@ -2,7 +2,7 @@
NEST
- 0.0.0.1
+ 1.0.0-beta1NEST - Elasticsearch ClientMartijn Laarman and contributorsMartijn Laarman
@@ -13,7 +13,7 @@
falseElasticsearch client, strongly typed interface to Elasticsearch. Fluent request builder, mapped responses and powerful query dsl. Uses and exposes Elasticsearch.Net
-
+ elasticsearch elastic search lucene nest
@@ -22,5 +22,6 @@
+
\ No newline at end of file
diff --git a/build/build.fsx b/build/build.fsx
index 364e5c2b669..4664c4aadf3 100644
--- a/build/build.fsx
+++ b/build/build.fsx
@@ -1,7 +1,12 @@
// include Fake lib
#r @"tools/FAKE/tools/FakeLib.dll"
+#load @"InheritDoc.fsx"
open Fake
open System
+open InheritDoc
+open SemVerHelper
+open AssemblyInfoFile
+
// Properties
let buildDir = "build/output/"
@@ -14,11 +19,34 @@ Target "Clean" (fun _ ->
CleanDir buildDir
)
+
+
Target "BuildApp" (fun _ ->
+ let binDirs = !! "src/**/bin/**"
+ |> Seq.map DirectoryName
+ |> Seq.distinct
+ |> Seq.filter (fun f -> (f.EndsWith("Debug") || f.EndsWith("Release")) && not (f.Contains "CodeGeneration"))
+
+ CleanDirs binDirs
+
+ //Override the prebuild event because it just calls a fake task BuildApp depends on anyways
+ let msbuildProperties = [
+ ("Configuration","Release");
+ ("PreBuildEvent","ECHO");
+ ]
+
//Compile each csproj and output it seperately in build/output/PROJECTNAME
!! "src/**/*.csproj"
|> Seq.map(fun f -> (f, buildDir + directoryInfo(f).Name.Replace(".csproj", "")))
- |> Seq.iter(fun (f,d) -> MSBuildRelease d "Build" (seq { yield f }) |> ignore)
+ |> Seq.iter(fun (f,d) -> MSBuild d "Build" msbuildProperties (seq { yield f }) |> ignore)
+
+ //Scan for xml docs and patch them to replace with the documentation
+ //from their interfaces
+ !! "build/output/Nest/Nest.xml" |> Seq.iter(fun f -> PatchXmlDoc f)
+
+ CopyFile "build/output/Nest/init.ps1" "build/nest-init.ps1"
+ CopyFile "build/output/Elasticsearch.Net/init.ps1" "build/elasticsearch-init.ps1"
+
)
Target "Test" (fun _ ->
@@ -31,85 +59,130 @@ Target "Test" (fun _ ->
)
let keyFile = "build/keys/keypair.snk"
-let validateSignedAssembly = fun name ->
+
+let createKeys = fun _ ->
let sn = "build/tools/sn/sn.exe"
ExecProcess(fun p ->
p.FileName <- sn
- p.Arguments <- sprintf @"-v build\output\%s.dll" name
- ) (TimeSpan.FromMinutes 5.0)
-
-let signAssembly = fun name ->
- let ilmerge = "build/tools/ilmerge/ILMerge.exe"
- let platform = @"/targetplatform:v4,C:\Windows\Microsoft.NET\Framework64\v4.0.30319"
- let i = sprintf "build\\output\\%s\\%s" name name
- let o = sprintf "build\\output\\%s" name
+ p.Arguments <- sprintf @"-k %s" keyFile
+ ) (TimeSpan.FromMinutes 5.0) |> ignore
+
+ ExecProcess(fun p ->
+ p.FileName <- sn
+ p.Arguments <- sprintf @"-p %s %s" keyFile "build/keys/public.snk"
+ ) (TimeSpan.FromMinutes 5.0) |> ignore
+
+Target "CreateKeysIfAbsent" (fun _ ->
+ if not (fileExists keyFile) then createKeys()
+)
+
+let validateSignedAssembly = fun name ->
+ let sn = "build/tools/sn/sn.exe"
+ let out = (ExecProcessAndReturnMessages(fun p ->
+ p.FileName <- sn
+ p.Arguments <- sprintf @"-v build\output\%s\%s.dll" name name
+ ) (TimeSpan.FromMinutes 5.0))
- let dll = i + ".dll"
- let outdll = o + ".dll"
- let pdb = o + ".pdb"
-
- let signExitCode = (
- ExecProcess(fun p ->
- p.FileName <- ilmerge
- p.Arguments <- (sprintf "%s /keyfile:%s /out:%s %s"
- dll keyFile outdll platform)
- ) (TimeSpan.FromMinutes 5.0)
- )
+ let valid = (out.ExitCode, out.Messages.FindIndex(fun s -> s.Contains("is valid")))
+
+ match valid with
+ | (0, i) when i >= 0 -> trace (sprintf "%s was signed correctly" name)
+ | (_, _) -> failwithf "{0} was not validly signed"
+
+ let out = (ExecProcessAndReturnMessages(fun p ->
+ p.FileName <- sn
+ p.Arguments <- sprintf @"-T build\output\%s\%s.dll" name name
+ ) (TimeSpan.FromMinutes 5.0))
+
+ let tokenMessage = (out.Messages.Find(fun s -> s.Contains("Public key token is")));
+ let token = (tokenMessage.Replace("Public key token is", "")).Trim();
- let validateExitCode = validateSignedAssembly name
- match (signExitCode, validateExitCode) with
- | (0,0) ->
- MoveFile (DirectoryName dll) outdll
- MoveFile (DirectoryName dll) pdb
- | _ ->
- failwithf "Failed to sign {0}" name
+ let valid = (out.ExitCode, token)
+ let oficialToken = "96c599bbe3e70f5d"
+ match valid with
+ | (0, t) when t = oficialToken ->
+ trace (sprintf "%s was signed with official key token %s" name t)
+ | (_, t) -> traceFAKE "%s was not signed with the official token: %s but %s" name oficialToken t
let nugetPack = fun name ->
-
+ let fileVersion = (getBuildParamOrDefault "version" "0.1.0")
CreateDir nugetOutDir
-
+ let package = (sprintf @"build\%s.nuspec" name)
+ let packageContents = ReadFileAsString package
+ let re = @"(?\|""(Elasticsearch.Net|Nest)"" version="")[^""><]+(?\<\/version\>|"")"
+ let replacedContents = regex_replace re (sprintf "${start}%s${end}" fileVersion) packageContents
+ WriteStringToFile false package replacedContents
+
let dir = sprintf "%s/%s/" buildDir name
- let version = "1.0.0-c2"
NuGetPack (fun p ->
{p with
- Version = version
+ Version = fileVersion
WorkingDir = dir
OutputPath = dir
})
- (sprintf @"build\%s.nuspec" name)
+ package
- MoveFile nugetOutDir (buildDir + (sprintf "%s/%s.%s.nupkg" name name version))
+ MoveFile nugetOutDir (buildDir + (sprintf "%s/%s.%s.nupkg" name name fileVersion))
let buildDocs = fun action ->
let node = @"build\tools\Node.js\node.exe"
let wintersmith = @"..\build\tools\node_modules\wintersmith\bin\wintersmith"
ExecProcess (fun p ->
- p.WorkingDirectory <- "new_docs"
- p.FileName <- node
- p.Arguments <- sprintf "\"%s\" %s" wintersmith action
- ) (TimeSpan.FromMinutes (if action = "preview" then 300.0 else 5.0))
-
+ p.WorkingDirectory <- "new_docs"
+ p.FileName <- node
+ p.Arguments <- sprintf "\"%s\" %s" wintersmith action
+ )
+ (TimeSpan.FromMinutes (if action = "preview" then 300.0 else 5.0))
+
Target "Version" (fun _ ->
- let v = (getBuildParamOrDefault "version" "0.1.0")
- let version = SemVerHelper.parse v
- let assemblyVersion = sprintf "%i.%i.0.0" version.Major version.Minor
-
- trace (sprintf "%s %s" v assemblyVersion)
-
+ let fileVersion = (getBuildParamOrDefault "version" "0.1.0")
+ let version = SemVerHelper.parse fileVersion
+
+ let suffix = fun (prerelease: PreRelease) -> sprintf "-%s%i" prerelease.Name prerelease.Number.Value
+ let assemblySuffix = if version.PreRelease.IsSome then suffix version.PreRelease.Value else "";
+ let assemblyVersion = sprintf "%i.0.0%s" version.Major assemblySuffix
+
+ match (assemblySuffix, version.Minor, version.Patch) with
+ | (s, m, p) when s <> "" && (m <> 0 || p <> 0) -> failwithf "Cannot create prereleases for minor or major builds!"
+ | ("", _, _) -> traceFAKE "Building fileversion %s for asssembly version %s" fileVersion assemblyVersion
+ | _ -> traceFAKE "Building prerelease %s for major assembly version %s " fileVersion assemblyVersion
+
+ let assemblyDescription = fun (f: string) ->
+ let name = f
+ match f.ToLowerInvariant() with
+ | f when f = "elasticsearch.net" -> "Elasticsearch.Net - oficial low level elasticsearch client"
+ | f when f = "nest" -> "NEST - oficial high level elasticsearch client"
+ | f when f = "elasticsearch.net.connection.thrift" -> "Elasticsearc.Net.Connection.Thrift - Add thrift support to elasticsearch."
+ | _ -> sprintf "%s" name
+
+ !! "src/**/AssemblyInfo.cs"
+ |> Seq.iter(fun f ->
+ let name = (directoryInfo f).Parent.Parent.Name
+ CreateCSharpAssemblyInfo f [
+ Attribute.Title name
+ Attribute.Copyright (sprintf "Elasticsearch %i" DateTime.UtcNow.Year)
+ Attribute.Description (assemblyDescription name)
+ Attribute.Company "Elasticsearch"
+ Attribute.Configuration "Release"
+ Attribute.Version assemblyVersion
+ Attribute.FileVersion fileVersion
+ Attribute.InformationalVersion fileVersion
+ ]
+ )
)
+
Target "Release" (fun _ ->
if not <| fileExists keyFile
then failwithf "{0} does not exist to sign the assemblies" keyFile
- //signAssembly("Elasticsearch.Net")
- //signAssembly("Elasticsearch.Net.Connection.Thrift")
- //signAssembly("Nest")
-
nugetPack("Elasticsearch.Net")
nugetPack("Elasticsearch.Net.Connection.Thrift")
nugetPack("Nest")
+ validateSignedAssembly("Elasticsearch.Net")
+ validateSignedAssembly("Elasticsearch.Net.Connection.Thrift")
+ validateSignedAssembly("Nest")
)
Target "Docs" (fun _ -> buildDocs "build" |> ignore)
@@ -120,14 +193,19 @@ Target "DocsPreview" (fun _ ->
// Dependencies
"Clean"
+ ==> "CreateKeysIfAbsent"
+ =?> ("Version", hasBuildParam "version")
==> "BuildApp"
==> "Test"
==> "Build"
"Build"
+ ==> "Docs"
==> "Release"
"DocsPreview"
+"BuildApp"
+"CreateKeysIfAbsent"
"Version"
// start build
RunTargetOrDefault "Build"
\ No newline at end of file
diff --git a/build/elasticsearch-init.ps1 b/build/elasticsearch-init.ps1
new file mode 100644
index 00000000000..c73464ac655
--- /dev/null
+++ b/build/elasticsearch-init.ps1
@@ -0,0 +1 @@
+$DTE.ItemOperations.Navigate("http://nest.azurewebsites.net/elasticsearch-net/quick-start.html")
\ No newline at end of file
diff --git a/build/keys/public.snk b/build/keys/public.snk
deleted file mode 100644
index 9c2e41d4a64..00000000000
Binary files a/build/keys/public.snk and /dev/null differ
diff --git a/build/nest-init.ps1 b/build/nest-init.ps1
new file mode 100644
index 00000000000..ebeee869b83
--- /dev/null
+++ b/build/nest-init.ps1
@@ -0,0 +1 @@
+$DTE.ItemOperations.Navigate("http://nest.azurewebsites.net/nest/quick-start.html")
\ No newline at end of file
diff --git a/doc/Help/Documentation.chm b/doc/Help/Documentation.chm
deleted file mode 100644
index b31a34515db..00000000000
Binary files a/doc/Help/Documentation.chm and /dev/null differ
diff --git a/doc/documentation.shfbproj b/doc/documentation.shfbproj
deleted file mode 100644
index 09f798bfa0a..00000000000
--- a/doc/documentation.shfbproj
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- 2.0
- {0e1c3ab9-9af2-41dc-af01-e99f4c71f588}
- 1.9.9.0
-
- Documentation
- Documentation
- Documentation
-
- .NET Framework 4.0
- .\Help\
- Documentation
- en-US
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ..\src\Nest\bin\Release\Nest.dll
-
-
-
-
-
\ No newline at end of file
diff --git a/doc/ghostdoc.gdc b/doc/ghostdoc.gdc
deleted file mode 100644
index 76f2e692c74..00000000000
Binary files a/doc/ghostdoc.gdc and /dev/null differ
diff --git a/new_docs/build/elasticsearch-net/building-requests.html b/new_docs/build/elasticsearch-net/building-requests.html
index 40dc40c9fb2..9f8e7ea929c 100644
--- a/new_docs/build/elasticsearch-net/building-requests.html
+++ b/new_docs/build/elasticsearch-net/building-requests.html
@@ -1,5 +1,5 @@
Nest - Building Requests
Elasticsearch.Net
Documentation
Building Requests
-
This section decribes how to build requests to elasticsearch.
+
This section decribes how to build requests to Elasticsearch.
Calling an API endpoint
Elasticsearch.Net maps all the Elasticsearch API endpoints to methods. The reason it can do this is because all these methods are generated from
the official client rest specification. This specification documents all
diff --git a/new_docs/build/elasticsearch-net/cluster-failover.html b/new_docs/build/elasticsearch-net/cluster-failover.html
index 27ee0cf586d..b4d2ad46d0e 100644
--- a/new_docs/build/elasticsearch-net/cluster-failover.html
+++ b/new_docs/build/elasticsearch-net/cluster-failover.html
@@ -1,5 +1,5 @@
Nest - Cluster Failover
Elasticsearch.Net
Documentation
Connection pooling & Cluster failover
-
One of the major benefits of elasticsearch is that it can handle dying and respawning nodes.
+
One of the major benefits of Elasticsearch is that it can handle dying and respawning nodes.
As long as enough nodes agree that the cluster is healthy, the cluster will continue to operate.
Elasticsearch.net comes with builtin support to handle falling over to a different node when the requested node failed.
Configuring
@@ -21,7 +21,7 @@
SetDeadTimeout()
SetMaxDeadTimeout()
Sets the maximum time a node may be marked dead.
DisablePings()
-
By default before a previously dead node is retried a short ping will be send to the node to make sure the node will respond.
+
By default before a previously dead node is retried a short ping will be sent to the node to make sure the node will respond.
The reason for a separate call is that a ping will call an elasticsearch endpoint that won't stress the JVM. If a node is having issues retrying a possible heavy search operation on it might cause the request to fail later rather then asap. This setting allows you to disable these pings before retries.
SetMaxRetries(int retries)
By default an IConnectionPool itself will decide how many times to retry (usually all the registered nodes) if you wish to
diff --git a/new_docs/build/elasticsearch-net/errors.html b/new_docs/build/elasticsearch-net/errors.html
index d4759c45073..786ced35b11 100644
--- a/new_docs/build/elasticsearch-net/errors.html
+++ b/new_docs/build/elasticsearch-net/errors.html
@@ -1,5 +1,5 @@
Nest - Quick Start
Elasticsearch.Net
Documentation
Errors
-
Elasticsearch.Net will not throw if gets a http response other then 200 from Elasticsearch. The response object's Success property will be false and .Error will contain information on the failed response.
+
Elasticsearch.Net will not throw if it gets an http response other then 200 from Elasticsearch. The response object's Success property will be false and .Error will contain information on the failed response.
You can throw custom exceptions if you need too by specifying a custom connectionhandler
var settings = new ConnectionConfiguration()
.SetConnectionStatusHandler(r=> {
@@ -7,6 +7,6 @@
throw new MyApplicationNotLoggedInException();
});
Exceptions
-
If a request has been retried the maximum amount of times a MaxRetryException is thrown. Note that requests are only retried when elasticsearch responds with a 503 or an unspecified connection exception (i.e timeout) occured on a node.
+
If a request has been retried the maximum amount of times a MaxRetryException is thrown. Note that requests are only retried when elasticsearch responds with a 503 or an unspecified connection exception (i.e timeout) has occured on a node.
MaxRetryException will hold the original exception as .InnerException.
\ No newline at end of file
diff --git a/new_docs/build/elasticsearch-net/quick-start.html b/new_docs/build/elasticsearch-net/quick-start.html
index ddd4c9f31ba..95bdc58ddf1 100644
--- a/new_docs/build/elasticsearch-net/quick-start.html
+++ b/new_docs/build/elasticsearch-net/quick-start.html
@@ -1,5 +1,5 @@
Nest - Quick Start
Elasticsearch.Net
Documentation
Quick Start
-
Elasticsearch.Net is a low level client to talk to elasticsearch.
+
Elasticsearch.Net is a low level client to talk to Elasticsearch.
Installing
From the package manager console inside visual studio
You've reached the documentation page for Elasticsearch.Net and NEST. Two .net clients to talk with elasticsearch. So why two clients I hear you say?
+
You've reached the documentation page for Elasticsearch.Net and NEST. Two .net clients to talk with Elasticsearch. So why two clients I hear you say?
Elasticsearch.Net is a very low level, dependency free, client that has no opinions how you build and represent your requests and responses. It has abstracted
enough so that all the elasticsearch API endpoints are represented as methods but not too much to get in the way of how you want to build your json/request/response objects. It also comes with builtin, configurable/overridable, cluster failover retry mechanisms. Elasticsearch is elastic so why not your client?
NEST is a high level client that has the advantage of having mapped all the request and response objects, comes with a strongly typed query DSL that maps 1 to 1 with the elasitcsearch query dsl and takes advantage of specific .net features such as covariant results. NEST internally uses, and still exposes, the low level Elasticsearch.Net client
@joelabrahamsson wrote a great intro into elasticsearch on .NET
diff --git a/new_docs/build/nest/cluster/health.html b/new_docs/build/nest/cluster/health.html
index bd6c0e88fe7..3cf88afa661 100644
--- a/new_docs/build/nest/cluster/health.html
+++ b/new_docs/build/nest/cluster/health.html
@@ -1,7 +1,7 @@
Nest - Connecting
NEST
Documentation
Health
Get cluster health simple
var r = this._client.Health(HealthLevel.Cluster);
-
Cluster health just for one (or more) index
+
Cluster health for one (or more) indexes
var r = this._client.Health(new[] { Test.Default.DefaultIndex }, HealthLevel.Cluster);
Advanced options are mapped as well
var r = this._client.Health(new HealthParams
diff --git a/new_docs/build/nest/cluster/nodes-stats.html b/new_docs/build/nest/cluster/nodes-stats.html
index 47ea1939f32..0bbd35d54f4 100644
--- a/new_docs/build/nest/cluster/nodes-stats.html
+++ b/new_docs/build/nest/cluster/nodes-stats.html
@@ -1,6 +1,6 @@
Nest - Connecting
NEST
Documentation
Nodes stats
var r = this._client.NodeInfo(NodesInfo.All);
var node = r.Nodes.First();
-
you can than traverse the node info objects i.e:
+
You can than traverse the node info objects i.e:
node.Value.OS.Cpu.CacheSizeInBytes;
\ No newline at end of file
diff --git a/new_docs/build/nest/connecting.html b/new_docs/build/nest/connecting.html
index 3a4d9a47829..39e1c94162f 100644
--- a/new_docs/build/nest/connecting.html
+++ b/new_docs/build/nest/connecting.html
@@ -11,10 +11,10 @@
Choosing the right connection st
for calls which do not explicitly state an index name. Specifying a default index is optional but very handy.
By default NEST will use HTTP to chat with elasticsearch, alternative implementation of the transport layer can be injected in the constructors optional second parameter
+
By default NEST will use HTTP to chat with elasticsearch, alternative implementation of the transport layer can be injected using the constructors optional second parameter
var client = new ElasticClient(settings, new ThriftConnection(settings));
-
Nest comes with a Htpp connection HttpConnection, Thrift Connection ThriftConnection
-and an in memory connection that nevers hits elasticsearch InMemoryConnection.
+
NEST comes with an Http Connection HttpConnection, Thrift Connection ThriftConnection
+and an In-Memory Connection InMemoryConnection, that nevers hits elasticsearch.
Settings
The NEST client can be configured by passing in an IConnectionSettingsValues object, this interface is a subclass of
Elasticsearch.Net's IConnectionConfigurationValues so all the settings that can be used to
@@ -24,8 +24,8 @@
Settings
var settings = new ConnectionSettings(myConnectionPool, defaultIndex: "my-application")
.PluralizeTypeNames();
AddContractJsonConverters
-
Add a custom JsonConverter to the build in json serialization by passing
-in a predicate for a type. This way they will be part of the cached Json.net contract for a type.
+
Add a custom JsonConverter to the built in JSON serialization by passing
+in a predicate for a type. This way they will be part of the cached Json.NET contract for a type.
By default NEST camelCases property names (EmailAddress => emailAddress)
that do not have an explicit propertyname either via an ElasticProperty attribute
-or because they are part of Dictionary where the keys should be treated verbatim.
+or because they are part of a Dictionary where the keys should be treated verbatim.
Here you can register a function that transforms propertynames (default
casing, pre- or suffixing)
SetDefaultTypeNameInferrer
-
Allows you to override how type names should be reprented, the default will
+
Allows you to override how type names should be represented, the default will
call .ToLowerInvariant() on the type's name.
SetJsonSerializerSettingsModifier
-
Allows you to update internal the json.net serializer settings to your liking.
-Do not use this to add custom json converters use AddContractJsonConverters instead.
+
Allows you to update the internal Json.NET Serializer settings to your liking.
+Do not use this to add custom JSON converters use AddContractJsonConverters instead.
\ No newline at end of file
diff --git a/new_docs/build/nest/core/bulk.html b/new_docs/build/nest/core/bulk.html
index 0f1aed34dc9..9889aca9006 100644
--- a/new_docs/build/nest/core/bulk.html
+++ b/new_docs/build/nest/core/bulk.html
@@ -1,12 +1,12 @@
Nest - Connecting
NEST
Documentation
Bulk
-
Nest long supported bulk index and deletes (through IndexMany() and DeleteMany()) but this shielded you from all that the elasticsearch _bulk api enpoint has to offer. Now you can use Bulk() to create any bulk request you'd like. E.g if you want to do index/create/delete's in a certain order.
+
NEST long supported bulk index and deletes (through IndexMany() and DeleteMany()) but this shielded you from all that the Elasticsearch _bulk api enpoint has to offer. Now you can use Bulk() to create any bulk request you'd like. E.g if you want to do index/create/delete's in a certain order.
Examples
var result = this._client.Bulk(b => b
.Index<ElasticSearchProject>(i => i.Object(new ElasticSearchProject {Id = 2}))
.Create<ElasticSearchProject>(i => i.Object(new ElasticSearchProject { Id = 3 }))
.Delete<ElasticSearchProject>(i => i.Object(new ElasticSearchProject { Id = 4 }))
);
-
Each bulk operation can also be anotated with the right behaviours:
+
Each bulk operation can also be annotated with the right behaviours:
.Index<ElasticSearchProject>(i => i
.Routing(...)
.Refresh(...)
diff --git a/new_docs/build/nest/core/count.html b/new_docs/build/nest/core/count.html
index d0a094a6863..cd81861070c 100644
--- a/new_docs/build/nest/core/count.html
+++ b/new_docs/build/nest/core/count.html
@@ -2,7 +2,7 @@
The count API allows to easily execute a query and get the number of matches for that query. It can be executed across one or more indices and across one or more types. The query can either be provided using a simple query string as a parameter, or using the Query DSL defined within the request body. Here is an example:
var countResults = this._client.CountAll(q=>q.MatchAll());
Assert.True(countResults.Count > 0);
-
The above will do a count query across all indices. (The result type here is not)
+
The above will do a count query across all indices. (The result type here is not limited)
If you want to limit the scope to just the default index for the type:
var countResults = this._client.Count<ElasticSearchProject>(q=>q.MatchAll());
This does a match all count query on the default index for ElasticSearchProject, if you need to specify custom indices use:
var foundDocument = this.ConnectedClient.Get<ElasticSearchProject>(hit.Id);
-
index and type are infered but overloads exists for full control
+
Index and type are infered but overloads exists for full control
var foundDocument = this.ConnectedClient.Get<ElasticSearchProject>("myalternateindex", "elasticprojs", hit.Id);
Full response
-
The Get<T>() call immediatly returns T which is handy in alot of cases but sometimes you'll want to get the complete metadata object back from Elasticsearch
-using GetFull() you get a proper IGetResponse<T> back that holds the usual IsValid and ConnectionStatus properties amongst the Index, Type, Id and Version properties.
+
The Get<T>() call immediatly returns T which is handy in alot of cases but sometimes you'll want to get the complete metadata object back from Elasticsearch.
+Using GetFull() you get a proper IGetResponse<T> back that holds the usual IsValid and ConnectionStatus properties amongst the Index, Type, Id and Version properties.
var result = this._client.GetFull<ElasticSearchProject>(g => g
.Index("nest_test_data")
.Type("elasticsearchprojects")
@@ -18,17 +18,17 @@
By Id
.Id(1)
);
Follows the same inferring rules as .Get(id) would.
-
Infact you could even just pass an object:
+
In fact you could even just pass an object:
var result = this._client.GetFull<SomeDto>(g => g
.Object(new SomeDto { AlternateId = Guid.NewGuid() })
);
-
provided SomeDto is mapped properly to use AlternateId as the alternate id field
+
Provided SomeDto is mapped properly to use AlternateId as the alternate id field.
[ElasticType(IdProperty = "AlternateId")]
internal class SomeDto
{
public Guid AlternateId { get; set; }
}
-
You can also use GetFull to query just some fields of a single document
+
You can also use GetFull to query just some fields of a single document
var result = this._client.GetFull<ElasticSearchProject>(g => g
.Index("nest_test_data")
.Type("elasticsearchprojects")
@@ -39,5 +39,5 @@
By Id
var name = result.Fields.FieldValue<string>(p => p.Name);
var id = result.Fields.FieldValue<int>(p => p.Id);
var doubleValue = result.Fields.FieldValue<double>(p => p.DoubleValue);
-
Remember p => p.Name can also be written as "name" and Nest does not force you to write expressions everywhere (although it is much encouraged!).
+
Remember p => p.Name can also be written as "name" and NEST does not force you to write expressions everywhere (although it is much encouraged!).
\ No newline at end of file
diff --git a/new_docs/build/nest/core/index.html b/new_docs/build/nest/core/index.html
index 84b51e0dd35..0c23b8ef986 100644
--- a/new_docs/build/nest/core/index.html
+++ b/new_docs/build/nest/core/index.html
@@ -2,10 +2,10 @@
Indexing is as simple as:
var post = new Post() { Id = 12, ... }
var status = client.Index<Post>(post);
-
of course C# is smart enough to infer Post so
+
Of course C# is smart enough to infer Post so
var status = client.Index(post);
is sufficient. this will index post too /[default index]/posts/12. The typenameposts is automatically inferred from the type.
-
if you need more control there are plenty of overloads, i.e:
+
If you need more control there are plenty of overloads, i.e:
client.Index(post, "index", "type", "id");
Asynchronous
Indexing asynchronously is as easy as:
@@ -20,11 +20,11 @@
Instead of passing T just pass an IEnumerable<T> to IndexMany() or IndexManyAsync().
Note
For asynchronous commands there's a special connection setting which automatically semaphores threaded communication
-to ES for you:
+to Elasticsearch for you:
var elasticSettings = new ConnectionSettings("127.0.0.1.", 9200)
.SetDefaultIndex("mpdreamz")
.SetMaximumAsyncConnections(20);
-
this ensures that at most there are 20 asynchronous connections to ES others are enqueued until a slot is
+
This ensures that at most there are 20 asynchronous connections to Elasticsearch. All others are enqueued until a slot is
available.
Aditional parameters
Like the overloads just taking a T the IEnumerable<T> has alot of overloads taking in extra parameters.
var ids = new [] { hit1.Id, hit2.Id };
var foundDocuments = this.ConnectedClient.MultiGet<ElasticSearchProject>(ids);
-
index and type are infered but overloads exists for full control
+
Index and type are infered but overloads exists for full control.
var foundDocuments = this.ConnectedClient.MultiGet<ElasticSearchProject>("myalternateindex", "elasticprojs", ids);
Multi Get Full
The previous calls are handy if you need to get many objects of a single type and don't care about the response or the metadata of the documents. If you do, NEST has you covered as well.
@@ -17,7 +17,7 @@
Examples
var person = result.Get<Person>(100000);
var personHit = result.GetWithMetaData<Person>(100000);
Get returns T and GetWithMetaData returns a MultiGetHit<T> which also exposes the document's metadata such as _index and _version.
-
Incase the document was not found then Get would return a null but GetWithMetaData still returns the a MultiGetHit<T> but with an .Exists of false this maps to the way elasticsearch returns not found objects in a multi_get call.
+
In case the document was not found then Get would return a null but GetWithMetaData still returns the a MultiGetHit<T> but with an .Exists of false this maps to the way elasticsearch returns not found objects in a multi_get call.
You can even get field selections for some of the documents:
var result = this._client.MultiGetFull(a => a
.Get<ElasticSearchProject>(g => g.
@@ -36,5 +36,5 @@
Examples
var fields = result.GetFieldSelection<ElasticSearchProject>(1);
var id = fields.FieldValue<int>(p => p.Id);
var firstNames = fields.FieldValue<string[]>(p => p.Followers.First().FirstName);
-
Remember p => p.Followers.First().FirstName can be interchanged with "followers.firstName" if you prefer or need to reference a non mapped field.
+
Remember p => p.Followers.First().FirstName can be interchanged with "followers.firstName" if you prefer or need to reference a non-mapped field.
\ No newline at end of file
diff --git a/new_docs/build/nest/core/percolate.html b/new_docs/build/nest/core/percolate.html
index 227e7c5235d..b12a0961efc 100644
--- a/new_docs/build/nest/core/percolate.html
+++ b/new_docs/build/nest/core/percolate.html
@@ -1,6 +1,6 @@
Nest - Connecting
NEST
Documentation
Percolation
The percolator allows to register queries against an index, and then send percolate requests which include a doc, and getting back the queries that match on that doc out of the set of registered queries.
-
The percolate is a complex but awesome elasticsearch feature be sure to read the official documentation
+
Percolate is a complex but awesome Elasticsearch feature, so be sure to read the official documentation
Register a percolator
var r = c.RegisterPercolator<ElasticSearchProject>(p => p
.Name(name)
diff --git a/new_docs/build/nest/core/search.html b/new_docs/build/nest/core/search.html
index 78d8f131f5e..2cbd24eb1b8 100644
--- a/new_docs/build/nest/core/search.html
+++ b/new_docs/build/nest/core/search.html
@@ -1,5 +1,5 @@
Nest - Connecting
NEST
Documentation
Search
-
Search is THE call you'll probably use the most as it exposes elasticsearch's key functionality: search!
+
Search is THE call you'll probably use the most as it exposes Elasticsearch's key functionality: search!
var result = this._client.Search(s => s
@@ -9,7 +9,7 @@
.Filter(f=> ....)
);
This will get all the documents on the my-index index and my-type type.
-
result is an IQueryResponse<dynamic> which has a DocumentsIEnumerable<dynamic> property that holds all the results. NOTE: remember in the absent of paging it will default to the first 10).
+
result is an IQueryResponse<dynamic> which has a DocumentsIEnumerable<dynamic> property that holds all the results. NOTE: remember in the absense of paging it will default to the first 10).
Typed results
Dynamic may or may not be what you want but in general it pays to type your search responses. In alot of cases you already need to have the POCO classes for indexing anyway.
var result = this._client.Search<ElasticSearchProject>(s => s
diff --git a/new_docs/build/nest/facets/date-histogram.html b/new_docs/build/nest/facets/date-histogram.html
index 2d1c356eb81..4f73fc042ba 100644
--- a/new_docs/build/nest/facets/date-histogram.html
+++ b/new_docs/build/nest/facets/date-histogram.html
@@ -10,5 +10,5 @@
.Factor(1000)
)
);
-
\ No newline at end of file
diff --git a/new_docs/build/nest/facets/handling.html b/new_docs/build/nest/facets/handling.html
index 88d0ceba28c..eccab20c598 100644
--- a/new_docs/build/nest/facets/handling.html
+++ b/new_docs/build/nest/facets/handling.html
@@ -25,7 +25,7 @@
Specify facets during search.
.Size(20)
)
);
-
Nest supports all the additional properties you can set on facets
+
NEST supports all the additional properties you can set on facets
var queryResults = this.ConnectedClient.Search<ElasticSearchProject>(s=>s
.From(0)
.Size(10)
@@ -46,12 +46,12 @@
Specify facets during search.
.TimeZones(Pre: "-3", Post: "-4")
)
);
-
Allowing you to take advantage of all the cool facets stuff built in to elasticsearch.
+
Allowing you to take advantage of all the cool facets stuff built into Elasticsearch.
Getting to your facet
If you are interested in the facet meta data (such as missing, total) you can use the following methods:
var facet = queryResults.Facet<TermFacet>(p=>p.Followers.Select(f=>f.LastName));
-
this will return a TermFacet object which has an .Items property holding all the facets.
-
queryResult also holds a .Facets dictionary one can use to itterate over the facets returned from the query.
+
This will return a TermFacet object which has an .Items property holding all the facets.
+
queryResult also holds a .Facets dictionary one can use to iterate over the facets returned from the query.
Shortcut to facet items
To get the facet items for followers.lastName the prettiest way to get them is.
var facets = queryResults.FacetItems<FacetItem>(p=>p.Followers.Select(f=>f.LastName));
@@ -69,5 +69,5 @@
\ No newline at end of file
diff --git a/new_docs/build/nest/facets/range.html b/new_docs/build/nest/facets/range.html
index a022ba27d09..0e306a62815 100644
--- a/new_docs/build/nest/facets/range.html
+++ b/new_docs/build/nest/facets/range.html
@@ -1,5 +1,5 @@
Nest - Connecting
NEST
Documentation
Range Facet
-
range facet allow to specify a set of ranges and get both the number of docs (count) that fall within each range, and aggregated data either based on the field, or using another field. Here is a simple example:
+
Range faceting allows you to specify a set of ranges and get both the number of docs (count) that fall within each range, and aggregated data either based on the field, or using another field. Here is a simple example:
\ No newline at end of file
diff --git a/new_docs/build/nest/facets/statistical.html b/new_docs/build/nest/facets/statistical.html
index 32157a65048..106101b4840 100644
--- a/new_docs/build/nest/facets/statistical.html
+++ b/new_docs/build/nest/facets/statistical.html
@@ -1,5 +1,5 @@
Nest - Connecting
NEST
Documentation
Statistical Facet
-
Statistical facet allows to compute statistical data on a numeric fields. The statistical data include count, total, sum of squares, mean (average), minimum, maximum, variance, and standard deviation. Here is an example:
+
Statistical faceting allows you to compute statistical data on numeric fields. The statistical data includes count, total, sum of squares, mean (average), minimum, maximum, variance, and standard deviation. Here is an example:
\ No newline at end of file
diff --git a/new_docs/build/nest/facets/term-stats.html b/new_docs/build/nest/facets/term-stats.html
index 0f803ce9b1a..0d0325539a7 100644
--- a/new_docs/build/nest/facets/term-stats.html
+++ b/new_docs/build/nest/facets/term-stats.html
@@ -1,10 +1,10 @@
Nest - Connecting
NEST
Documentation
Term Stats Facet
-
The terms_stats facet combines both the terms and statistical allowing to compute stats computed on a field, per term value driven by another field. For example:
+
The terms_stats facet combines both the terms and statistical allowing you to obtain stats computed on a field, per term value driven by another field. For example:
\ No newline at end of file
diff --git a/new_docs/build/nest/facets/terms.html b/new_docs/build/nest/facets/terms.html
index 821142c2731..b0eb1bf9637 100644
--- a/new_docs/build/nest/facets/terms.html
+++ b/new_docs/build/nest/facets/terms.html
@@ -1,10 +1,10 @@
Nest - Connecting
NEST
Documentation
Terms Facet
-
Allow to specify field facets that return the N most frequent terms. For example:
+
Allows you to specify field facets that return the N most frequent terms. For example:
\ No newline at end of file
diff --git a/new_docs/build/nest/handling-responses.html b/new_docs/build/nest/handling-responses.html
index 61461b75c0e..ab3e8deee1e 100644
--- a/new_docs/build/nest/handling-responses.html
+++ b/new_docs/build/nest/handling-responses.html
@@ -6,8 +6,8 @@
IElasticsearchResponse ConnectionStatus { get; }
ElasticInferrer Infer { get; }
}
-
IsValid will return whether a response is valid or not. A response is usually only valid when a HTTP return result in the 200 range was returned. Some calls allow for 404 to be a valid response too however.
+
IsValid will return whether a response is valid or not. A response is usually only valid when an HTTP return result in the 200 range was returned. Some calls allow for 404 to be a valid response too however.
If a response returns 200 in Elasticsearch sometimes it will contain more information on the validity of the call inside its response. It's highly recommended to read the documentation for a call and check for these properties on the responses as well.
-
ConnectionStatus is the response as it was returned by Elasticsearch.net it's section on
+
ConnectionStatus is the response as it was returned by Elasticsearch.net. It's section on
handling responses applies here as well.