Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion new_docs/contents/elasticsearch-net/building-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ menuitem: esnet-building-requests

# Building Requests

This section decribes how to build requests to elasticsearch.
This section decribes how to build requests to Elasticsearch.

## Calling an API endpoint

Expand Down
4 changes: 2 additions & 2 deletions new_docs/contents/elasticsearch-net/cluster-failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ menuitem: esnet-cluster-failover

# 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.

Expand Down Expand Up @@ -38,7 +38,7 @@ Sets the timeout before a node is retried. The default `DateTimeProvider` will i
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)
Expand Down
4 changes: 2 additions & 2 deletions new_docs/contents/elasticsearch-net/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ menuitem: esnet-errors

# 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

Expand All @@ -20,7 +20,7 @@ You can throw custom exceptions if you need too by specifying a custom connectio

## 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`.

Expand Down
2 changes: 1 addition & 1 deletion new_docs/contents/elasticsearch-net/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ menuitem: esnet-quick-start

# 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

Expand Down
6 changes: 3 additions & 3 deletions new_docs/contents/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ menuitem: introduction

# Introduction

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?
Expand All @@ -20,9 +20,9 @@ Please read the getting started guide for both.
## Who's using Nest
* [stackoverflow.com](http://www.stackoverflow.com) (and the rest of the stackexchange family).
* [7digital.com](http://www.7digital.com) (run NEST on mono).
* [rijksmuseum.nl](https://www.rijksmuseum.nl/en) (elasticsearch is the only datastorage hit for each page).
* [rijksmuseum.nl](https://www.rijksmuseum.nl/en) (Elasticsearch is the only datastorage hit for each page).
* [Kiln](http://www.fogcreek.com/kiln/) FogCreek's version control & code review tooling.
They are so pleased with elasticsearch that [they made a video about how pleased they are!](http://blog.fogcreek.com/kiln-powered-by-elasticsearch/)
They are so pleased with Elasticsearch that [they made a video about how pleased they are!](http://blog.fogcreek.com/kiln-powered-by-elasticsearch/)


## Other resources
Expand Down
2 changes: 1 addition & 1 deletion new_docs/contents/nest/cluster/health.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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);

Expand Down
2 changes: 1 addition & 1 deletion new_docs/contents/nest/cluster/nodes-stats.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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;

18 changes: 9 additions & 9 deletions new_docs/contents/nest/connecting.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ If you want a failover client instead of passing a `Uri` pass an `IConnectionPoo

## Changing the underlying connection

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

Expand All @@ -50,8 +50,8 @@ The easiest way to pass `IConnectionSettingsValues` is to instantiate `Connectio
.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.

settings.AddContractJsonConverters(t =>
typeof (Enum).IsAssignableFrom(t)
Expand All @@ -74,15 +74,15 @@ Index to default to when no index is specified.
####SetDefaultPropertyNameInferrer
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.

4 changes: 2 additions & 2 deletions new_docs/contents/nest/core/bulk.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ menuitem: bulk

# 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

Expand All @@ -18,7 +18,7 @@ Nest long supported bulk index and deletes (through `IndexMany()` and `DeleteMan
.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(...)
Expand Down
2 changes: 1 addition & 1 deletion new_docs/contents/nest/core/count.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The count API allows to easily execute a query and get the number of matches for
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:

Expand Down
2 changes: 1 addition & 1 deletion new_docs/contents/nest/core/delete-by-query.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Elasticsearch allows you to delete over multiple types and indexes, so does NEST

As always `*Async` variants are available too.

You can also delete by query over all the indexes and types:
You can also delete by query over all the indices and types:

this.ConnectedClient.DeleteByQuery<ElasticSearchProject>(q => q
.AllIndices()
Expand Down
16 changes: 8 additions & 8 deletions new_docs/contents/nest/core/get.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ menuitem: get

# Get a document

gets a single document from Elasticsearch
Gets a single document from Elasticsearch

## By Id

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")
Expand All @@ -39,21 +39,21 @@ using `GetFull()` you get a proper `IGetResponse<T>` back that holds the usual `

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")
Expand All @@ -69,7 +69,7 @@ These fields are exposed as followed:
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!).



Expand Down
8 changes: 4 additions & 4 deletions new_docs/contents/nest/core/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ 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 typename`posts` 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");

Expand Down Expand Up @@ -47,13 +47,13 @@ Instead of passing `T` just pass an `IEnumerable<T>` to `IndexMany()` or `IndexM

**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
Expand Down
6 changes: 3 additions & 3 deletions new_docs/contents/nest/core/multi-get.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Get multiple documents in a single request.
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);

Expand All @@ -38,7 +38,7 @@ These could then be pulled out of the result:

`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:

Expand All @@ -62,4 +62,4 @@ You can then get the returned fields like so:
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.
2 changes: 1 addition & 1 deletion new_docs/contents/nest/core/percolate.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ menuitem: percolate
# 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](http://www.elasticsearch.org/guide/reference/api/percolate/)
Percolate is a complex but awesome Elasticsearch feature, so be sure to read the [official documentation](http://www.elasticsearch.org/guide/reference/api/percolate/)

# Register a percolator

Expand Down
4 changes: 2 additions & 2 deletions new_docs/contents/nest/core/search.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ menuitem: search

# 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!

**NOTE:** be sure to also read [how to use NEST's Query DSL](/concepts/writing-queries.html)

Expand All @@ -24,7 +24,7 @@ You can start a search like so,

This will get all the documents on the `my-index` index and `my-type` type.

`result` is an `IQueryResponse<dynamic>` which has a `Documents` `IEnumerable<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 `Documents` `IEnumerable<dynamic>` property that holds all the results. NOTE: remember in the absense of paging it will default to the first 10).

## Typed results

Expand Down
2 changes: 1 addition & 1 deletion new_docs/contents/nest/facets/date-histogram.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ A specific histogram facet that can work with date field types enhancing it over
)
);

See [original docs](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-date-histogram-facet.html) for more information
See [original docs](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-date-histogram-facet.html) for more information.
2 changes: 1 addition & 1 deletion new_docs/contents/nest/facets/filter.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ A filter facet (not to be confused with a facet filter) allows you to return a c
)
);

See [original docs](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-filter-facet.html) for more information
See [original docs](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-filter-facet.html) for more information.
2 changes: 1 addition & 1 deletion new_docs/contents/nest/facets/geo-distance.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ The geo_distance facet is a facet providing information for ranges of distances
)
);

See [original docs](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-geo-distance-facet.html) for more information
See [original docs](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-geo-distance-facet.html) for more information.


10 changes: 5 additions & 5 deletions new_docs/contents/nest/facets/handling.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Adding more then one facet is also really easy:
)
);

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)
Expand All @@ -61,17 +61,17 @@ Nest supports all the additional properties you can set on facets
)
);

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.
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.
`queryResult` also holds a `.Facets` dictionary one can use to iterate over the facets returned from the query.

## Shortcut to facet items

Expand Down Expand Up @@ -107,6 +107,6 @@ The following lists the elasticsearch facet type and their corresponding NEST st

***filter*** => [FilterFacet]({{root}}/facets/filter.html)

See also each individual facet's documentation
See also each individual facet's documentation.


Loading