Skip to content

Commit 6b8453e

Browse files
committed
Build docs
1 parent 8df6283 commit 6b8453e

File tree

11 files changed

+33
-50
lines changed

11 files changed

+33
-50
lines changed

docs/build/elasticsearch-net/connecting.html

+23-7
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,32 @@
22
<script src="/scripts/html5shiv.js"></script><link rel="stylesheet" type="text/css" href="/styles/normalize.css"/><link rel="stylesheet" type="text/css" href="/styles/layout.css"/><link rel="stylesheet" type="text/css" href="/styles/pygments.css"/><link rel="stylesheet" type="text/css" href="/styles/pygments.css"/><link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"/><link href="//fonts.googleapis.com/css?family=Ubuntu+Mono|Open+Sans" rel="stylesheet" type="text/css"/><link href="/prettify/prettify.css" type="text/css" rel="stylesheet"/><link href="/prettify/sunburst.css" type="text/css" rel="stylesheet"/><script src="//code.jquery.com/jquery.min.js" type="text/javascript"></script><script type="text/javascript" src="/prettify/prettify.js"></script><script type="text/javascript" src="/prettify/fix_code_tags.js"></script></head><body><div class="wrapper"><header class="header"><div class="actions"><iframe src="//ghbtns.com/github-btn.html?user=elasticsearch&amp;repo=elasticsearch-net&amp;type=fork&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="95" height="20"></iframe><iframe src="//ghbtns.com/github-btn.html?user=elasticsearch&amp;repo=elasticsearch-net&amp;type=watch&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe></div><img src="/images/elasticsearch-net-nuget-icon.png" width="48" height="48"/><h1>Elasticsearch.Net </h1><p>Documentation</p></header><div class="divide"></div><div class="middle"><div class="container"><main class="content"><h1 id="connecting">Connecting</h1>
33
<p>Connecting to Elasticsearch with <code>Elasticsearch.Net</code> is quite easy but has a few toggles and options worth knowing.</p>
44
<h2 id="choosing-the-right-connection-strategy">Choosing the right connection strategy</h2>
5-
<p>If you simply new an <code>ElasticsearchClient</code> it will be a non-failover connection to <code>http://localhost:9200</code></p>
5+
<p>If you simply new an <code>ElasticsearchClient</code>, it will be a non-failover connection to <code>http://localhost:9200</code></p>
66
<pre><code>var client = new ElasticsearchClient();
7-
</code></pre><p>If your elasticsearch node does not live at <code>http://localhost:9200</code> but i.e <code>http://mynode.example.com:8082/apiKey</code>
8-
you will need to pass in some <code>IConnectionConfigurationValues</code> the easiest way to do this is:</p>
7+
</code></pre><p>If your Elasticsearch node does not live at <code>http://localhost:9200</code> but i.e <code>http://mynode.example.com:8082/apiKey</code>, then
8+
you will need to pass in some instance of <code>IConnectionConfigurationValues</code>.</p>
9+
<p>The easiest way to do this is:</p>
910
<pre><code>var node = new Uri(&quot;http://mynode.example.com:8082/apiKey&quot;);
1011
var config = new ConnectionConfiguration(node);
1112
var client = new ElasticsearchClient(config);
1213
</code></pre><p>This however is still a non-failover connection. Meaning if that <code>node</code> goes down the operation will not be retried on any other nodes in the cluster.</p>
13-
<p>To get a failover connection we have to pass an <code>IConnectionPool</code> instead of a <code>Uri</code>.</p>
14+
<p>To get a failover connection we have to pass an <code>IConnectionPool</code> instance instead of a <code>Uri</code>.</p>
1415
<pre><code>var node = new Uri(&quot;http://mynode.example.com:8082/apiKey&quot;);
1516
var connectionPool = new SniffingConnectionPool(new[] { node });
1617
var config = new ConnectionConfiguration(connectionPool);
1718
var client = new ElasticsearchClient(config);
1819
</code></pre><p>Here instead of directly passing <code>node</code>, we pass a <code>SniffingConnectionPool</code> which will use our <code>node</code> to find out the rest of the available cluster nodes.
1920
Be sure to read more about <a href="/elasticsearch-net/cluster-failover.html">Connection Pooling and Cluster Failover here</a></p>
2021
<h2 id="options">Options</h2>
21-
<p>Besides either passing a <code>Uri</code> or <code>IConnectionPool</code> on the constructor of <code>ConnectionConfiguration</code>, you can also fluently control many more options.</p>
22+
<p>Besides either passing a <code>Uri</code> or <code>IConnectionPool</code> to <code>ConnectionConfiguration</code>, you can also fluently control many more options. For instance:</p>
2223
<pre><code>var config = new ConnectionConfiguration(connectionPool)
2324
.EnableTrace()
24-
.ExposeRawResponse(shouldExposeRawResponse);
25-
</code></pre><h3 id="disableautomaticproxydetection">DisableAutomaticProxyDetection</h3>
25+
.ExposeRawResponse()
26+
.SetBasicAuthentication(&quot;user&quot;, &quot;pass&quot;)
27+
.SetTimeout(5000)
28+
...
29+
</code></pre><p>The following is a list of available connection configuration options:</p>
30+
<h3 id="disableautomaticproxydetection">DisableAutomaticProxyDetection</h3>
2631
<p>Disable automatic proxy detection. Defaults to true.</p>
2732
<h3 id="enablecompressedresponses">EnableCompressedResponses</h3>
2833
<p>Enable compressed responses from Elasticsearch (Note that nodes need to be configured to allow this. See the <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-http.html">http module settings</a> for more info).</p>
@@ -54,4 +59,15 @@ <h3 id="throwonelasticsearchserverexceptions">ThrowOnElasticsearchServerExceptio
5459
<p>As an alternative to the C/go like error checking on <code>response.IsValid</code>, you can instead tell the client to always throw an <code>ElasticsearchServerException</code> when a call resulted in an exception on the Elasticsearch server. Reasons for such exceptions could be search parser errors and index missing exceptions.</p>
5560
<h3 id="useprettyresponses">UsePrettyResponses</h3>
5661
<p>Appends <code>pretty=true</code> to all the requests. Handy if you are debugging or listening to the requests with i.e fiddler. This setting can be safely used in conjuction with <code>SetGlobalQueryStringParameters</code>.</p>
62+
<h3 id="setbasicauthentication">SetBasicAuthentication</h3>
63+
<p>Sets the HTTP basic authentication credentials to specify with all requests.</p>
64+
<p><strong>Note:</strong> This can alternatively be specified on the node URI directly:</p>
65+
<pre><code>var uri = new Uri(&quot;http://username:password@localhost:9200&quot;);
66+
var config = new ConnectionConfiguration(uri);
67+
</code></pre><p>...but may become tedious when using connection pooling with multiple nodes.</p>
68+
<h2 id="configuring-ssl">Configuring SSL</h2>
69+
<p>SSL must be configured outside of the client using .NET&#39;s <a href="http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager%28v=vs.110%29.aspx">ServicePointManager</a> class and setting the <a href="http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.servercertificatevalidationcallback.aspx">ServerCertificateValidationCallback</a> property.</p>
70+
<p>The bare minimum to make .NET accept self-signed SSL certs that are not in the Window&#39;s CA store would be to have the callback simply return <code>true</code>:</p>
71+
<pre><code>ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, errors) =&gt; true;
72+
</code></pre><p>However, this will accept all requests from the AppDomain to untrusted SSL sites, therefore we recommend doing some minimal introspection on the passed in certificate.</p>
5773
</main></div><aside class="left-sidebar"><aside id="menu"><ul><li><h4><a href="/">Home</a><a href="/contributing.html">Contributing</a><a href="/building.html">Building</a><a href="/breaking-changes.html">1.0 Breaking Changes</a><a href="https://github.com/elasticsearch/elasticsearch-net/releases">Release Notes</a></h4></li></ul><ul id="elasticsearch-net"><h4 class="title">Elasticsearch.Net</h4><ul><li><a href="/elasticsearch-net/quick-start.html">Quick Start</a></li><li><a href="/elasticsearch-net/connecting.html" class="selected">Connecting</a></li><li><a href="/elasticsearch-net/cluster-failover.html">Cluster failover</a></li><li><a href="/elasticsearch-net/building-requests.html">Building requests</a></li><li><a href="/elasticsearch-net/handling-responses.html">Handling responses</a></li><li><a href="/elasticsearch-net/errors.html">Errors</a></li></ul></ul><ul id="nest"><h4 class="title">NEST</h4><ul><li><a href="/nest/quick-start.html">Quick Start</a></li><li><a href="/nest/connecting.html">Connecting</a></li><li><a href="/nest/index-type-inference.html">Type/Index Inference</a></li><li><a href="/nest/handling-responses.html">Handling responses</a></li><li><a href="/nest/writing-queries.html">Writing queries</a></li><li><a href="/nest/tips-tricks.html">Tips & Tricks</a></li></ul><li><h4><a href="/nest/core/"><i class="fa fa-chevron-right"></i>Core</a></h4></li><li><h4><a href="/nest/indices/aliases.html"><i class="fa fa-chevron-right"></i>Indices</a></h4></li><li><h4><a href="/nest/cluster/health.html"><i class="fa fa-chevron-right"></i>Cluster</a></h4></li><li><h4><a href="/nest/search/basics.html"><i class="fa fa-chevron-right"></i>Search</a></h4></li><li><h4><a href="/nest/aggregations/handling.html"><i class="fa fa-chevron-right"></i>Aggregations</a></h4></li><li><h4><a href="/nest/facets/handling.html"><i class="fa fa-chevron-right"></i>Facets</a></h4></li></ul></aside></aside></div><footer class="footer"></footer></div></body></html>

docs/build/nest/writing-queries.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
};
1717
</code></pre><h2 id="raw-strings">Raw Strings</h2>
1818
<p>Although not preferred, many folks like to build their own JSON strings and just pass that along:</p>
19-
<pre><code>.QueryRaw(&quot;\&quot;match_all\&quot; : { }&quot;)
20-
.FilterRaw(&quot;\&quot;match_all\&quot; : { }&quot;)
19+
<pre><code>.QueryRaw(@&quot;{&quot;&quot;match_all&quot;&quot;: {} }&quot;)
20+
.FilterRaw(@&quot;{&quot;&quot;match_all&quot;&quot;: {} }&quot;)
2121
</code></pre><p>NEST does not modify this in anyway and just writes this straight into the JSON output. </p>
2222
<h2 id="query-dsl">Query DSL</h2>
2323
<p>The preferred way to write queries, since it gives you alot of cool features.</p>

docs/node_modules/wintersmith-livereload/node_modules/livereload-server/node_modules/livereload-protocol/package.json

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/node_modules/wintersmith-livereload/node_modules/livereload-server/node_modules/websocket.io/node_modules/ws/node_modules/commander/package.json

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/node_modules/wintersmith-livereload/node_modules/livereload-server/node_modules/websocket.io/node_modules/ws/node_modules/options/package.json

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/node_modules/wintersmith-livereload/node_modules/livereload-server/node_modules/websocket.io/node_modules/ws/node_modules/tinycolor/.npmignore

-5
This file was deleted.

docs/node_modules/wintersmith-livereload/node_modules/livereload-server/node_modules/websocket.io/node_modules/ws/node_modules/tinycolor/package.json

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/node_modules/wintersmith-livereload/node_modules/livereload-server/node_modules/websocket.io/node_modules/ws/package.json

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/node_modules/wintersmith-livereload/node_modules/livereload-server/node_modules/websocket.io/package.json

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/node_modules/wintersmith-livereload/node_modules/livereload-server/package.json

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/node_modules/wintersmith-livereload/package.json

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)