- .NET Clients: other versions:
- Introduction
- Building
- Breaking Changes
- Elasticsearch.Net
- NEST
- Core
- Indices
- Cluster
- Search
- Aggregations
- Handling Aggregations
- Avg aggregation
- Cardinality aggregation
- Date Histogram aggregation
- Date Range aggregation
- Extended Stats Aggregation
- Filter aggregation
- Geo Distance aggregation
- Geohash Grid aggregation
- Global aggregation
- Histogram aggregation
- IPv4 Range aggregation
- Max aggregation
- Min aggregation
- Missing aggregation
- Percentiles aggregation
- Percentile Ranks aggregation
- Range aggregation
- Nested aggregation
- Reverse Nested aggregation
- Significant Terms aggregation
- Stats aggregation
- Sum aggregation
- Terms aggregation
- Top Hits aggregation
- Value Count aggregation
WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Quick Start
editQuick Start
editElasticsearch.Net
is a low level client to talk to Elasticsearch.
Installing
editFrom the package manager console inside visual studio
PM> Install-Package Elasticsearch.Net
Or search in the Package Manager UI for Elasticsearch.Net
and go from there
Connecting
editAssumming Elasticsearch is already installed and running on your machine, go to http://localhost:9200 in your browser. You should see a similar response to this:
{ "status" : 200, "name" : "Sin-Eater", "version" : { "number" : "1.0.0", "build_hash" : "a46900e9c72c0a623d71b54016357d5f94c8ea32", "build_timestamp" : "2014-02-12T16:18:34Z", "build_snapshot" : false, "lucene_version" : "4.6" }, "tagline" : "You Know, for Search" }
To connect to your local node from C# simply:
var client = new ElasticsearchClient(); //index a document under /myindex/mytype/1 var indexResponse = client.Index("myindex","mytype","1", new { Hello = "World" });
Please be sure to read the full documentation on connecting with elasticsearch.net to see all the available options.
On this page