diff --git a/cluster/health.html b/cluster/health.html new file mode 100644 index 00000000000..72af991c4f5 --- /dev/null +++ b/cluster/health.html @@ -0,0 +1,99 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/cluster/nodes-info.html b/cluster/nodes-info.html new file mode 100644 index 00000000000..da06272d3b0 --- /dev/null +++ b/cluster/nodes-info.html @@ -0,0 +1,99 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/cluster/nodes-shutdown.html b/cluster/nodes-shutdown.html new file mode 100644 index 00000000000..1329a45d96e --- /dev/null +++ b/cluster/nodes-shutdown.html @@ -0,0 +1,99 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/cluster/nodes-stats.html b/cluster/nodes-stats.html new file mode 100644 index 00000000000..b68e4ce9b79 --- /dev/null +++ b/cluster/nodes-stats.html @@ -0,0 +1,99 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/cluster/state.html b/cluster/state.html new file mode 100644 index 00000000000..8506d441e83 --- /dev/null +++ b/cluster/state.html @@ -0,0 +1,99 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/cluster/update-settings.html b/cluster/update-settings.html new file mode 100644 index 00000000000..de0fb3a28f7 --- /dev/null +++ b/cluster/update-settings.html @@ -0,0 +1,99 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/concepts/connecting.html b/concepts/connecting.html new file mode 100644 index 00000000000..d3800ef4414 --- /dev/null +++ b/concepts/connecting.html @@ -0,0 +1,140 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Connecting

+ +

This section describes how to instantiate a client and have it connect to the server.

+ +

Basic plumbing:

+ +
var elasticSettings = new ConnectionSettings("127.0.0.1.", 9200)
+                          .SetDefaultIndex("mpdreamz");
+var client = new ElasticClient(elasticSettings);
+
+ +

ConnectionSettings's constructor has many overloads, including support for connecting through proxies.

+ +

Connecting

+ +

Connecting can be done several ways:

+ +
ConnectionStatus connectionStatus;
+if (client.TryConnect(out connectionStatus))
+
+ +

Or if you don't care about error reasons

+ +
if (client.IsValid)
+
+ +

both will perform a one time lookup to see if ElasticSearch is available and ready.

+ +

Settings:

+ +

Settings can be set in a fluent fashion: new ConnectionSettings().SetDefaultIndex().SetMaximumConnections()

+ +

DefaultIndex

+ +

Calling SetDefaultIndex() on ConnectionSettings will set the default index for the client. Whenever a method is called that doesn't explicitly passes an index this default will be used.

+ +

MaximumAsyncConnections

+ +

Calling SetMaximumAsyncConnections() on ConnectionSettings will set the maximum async connections the client will send to ElasticSearch at the same time. If the maximum is hit the calls will be queued untill a slot becomes available.

+ +

TypeNameInferrer

+ +

You can pass a Func<string,string> to SetTypeNameInferrer()onConnectionSettings` to overide NEST's default behavior of lowercasing and pluralizing typenames.

+ +

UsePrettyResponses

+ +

Setting UsePrettyResponses() on ConnectionSettings will append pretty=true to all the requests to inform ElasticSearch we want nicely formatted responses, setting this does not prettify requests themselves because bulk requests in ElasticSearch follow a very exact line delimited format.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/concepts/handling-responces.html b/concepts/handling-responces.html new file mode 100644 index 00000000000..65079a84c5b --- /dev/null +++ b/concepts/handling-responces.html @@ -0,0 +1,104 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Handling responces

+ +

All responses have the following properties

+ +

IsValid and ConnectionStatus

+ +

These properties pertain to NEST and whether NEST thinks the response is valid or not. In some cases though elasticsearch responds back with with an ok or acknowledged properties. NEST will always map these fields but they will not influence the IsValid property. If NEST was successful in connecting and getting back a 200 status IsValid will always be true by design. If you need to check for elasticsearch validity check the OK or Acknowledged properties where these apply.

+ +

ConnectionStatus holds the HttpStatusCode and various other interesting information in case a transport error occurred.

+ +

NOTE in most cases elasticsearch will throw a 500 and in that case IsValid will be false too. ConnectionStatus.Result will hold the error message as recieved from elasticsearch.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/concepts/searching.html b/concepts/searching.html new file mode 100644 index 00000000000..1f34ad2cd95 --- /dev/null +++ b/concepts/searching.html @@ -0,0 +1,96 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/bulk.html b/core/bulk.html new file mode 100644 index 00000000000..9aa47fc6c8d --- /dev/null +++ b/core/bulk.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/count.html b/core/count.html new file mode 100644 index 00000000000..0571f94f229 --- /dev/null +++ b/core/count.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/delete-by-query.html b/core/delete-by-query.html new file mode 100644 index 00000000000..9e44e3f6d29 --- /dev/null +++ b/core/delete-by-query.html @@ -0,0 +1,132 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Delete by Query

+ +
this.ConnectedClient.DeleteByQuery<ElasticSearchProject>(q => q.Term(f => f.Name, "elasticsearch.pm"));
+
+ +

Elasticsearch allows you to delete over multiple types and indexes, so does NEST.

+ +
this.ConnectedClient.DeleteByQuery<ElasticSearchProject>(q => q
+    .Indices(new[] { "index1", "index2" })
+    .Term(f => f.Name, "elasticsearch.pm")
+);
+
+ +

As always *Async variants are available too.

+ +

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

+ +
this.ConnectedClient.DeleteByQuery<ElasticSearchProject>(q => q
+    .AllIndices()
+    .Term(f => f.Name, "elasticsearch.pm")
+);
+
+ +

The DeleteByQuery can be further controlled by passing a DeleteByQueryParameters object

+ +
this.ConnectedClient.DeleteByQuery<ElasticSearchProject>(
+    q => q.Term(f => f.Name, "elasticsearch.pm")
+    , new DeleteByQueryParameters { Consistency = Consistency.Quorum, Replication = Replication.Sync, Routing = "NEST" }    
+);
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/delete.html b/core/delete.html new file mode 100644 index 00000000000..2d5238d6865 --- /dev/null +++ b/core/delete.html @@ -0,0 +1,149 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Deleting

+ +

The delete API allows to delete a typed JSON document from a specific index based on its id. See also deleting by query for other ways to delete data.

+ +

By Id

+ +
        this.ConnectedClient.DeleteById<ElasticSearchProject>(searchProject.Id);
+        this.ConnectedClient.DeleteByIdAsync<ElasticSearchProject>(searchProject.Id, c => /* called later */);
+
+ +

By object (T)

+ +

Id property is inferred (can be any value type (int, string, float ...))

+ +
        this.ConnectedClient.Delete(searchProject);
+        this.ConnectedClient.DeleteAsync(searchProject);
+
+ +

By IEnumerable

+ +
        this.ConnectedClient.Delete(searchProjects);
+        this.ConnectedClient.DeleteAsync(searchProjects);
+
+ +

By IEnumerable using bulkparameters

+ +

Using bulk parameters you can control the deletion of each individual document further

+ +
        var bulkedProjects = searchProjects
+            .Select(d=> new BulkParameters<ElasticSearchProject>(d) 
+            { 
+                Version = d.Version, 
+                VersionType = VersionType.External 
+            }
+        );
+        this.ConnectedClient.Delete(bulkedProjects, new SimpleBulkParameters() { Refresh = true });
+
+ +

By Query

+ +

Please see deleting by query

+ +

Indices and Mappings

+ +

Please see delete mapping

+ +

and delete index

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/get.html b/core/get.html new file mode 100644 index 00000000000..8b31d97a879 --- /dev/null +++ b/core/get.html @@ -0,0 +1,115 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Get a document

+ +

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

+ +
var foundDocument = this.ConnectedClient.Get<ElasticSearchProject>("myalternateindex", "elasticprojs", hit.Id);
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/index.html b/core/index.html new file mode 100644 index 00000000000..7fa4a3415e4 --- /dev/null +++ b/core/index.html @@ -0,0 +1,175 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Indexing

+ +

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

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

+ +
client.Index(post, "index", "type", "id");
+
+ +

Asynchronous

+ +

Indexing asynchronously is as easy as:

+ +
//IndexAsync returns a Task<ConnectionStatus>
+var task = client.IndexAsync(post);
+
+ +

Aditional parameters

+ +

You can pass aditional data using IndexParameters

+ +
client.Index(post, new IndexParameters() { VersionType = VersionType.External, Version = "212" });
+
+ +

Similarly to force a wait for a refresh

+ +
client.Index(post, new IndexParameters() { Refresh = true });
+
+ +

Bulk Indexing

+ +

Instead of passing T just pass IEnumerable<T> for both Index() or IndexAsync(). A zero copy approach that writes directly on the post stream is planned in a later version.

+ +

Note +For asynchronous commands there's a special connection setting which automatically semaphores threaded communication +to ES 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 +available.

+ +

Aditional parameters

+ +

Like the overloads just taking a T the IEnumerable<T> has alot of overloads taking in extra parameters.

+ +
client.Index(posts, new SimpleBulkParameters() { Refresh = true });
+
+ +

The reason the IEnumerable<T> overloads take a SimpleBulkParameters is because to pass item specific parameters you'll have to wrap posts in a BulkParameters<T> i.e:

+ +
client.Index(posts.Select(p=>new BulkParameters<T>(p) { Version = p.Version }));
+
+ +

This will do a bulk index on posts but use each individual posts version. Again there's plenty of overloads to mix and match:

+ +
var bulkParams = posts.Select(p=>new BulkParameters<T>(p) { Version = p.Version });
+client.Index(bulkParams , new SimpleBulkParameters() { Refresh = true });
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/more-like-this.html b/core/more-like-this.html new file mode 100644 index 00000000000..14ac7953313 --- /dev/null +++ b/core/more-like-this.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/multi-get.html b/core/multi-get.html new file mode 100644 index 00000000000..b4eabd3ca20 --- /dev/null +++ b/core/multi-get.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Multi Get

+ +

Get multiple documents in a single request.

+ +

Examples

+ +
var ids = new [] { hit1.Id, hit2.Id };
+var foundDocuments = this.ConnectedClient.Get<ElasticSearchProject>(ids);
+
+ +

index and type are infered but overloads exists for full control

+ +
var foundDocuments = this.ConnectedClient.Get<ElasticSearchProject>("myalternateindex", "elasticprojs", ids);
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/multi-search.html b/core/multi-search.html new file mode 100644 index 00000000000..dc8def593c0 --- /dev/null +++ b/core/multi-search.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/percolate.html b/core/percolate.html new file mode 100644 index 00000000000..9fa1bf67509 --- /dev/null +++ b/core/percolate.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/search.html b/core/search.html new file mode 100644 index 00000000000..c32029143c0 --- /dev/null +++ b/core/search.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/core/update.html b/core/update.html new file mode 100644 index 00000000000..30b005f88c5 --- /dev/null +++ b/core/update.html @@ -0,0 +1,115 @@ + + + + + + NEST - Script Update + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Update by script API

+ +

The update API allows to update a document based on a script provided. The operation gets the document (collocated with the shard) from the index, runs the script (with optional script language and parameters), and index back the result (also allows to delete, or ignore the operation). It uses versioning to make sure no updates have happened during the “get” and “reindex”. (available from 0.19 onwards).

+ +
this.ConnectedClient.Update<ElasticSearchProject>(u => u
+    .Object(project)
+    .Script("ctx._source.loc += 10")
+    .RetriesOnConflict(5)
+    .Refresh()
+);
+
+ +

This is just a simple example all the options that are available (such as passing params) are available.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/date-histogram.html b/facets/date-histogram.html new file mode 100644 index 00000000000..c2b2cd2ab86 --- /dev/null +++ b/facets/date-histogram.html @@ -0,0 +1,117 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Date Histogram Facet

+ +

A specific histogram facet that can work with date field types enhancing it over the regular histogram facet. Here is a quick example:

+ +
this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+  .From(0)
+  .Size(10)
+  .MatchAll()
+  .FacetDateHistogram(h => h
+    .OnField(f => f.StartedOn)
+    .Interval(DateInterval.Day)
+    .Factor(1000)
+  )
+);
+
+ +

See original docs for more information

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/filter.html b/facets/filter.html new file mode 100644 index 00000000000..b8291254d43 --- /dev/null +++ b/facets/filter.html @@ -0,0 +1,115 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Filter Facet

+ +

A filter facet (not to be confused with a facet filter) allows you to return a count of the hits matching the filter. The filter itself can be expressed using the Query DSL. For example:

+ +
this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetFilter("wow_facet", filter=>filter
+        .Exists(f=>f.Name)
+    )
+);
+
+ +

See original docs for more information

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/geo-distance.html b/facets/geo-distance.html new file mode 100644 index 00000000000..cb03c19a3cd --- /dev/null +++ b/facets/geo-distance.html @@ -0,0 +1,122 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Geo Distance Facet

+ +

The geodistance facet is a facet providing information for ranges of distances from a provided geopoint including count of the number of hits that fall within each range, and aggregation information (like total).

+ +
this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetGeoDistance("geo1", gd => gd
+        .OnValueField(f=>f.Origin)
+        .PinTo(Lat: 40, Lon: -70)
+        .Ranges(
+            r=>r.To(10),
+            r=>r.From(10).To(20),
+            r=>r.From(20).To(100),
+            r=>r.From(100)
+        )
+    )
+);
+
+ +

See original docs for more information

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/handling.html b/facets/handling.html new file mode 100644 index 00000000000..c24adbb7639 --- /dev/null +++ b/facets/handling.html @@ -0,0 +1,210 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Faceting

+ +

For a good overview of what facets are see the original docs on the subject.

+ +

Specify facets during search.

+ +

In its simplest form you can add a facet to your query like this:

+ +
var queryResults = this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetTerm(t => t
+      .OnField(f => f.Country)
+      .Size(20)
+    )
+);
+
+ +

Adding more then one facet is also really easy:

+ +
var queryResults = this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetTerm(t => t
+      .OnField(f => f.Country)
+      .Size(20)
+    )
+    .FacetTerm(t => t
+      .OnField(f => f.Author)
+      .Size(20)
+    )
+);
+
+ +

Nest supports all the additional properties you can set on facets

+ +
var queryResults = this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetTerm(t => t
+      .OnField(f => f.Country)
+      .Size(20)
+      .Order(TermsOrder.reverse_count)
+      .Exclude("term1", "term2")
+      .AllTerms()
+      .Regex(@"\s+", RegexFlags.DOTALL)
+      .Script("term + 'aaa'")
+      .ScriptField("_source.my_field")
+    )
+    .FacetDateHistogram(h => h
+      .OnField(f => f.StartedOn)
+      .Interval(DateInterval.Day, DateRounding.Half_Floor)
+      .TimeZones(Pre: "-3", Post: "-4")
+  )
+);
+
+ +

Allowing you to take advantage of all the cool facets stuff built in to 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.

+ +

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));
+
+ +

NEST will infer the right key from the specified lambda. You can also opt for specifying the name directly.

+ +
var facets = queryResults.FacetItems<FacetItem>("followers.lastName");
+
+ +

NOTE more types then just term facets are supported see the 'Corresponding Types' section

+ +

Corresponding Types

+ +

The following lists the elasticsearch facet type and their corresponding NEST strongly typed class

+ +

terms_stats => TermStatsFacet

+ +

statistical => StatisticalFacet

+ +

terms => TermFacet

+ +

histogram => HistogramFacet

+ +

date_histogram => DateHistogramFacet

+ +

range => DateRangeFacet, RangeFacet

+ +

geo_distance => GeoDistanceFacet

+ +

query => QueryFacet

+ +

filter => FilterFacet

+ +

See also each individual facet's documentation

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/histogram.html b/facets/histogram.html new file mode 100644 index 00000000000..c15ad0d095b --- /dev/null +++ b/facets/histogram.html @@ -0,0 +1,113 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Histogram Facet

+ +

The histogram facet works with numeric data by building a histogram across intervals of the field values. Each value is “rounded” into an interval (or placed in a bucket), and statistics are provided per interval/bucket (count and total). Here is a simple example:

+ +
this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetHistogram(h => h.OnField(f=>f.LOC).Interval(100))
+);
+
+ +

See original docs for more information

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/query.html b/facets/query.html new file mode 100644 index 00000000000..7748080b5e4 --- /dev/null +++ b/facets/query.html @@ -0,0 +1,115 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Query Facet

+ +

A facet query allows to return a count of the hits matching the facet query. The query itself can be expressed using the Query DSL. For example:

+ +
this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetQuery("wow_facet", q=>q
+        .Term(f=>f.Name, "elasticsearch.pm")
+    );
+);
+
+ +

See original docs for more information

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/range.html b/facets/range.html new file mode 100644 index 00000000000..b86168a5af1 --- /dev/null +++ b/facets/range.html @@ -0,0 +1,175 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

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:

+ +
this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetRange<int>(t => t
+        .OnField(f => f.LOC)
+        .Ranges(
+            r=>r.To(50),
+            r=>r.From(50).To(100),
+            r=>r.From(100).To(150),
+            r=>r.From(150).To(200),
+            r=>r.From(200).To(250),
+            r=>r.From(250)
+        )
+    );
+);
+
+ +

Ranges can also be passed as double:

+ +
//SNIP
+.FacetRange<double>(t => t
+.OnField(f => f.LOC)
+    .Ranges(
+        r => r.To(50.0),
+        r => r.From(50.0).To(100.0),
+        r => r.From(100.0)
+    )
+)
+//SNIP
+
+ +

or DateTime:

+ +
//SNIP
+.FacetRange<DateTime>(t => t
+    .OnField(f => f.StartedOn)
+    .Ranges(
+        r => r.To(new DateTime(1990,1,1).Date)
+    )
+);
+//SNIP
+
+ +

You can also pass scripts to create complex range facets:

+ +
//SNIP
+.FacetRange<DateTime>("needs_a_name", t => t
+    .KeyScript("doc['date'].date.minuteOfHour")
+    .ValueScript("doc['num1'].value")
+    .Ranges(
+        r => r.To(new DateTime(1990, 1, 1).Date)
+    )
+)
+//SNIP
+
+ +

or alternative key/value fields

+ +
//SNIP
+.FacetRange<DateTime>("needs_a_name", t => t
+    .KeyField("field_name")
+    .ValueField("another_field_name")
+    .Ranges(
+        r => r.To(new DateTime(1990, 1, 1).Date)
+    )
+);
+//SNIP
+
+ +

See original docs for more information

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/statistical.html b/facets/statistical.html new file mode 100644 index 00000000000..b3191437f62 --- /dev/null +++ b/facets/statistical.html @@ -0,0 +1,115 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

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:

+ +
this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetStatistical(sf=>sf
+        .OnField(f=>f.LOC)
+    )
+);
+
+ +

See original docs for more information

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/term-stats.html b/facets/term-stats.html new file mode 100644 index 00000000000..e88f27b05ef --- /dev/null +++ b/facets/term-stats.html @@ -0,0 +1,113 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

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:

+ +
this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetTerm(t => t.OnField(f => f.Country).Size(20))
+);
+
+ +

See original docs for more information

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/facets/terms.html b/facets/terms.html new file mode 100644 index 00000000000..18e888aaff2 --- /dev/null +++ b/facets/terms.html @@ -0,0 +1,113 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Terms Facet

+ +

Allow to specify field facets that return the N most frequent terms. For example:

+ +
this.ConnectedClient.Search<ElasticSearchProject>(s=>s
+    .From(0)
+    .Size(10)
+    .MatchAll()
+    .FacetTerm(t => t.OnField(f => f.Country).Size(20))
+);
+
+ +

See original docs for more information

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/and.html b/filter/and.html new file mode 100644 index 00000000000..ddbcff5d048 --- /dev/null +++ b/filter/and.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/bool.html b/filter/bool.html new file mode 100644 index 00000000000..a3fb58847d6 --- /dev/null +++ b/filter/bool.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/exists.html b/filter/exists.html new file mode 100644 index 00000000000..696df4e0249 --- /dev/null +++ b/filter/exists.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/geo-bbox.html b/filter/geo-bbox.html new file mode 100644 index 00000000000..83ebaa5a046 --- /dev/null +++ b/filter/geo-bbox.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/geo-distance-range.html b/filter/geo-distance-range.html new file mode 100644 index 00000000000..e77b62bf307 --- /dev/null +++ b/filter/geo-distance-range.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/geo-distance.html b/filter/geo-distance.html new file mode 100644 index 00000000000..5d0c24201f8 --- /dev/null +++ b/filter/geo-distance.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/geo-polygon.html b/filter/geo-polygon.html new file mode 100644 index 00000000000..784b5bfd770 --- /dev/null +++ b/filter/geo-polygon.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/has-child.html b/filter/has-child.html new file mode 100644 index 00000000000..d0bc9568f30 --- /dev/null +++ b/filter/has-child.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/ids.html b/filter/ids.html new file mode 100644 index 00000000000..85ae81492db --- /dev/null +++ b/filter/ids.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/limit.html b/filter/limit.html new file mode 100644 index 00000000000..eddd329f6f5 --- /dev/null +++ b/filter/limit.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/match-all.html b/filter/match-all.html new file mode 100644 index 00000000000..08dd01491b4 --- /dev/null +++ b/filter/match-all.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/missing.html b/filter/missing.html new file mode 100644 index 00000000000..8392ff6874f --- /dev/null +++ b/filter/missing.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/nested.html b/filter/nested.html new file mode 100644 index 00000000000..223bde22888 --- /dev/null +++ b/filter/nested.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/not.html b/filter/not.html new file mode 100644 index 00000000000..791355d8e5e --- /dev/null +++ b/filter/not.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/numeric-range.html b/filter/numeric-range.html new file mode 100644 index 00000000000..f748c034ba8 --- /dev/null +++ b/filter/numeric-range.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/or.html b/filter/or.html new file mode 100644 index 00000000000..22d8429e2e6 --- /dev/null +++ b/filter/or.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/prefix.html b/filter/prefix.html new file mode 100644 index 00000000000..809349e32b5 --- /dev/null +++ b/filter/prefix.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/query.html b/filter/query.html new file mode 100644 index 00000000000..b247afa661b --- /dev/null +++ b/filter/query.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/range.html b/filter/range.html new file mode 100644 index 00000000000..561c78452e8 --- /dev/null +++ b/filter/range.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/script.html b/filter/script.html new file mode 100644 index 00000000000..2fec6de9f2e --- /dev/null +++ b/filter/script.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/term.html b/filter/term.html new file mode 100644 index 00000000000..29582d6bea2 --- /dev/null +++ b/filter/term.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/terms.html b/filter/terms.html new file mode 100644 index 00000000000..07228e764f7 --- /dev/null +++ b/filter/terms.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/filter/type.html b/filter/type.html new file mode 100644 index 00000000000..e0760de491f --- /dev/null +++ b/filter/type.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/guide/introduction.html b/guide/introduction.html new file mode 100644 index 00000000000..5be5b871205 --- /dev/null +++ b/guide/introduction.html @@ -0,0 +1,187 @@ + + + + NEST - Blogging Like a Hacker + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Introductions

+ +

NEST aims to be a .net client with a very concise API. Its main goal is to provide a solid strongly typed Elasticsearch client. It also has string/dynamic overloads for more dynamic usecases.

+ +

Indexing is as simple as:

+ +
var post = new Post() { Id = 12, ... }
+client.Index(post);
+
+ +

Indexing asynchronously is as easy as:

+ +
client.IndexAsync(post, (c) => /* called later */);
+
+ +

Searching is fluid:

+ +
var results = this.ConnectedClient.Search<ElasticSearchProject>(s => s
+        .From(0)
+        .Size(10)
+        .Fields(f => f.Id, f => f.Name)
+        .SortAscending(f => f.LOC)
+        .SortDescending(f => f.Name)
+        .Query(q=>q.Term(f=>f.Name, "NEST", Boost: 2.0))
+);
+
+ +

For more examples please refer to the Wiki

+ + + +

To get a good overview of the status of NEST please keep an eye out on the public Roadmap

+ +

Copyright

+ +

Copyright (c) 2010 Martijn Laarman and everyone wonderful enough to contribute to NEST

+ +

A special shoutout to @stephenpope for allowing his port +of the java factory based dsl Rubber to be merged into NEST. +NEST now has two types of query dsl's (lambda and factory based)!

+ +

Some of the other wonderful features in NEST were pushed by these wonderful folks:

+ + + +

License

+ +

NEST is licensed under MIT. Refer to license.txt for more information.

+ + + +
 
+ +
+
+
+
+ Fork me on GitHub + + + + diff --git a/guide/introduction.markdown b/guide/introduction.markdown new file mode 100644 index 00000000000..1a2cc2c6a9f --- /dev/null +++ b/guide/introduction.markdown @@ -0,0 +1,79 @@ +--- +layout: default +title: Blogging Like a Hacker +menu_item: introduction +--- + +# Introduction + +NEST aims to be a .net client with a very concise API. Its main goal is to provide a solid strongly typed Elasticsearch client. It also has string/dynamic overloads for more dynamic usecases. + + +Indexing is as simple as: + + var post = new Post() { Id = 12, ... } + client.Index(post); + +Indexing asynchronously is as easy as: + + client.IndexAsync(post, (c) => /* called later */); + +Searching is fluid: + + var results = this.ConnectedClient.Search(s => s + .From(0) + .Size(10) + .Fields(f => f.Id, f => f.Name) + .SortAscending(f => f.LOC) + .SortDescending(f => f.Name) + .Query(q=>q.Term(f=>f.Name, "NEST", Boost: 2.0)) + ); + +For more examples please refer to the [Wiki](https://github.com/Mpdreamz/NEST/wiki "Read more about NEST's interface") + +* [Connecting](https://github.com/Mpdreamz/NEST/wiki/Connecting) +* [Indexing](https://github.com/Mpdreamz/NEST/wiki/Index) +* [Searching](https://github.com/Mpdreamz/NEST/wiki/Search) + * [Faceting] (https://github.com/Mpdreamz/NEST/wiki/Faceting) +* [Deleting](https://github.com/Mpdreamz/NEST/wiki/Delete) +* [Mapping](https://github.com/Mpdreamz/NEST/wiki/Mapping) + + +To get a good overview of the status of NEST please keep an eye out on the public [Roadmap](https://github.com/Mpdreamz/NEST/wiki/RoadMap) + +## Copyright + +Copyright (c) 2010 Martijn Laarman and everyone wonderful enough to contribute to [NEST](https://github.com/Mpdreamz/NEST) + +A special shoutout to [@stephenpope](http://github.com/stephenpope) for allowing his port +of the java factory based dsl [Rubber](http://github.com/stephenpope/Rubber) to be merged into NEST. +NEST now has **two types of query dsl's** (lambda and factory based)! + +Some of the other wonderful features in NEST were pushed by these wonderful folks: + +* [@nordbergm](https://github.com/nordbergm/NEST) +* [@kevingessner](https://github.com/kevingessner/NEST) +* [@EFJoseph](https://github.com/EFJoseph/NEST) +* [@pkrakowiak](https://github.com/pkrakowiak/NEST) +* [@q42jaap] (https://github.com/q42jaap/NEST) + +## License + +NEST is licensed under [MIT](http://www.opensource.org/licenses/mit-license.php "Read more about the MIT license form"). Refer to [license.txt](https://github.com/Mpdreamz/NEST/blob/master/src/license.txt) for more information. + + + +
 
diff --git a/guide/introduction.md b/guide/introduction.md new file mode 100644 index 00000000000..d8b45fcf78d --- /dev/null +++ b/guide/introduction.md @@ -0,0 +1,61 @@ +# NEST + +*Strongly typed Elasticsearch client* + +NEST aims to be a .net client with a very concise API. + +```ruby +require 'redcarpet' +markdown = Redcarpet.new("Hello World!") +puts markdown.to_html +``` + +Indexing is as simple as: + + var post = new Post() { Id = 12, ... } + client.Index(post); + +Indexing asynchronously is as easy as: + +Searching is fluid: + + var results = this.ConnectedClient.Search(s => s + .From(0) + .Size(10) + .Fields(f => f.Id, f => f.Name) + .SortAscending(f => f.LOC) + .SortDescending(f => f.Name) + .Query(q=>q.Term(f=>f.Name, "NEST", Boost: 2.0)) + ); + +For more examples please refer to the [Wiki](https://github.com/Mpdreamz/NEST/wiki "Read more about NEST's interface") + +* [Connecting](https://github.com/Mpdreamz/NEST/wiki/Connecting) +* [Indexing](https://github.com/Mpdreamz/NEST/wiki/Index) +* [Searching](https://github.com/Mpdreamz/NEST/wiki/Search) + * [Faceting] (https://github.com/Mpdreamz/NEST/wiki/Faceting) +* [Deleting](https://github.com/Mpdreamz/NEST/wiki/Delete) +* [Mapping](https://github.com/Mpdreamz/NEST/wiki/Mapping) + + +To get a good overview of the status of NEST please keep an eye out on the public [Roadmap](https://github.com/Mpdreamz/NEST/wiki/RoadMap) + +## Copyright + +Copyright (c) 2010 Martijn Laarman and everyone wonderful enough to contribute to [NEST](https://github.com/Mpdreamz/NEST) + +A special shoutout to [@stephenpope](http://github.com/stephenpope) for allowing his port +of the java factory based dsl [Rubber](http://github.com/stephenpope/Rubber) to be merged into NEST. +NEST now has **two types of query dsl's** (lambda and factory based)! + +Some of the other wonderful features in NEST were pushed by these wonderful folks: + +* [@nordbergm](https://github.com/nordbergm/NEST) +* [@kevingessner](https://github.com/kevingessner/NEST) +* [@EFJoseph](https://github.com/EFJoseph/NEST) +* [@pkrakowiak](https://github.com/pkrakowiak/NEST) +* [@q42jaap] (https://github.com/q42jaap/NEST) + +## License + +NEST is licensed under [MIT](http://www.opensource.org/licenses/mit-license.php "Read more about the MIT license form"). Refer to [license.txt](https://github.com/Mpdreamz/NEST/blob/master/src/license.txt) for more information. \ No newline at end of file diff --git a/images/bg-body.png b/images/bg-body.png new file mode 100644 index 00000000000..392e4d23ce8 Binary files /dev/null and b/images/bg-body.png differ diff --git a/images/bg-header.png b/images/bg-header.png new file mode 100644 index 00000000000..0030db1b29c Binary files /dev/null and b/images/bg-header.png differ diff --git a/images/nuget-icon.png b/images/nuget-icon.png new file mode 100644 index 00000000000..cd7de4869fc Binary files /dev/null and b/images/nuget-icon.png differ diff --git a/images/source.png b/images/source.png new file mode 100644 index 00000000000..095d3d2b8b4 Binary files /dev/null and b/images/source.png differ diff --git a/index.html b/index.html new file mode 100644 index 00000000000..0e64aac82e3 --- /dev/null +++ b/index.html @@ -0,0 +1,170 @@ + + + + + + NEST - Introduction + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Introduction

+ +

NEST aims to be a .net client with a very concise API. Its main goal is to provide a solid strongly typed Elasticsearch client. It also has string/dynamic overloads for more dynamic usecases.

+ +

Indexing is as simple as:

+ +
var post = new Post() { Id = 12, ... }
+client.Index(post);
+
+ +

Indexing asynchronously is as easy as:

+ +
//IndexAsync returns a Task<ConnectionStatus>
+var task = client.IndexAsync(post);
+
+ +

Searching is fluid:

+ +
var results = this.ConnectedClient.Search<ElasticSearchProject>(s => s
+        .From(0)
+        .Size(10)
+        .Fields(f => f.Id, f => f.Name)
+        .SortAscending(f => f.LOC)
+        .SortDescending(f => f.Name)
+        .Query(q=>q.Term(f=>f.Name, "NEST", Boost: 2.0))
+);
+
+ +

Installing

+ +

Nest can be installed through NuGet:

+ +
PM> Install-Package NEST
+
+ +

Or searching for "elasticsearch" will get you to nest as well.

+ +

Copyright

+ +

Copyright (c) 2010 Martijn Laarman and everyone wonderful enough to contribute to NEST

+ +

License

+ +

NEST is licensed under MIT. Refer to license.txt for more information.

+ +

Contributors

+ +

A special shoutout to @stephenpope for allowing his port +of the java factory based dsl Rubber to be merged into NEST. +NEST now has two types of query dsl's (lambda and factory based)!

+ +

Some of the other wonderful features in NEST were pushed by these wonderful folks:

+ + + + + +
 
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/aliases.html b/indices/aliases.html new file mode 100644 index 00000000000..41202c0df59 --- /dev/null +++ b/indices/aliases.html @@ -0,0 +1,126 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Aliasing

+ +

Adding

+ +
var response = this.ConnectedClient.Alias("nest_test_data", "nest_test_data2");
+
+ +

Renaming

+ +
var response = this.ConnectedClient.Rename("nest_test_data", "nest_test_data2", "nest_test_data3");
+
+ +

Removing

+ +
var response = this.ConnectedClient.RemoveAlias("nest_test_data", "nest_test_data3");
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/analyze.html b/indices/analyze.html new file mode 100644 index 00000000000..3c47b3a0098 --- /dev/null +++ b/indices/analyze.html @@ -0,0 +1,131 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Analyze

+ +

Performs the analysis process on a text and return the tokens breakdown of the text.

+ +

Analyze using default index's default analyzer

+ +
var text = "this is a string with some spaces and stuff";
+var r = this.ConnectedClient.Analyze(text);
+
+ +

Analyze using a fields analyzer

+ +
var text = "this is a string with some spaces and stuff";
+var r = this.ConnectedClient.Analyze<ElasticSearchProject>(p => p.Content, text);
+
+ +

Analyze using parameters

+ +
var analyzer = new AnalyzeParams { Analyzer = "whitespace", Index = Test.Default.DefaultIndex + "_clone" };
+var r = this.ConnectedClient.Analyze(analyzer, text);
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/clear-cache.html b/indices/clear-cache.html new file mode 100644 index 00000000000..2c6a2461e83 --- /dev/null +++ b/indices/clear-cache.html @@ -0,0 +1,123 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Clear cache

+ +

The clear cache API allows to clear either all caches or specific cached associated with one ore more indices.

+ +

ClearAll

+ +
var r = this.ConnectedClient.ClearCache();
+
+ +

Typed with advanced options

+ +
var r = this.ConnectedClient.ClearCache<ElasticSearchProject>(ClearCacheOptions.Filter | ClearCacheOptions.Bloom); 
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/create-index.html b/indices/create-index.html new file mode 100644 index 00000000000..a215aa09dec --- /dev/null +++ b/indices/create-index.html @@ -0,0 +1,188 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Create index

+ +

The create index API allows to instantiate an index. ElasticSearch provides support for multiple indices, including executing operations across several indices. Each index created can have specific settings associated with it.

+ +

Note

+ +

When adding settings strip the index. prefix when passing settings found for example here:http://www.elasticsearch.org/guide/reference/index-modules/

+ +

Simple example

+ +
var client = this.ConnectedClient;
+var settings = new IndexSettings();
+settings.NumberOfReplicas = 1;
+settings.NumberOfShards = 5;
+settings.Add("merge.policy.merge_factor","10");
+settings.Add("search.slowlog.threshold.fetch.warn", "1s");
+client.CreateIndex("myindexname", settings);
+
+ +

Create index with type and name

+ +
var typeMapping = new TypeMapping("mytype");
+var type = new TypeMappingProperty
+{
+    Type = "string",
+    Index = "not_analyzed",
+    Boost = 2.0
+    // Many more options available
+};
+typeMapping.Properties = new Dictionary<string, TypeMappingProperty>();
+typeMapping.Properties.Add("name", type);
+
+var settings = new IndexSettings();
+settings.Mappings.Add(typeMapping);
+settings.NumberOfReplicas = 1;
+settings.NumberOfShards = 5;
+settings.Analysis.Analyzer.Add("snowball", new SnowballAnalyzerSettings { Language = "English" });
+
+var indexName = Guid.NewGuid().ToString();
+var response = client.CreateIndex(indexName, settings);
+
+ +

Create Index with type and field settings

+ +

Creates a multimap field "name"

+ +
var client = this.ConnectedClient;
+var typeMapping = new TypeMapping(Guid.NewGuid().ToString("n"));
+var property = new TypeMappingProperty
+{
+    Type = "multi_field"
+};
+
+var primaryField = new TypeMappingProperty
+{
+    Type = "string", 
+    Index = "not_analyzed"
+};
+var analyzedField = new TypeMappingProperty
+{
+    Type = "string", 
+    Index = "analyzed"
+};
+
+property.Fields = new Dictionary<string, TypeMappingProperty>();
+property.Fields.Add("name", primaryField);
+property.Fields.Add("name_analyzed", analyzedField);
+
+typeMapping.Properties.Add("name", property);
+var settings = new IndexSettings();
+settings.Mappings.Add(typeMapping);
+settings.NumberOfReplicas = 1;
+settings.NumberOfShards = 5;
+settings.Analysis.Analyzer.Add("snowball", new SnowballAnalyzerSettings { Language = "English" });
+
+var indexName = Guid.NewGuid().ToString();
+var response = client.CreateIndex(indexName, settings);
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/delete-index.html b/indices/delete-index.html new file mode 100644 index 00000000000..1c47eb17eaf --- /dev/null +++ b/indices/delete-index.html @@ -0,0 +1,127 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Delete Index

+ +

The delete index API allows to delete an existing index.

+ +

The delete index API can also be applied to more than one index, or on _all indices (be careful!). All indices will also be deleted when no specific index is provided. In order to disable allowing to delete all indices, set action.disable_delete_all_indices setting in the config to true.

+ +

Examples

+ +

Using the default index

+ +
this.ConnectedClient.DeleteIndex<ElasticSearchProject>()
+
+ +

or more explictly

+ +
this.ConnectedClient.DeleteIndex("index")
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/delete-mapping.html b/indices/delete-mapping.html new file mode 100644 index 00000000000..31db32fd69d --- /dev/null +++ b/indices/delete-mapping.html @@ -0,0 +1,127 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Delete Mapping

+ +

Allow to delete a mapping (type) along with its data. The REST endpoint is /{index}/{type} with DELETE method.

+ +

Note, most times, it make more sense to reindex the data into a fresh index compared to delete large chunks of it.

+ +

Examples

+ +

Using the default index and the inferred type name

+ +
this.ConnectedClient.DeleteMapping<ElasticSearchProject>()
+
+ +

or more explictly:

+ +
this.ConnectedClient.DeleteMapping<ElasticSearchProject>("alternateindex","alternatetypename")
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/flush.html b/indices/flush.html new file mode 100644 index 00000000000..7bae629f9b4 --- /dev/null +++ b/indices/flush.html @@ -0,0 +1,131 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Flush

+ +

Flush all

+ +
var r = this.ConnectedClient.Flush();
+
+ +

Flush index

+ +
var r = this.ConnectedClient.Flush("index");
+
+ +

Flush several indices

+ +
var r = this.ConnectedClient.Flush(new[] { "index", "index2" });
+
+ +

Flush by type and wait for the refresh

+ +
var r = this.ConnectedClient.Flush<ElasticSearchProject>(true);
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/get-mapping.html b/indices/get-mapping.html new file mode 100644 index 00000000000..20e52dcd120 --- /dev/null +++ b/indices/get-mapping.html @@ -0,0 +1,116 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Get mapping

+ +

The get mapping API allows to retrieve mapping definition of index or index/type.

+ +
var mapping = this.ConnectedClient.GetMapping<ElasticSearchProject>();
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/get-settings.html b/indices/get-settings.html new file mode 100644 index 00000000000..0dc099e3b33 --- /dev/null +++ b/indices/get-settings.html @@ -0,0 +1,122 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Get settings

+ +

The get settings API allows to retrieve settings of index/indices

+ +
var r = this.ConnectedClient.GetIndexSettings(index);
+Assert.True(r.Success);
+Assert.NotNull(r.Settings);
+Assert.AreEqual(r.Settings.NumberOfReplicas, 4);
+Assert.AreEqual(r.Settings.NumberOfShards, 8);
+Assert.Greater(r.Settings.Count(), 0);
+Assert.True(r.Settings.ContainsKey("merge.policy.merge_factor"));
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/indices-exists.html b/indices/indices-exists.html new file mode 100644 index 00000000000..f92301000a8 --- /dev/null +++ b/indices/indices-exists.html @@ -0,0 +1,127 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Indices exists

+ +

Used to check if the index (indices) exists or not.

+ +

Unknown index

+ +
var r = this.ConnectedClient.IndexExists("yadadadadadaadada");
+Assert.False(r.Exists);
+//404 is a valid response in this case
+Assert.True(r.IsValid);
+
+ +

Known index

+ +
var r = this.ConnectedClient.IndexExists("nest_test_data");
+Assert.True(r.Exists);
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/open-close.html b/indices/open-close.html new file mode 100644 index 00000000000..6ce7c0eae9e --- /dev/null +++ b/indices/open-close.html @@ -0,0 +1,125 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Open/Close Index

+ +

The open and close index APIs allow to close an index, and later on opening it. A closed index has almost no overhead on the cluster (except for maintaining its metadata), and is blocked for read/write operations. A closed index can be opened which will then go through the normal recovery process.

+ +

Open and close and index by name

+ +
var r = this.ConnectedClient.CloseIndex(Test.Default.DefaultIndex);
+r = this.ConnectedClient.OpenIndex(Test.Default.DefaultIndex);
+
+ +

Open and close default index

+ +
var r = this.ConnectedClient.CloseIndex<ElasticSearchProject>();
+r = this.ConnectedClient.OpenIndex<ElasticSearchProject>();
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/optimize.html b/indices/optimize.html new file mode 100644 index 00000000000..6358bc9a1f4 --- /dev/null +++ b/indices/optimize.html @@ -0,0 +1,125 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Optimize

+ +

The optimize API allows to optimize one or more indices through an API. The optimize process basically optimizes the index for faster search operations (and relates to the number of segments a lucene index within each shard). The optimize operation allows to optimize the number of segments to optimize to.

+ +

Optimize all

+ +
var r = this.ConnectedClient.Optimize();
+
+ +

Optimize several indices with parameters

+ +
var r = this.ConnectedClient.Optimize(new[] { "index", "index2" }, new OptimizeParams {MaximumSegments=2});
+
+ +

More overloads exists and all OptimizeParams are mapped. See the original docs for parameters

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/put-mapping.html b/indices/put-mapping.html new file mode 100644 index 00000000000..f9a39fa22d9 --- /dev/null +++ b/indices/put-mapping.html @@ -0,0 +1,190 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Put Mapping

+ +

The put mapping API allows to register specific mapping definition for a specific type.

+ +

Attribute based mapping

+ +

You can decorate your classes with ElasticProperty and ElasticType attributes to describe how they should be mapped in ES.

+ +
[ElasticType(
+    Name = "elasticsearchprojects2",
+    DateDetection = true,
+    NumericDetection = true,
+    SearchAnalyzer = "standard",
+    IndexAnalyzer = "standard",
+    DynamicDateFormats = new[] { "dateOptionalTime", "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z" }
+)]
+public class ElasticSearchProject
+{
+    public int Id { get; set;  }
+    public string Name { get; set; }
+    [ElasticProperty(OmitNorms = true, Index = FieldIndexOption.not_analyzed)]
+    public string Country { get; set; }
+    public string Content { get; set; }
+    [ElasticProperty(Name="loc")]
+    public int LOC { get; set; }
+    public List<Person> Followers { get; set; }
+
+    [ElasticProperty(Type=FieldType.geo_point)]
+    public GeoLocation Origin { get; set; }
+    public DateTime StartedOn { get; set; }
+
+
+    //excuse the lame properties i needed some numerics !
+    public long LongValue { get; set; }
+    public float FloatValue { get; set; }
+    public double DoubleValue { get; set; }
+
+    [ElasticProperty(NumericType=NumericType.Long)]
+    public int StupidIntIWantAsLong { get; set; }
+}
+
+ +

You can persist this mapping by simpling calling

+ +
var response = this.ConnectedClient.Map<ElasticSearchProject>();
+
+ +

NOTE: Whenever the client needs to infer the typename for ElasticSearchProject it will resolve nicely to "elasticsearchprojects2" now too. This gives you great control over naming without having to specify the typename on each call.

+ +

ALSO NOTE: Map<T>() will also explicitly map string properties as strings with elasticsearch even if they do not have an attribute on them. It does this for all the value types (string, int, float, double, DateTime).

+ +

Code based mapping

+ +

You can also create mappings on the fly:

+ +
var typeMapping = new TypeMapping(Guid.NewGuid().ToString("n"));
+var property = new TypeMappingProperty
+{
+    Type = "multi_field"
+};
+
+var primaryField = new TypeMappingProperty
+{
+    Type = "string", 
+    Index = "not_analyzed"
+};
+
+var analyzedField = new TypeMappingProperty
+{
+    Type = "string", 
+    Index = "analyzed"
+};
+
+property.Fields = new Dictionary<string, TypeMappingProperty>();
+property.Fields.Add("name", primaryField);
+property.Fields.Add("name_analyzed", analyzedField);
+
+typeMapping.Properties.Add("name", property);
+this.ConnectedClient.Map(typeMapping);
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/refresh.html b/indices/refresh.html new file mode 100644 index 00000000000..fdcada3067c --- /dev/null +++ b/indices/refresh.html @@ -0,0 +1,129 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Refresh

+ +

The refresh API allows to explicitly refresh one or more index, making all operations performed since the last refresh available for search. The (near) real-time capabilities depends on the index engine used. For example, the robin one requires refresh to be called, but by default a refresh is scheduled periodically.

+ +

Refresh all

+ +
var r = this.ConnectedClient.Refresh();
+
+ +

Index / Indeces

+ +
var r = this.ConnectedClient.Refresh("index");
+r = this.ConnectedClient.Refresh(new [] {"index4", "index2" });
+
+ +

Typed (default index)

+ +
var r = this.ConnectedClient.Refresh<ElasticSearchProject>();
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/segments.html b/indices/segments.html new file mode 100644 index 00000000000..3dd9b5ca205 --- /dev/null +++ b/indices/segments.html @@ -0,0 +1,119 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Segments

+ +

Provide low level segments information that a Lucene index (shard level) is built with. Allows to be used to provide more information on the state of a shard and an index, possibly optimization information, data “wasted” on deletes, and so on.

+ +

All indices segments information

+ +
var r = this.ConnectedClient.Segments();
+r.Indices[this.Settings.DefaultIndex].Shards["0"].Segments["_l"].SizeInBytes;
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/snapshot.html b/indices/snapshot.html new file mode 100644 index 00000000000..eefaea88d5a --- /dev/null +++ b/indices/snapshot.html @@ -0,0 +1,130 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Snapshot

+ +

The gateway snapshot API allows to explicitly perform a snapshot through the gateway of one or more indices (backup them). By default, each index gateway periodically snapshot changes, though it can be disabled and be controlled completely through this API.

+ +

Note, this API only applies when using shared storage gateway implementation, and does not apply when using the (default) local gateway.

+ +

All

+ +
var r = this.ConnectedClient.Snapshot();
+
+ +

Snapshot Index

+ +
var r = this.ConnectedClient.Snapshot("index");
+
+ +

Typed

+ +
var r = this.ConnectedClient.Snapshot<ElasticSearchProject>();
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/stats.html b/indices/stats.html new file mode 100644 index 00000000000..a5a7e253657 --- /dev/null +++ b/indices/stats.html @@ -0,0 +1,138 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Indices stats api

+ +

Indices level stats provide statistics on different operations happening on an index. The API provides statistics on the index level scope (though most stats can also be retrieved using node level scope).

+ +

Global Stats

+ +
var r = this.ConnectedClient.Stats();
+var deletedOnPrimaries = r.Stats.Primaries.Documents.Deleted;
+var deletedOnIndexPrimaries = r.Stats.Indices["nest_test_data"].Primaries.Documents.Count;
+
+ +

Index Stats

+ +
var r = this.ConnectedClient.Stats("nest_test_data");
+var deletedOnIndexPrimaries = r.Stats.Primaries.Documents.Deleted;
+
+ +

Stats params

+ +
var r = this.ConnectedClient.Stats(new StatsParams()
+{
+    InfoOn = StatsInfo.All,
+    Refresh = true,
+    Types = new List<string>{ "elasticsearchprojects" }
+
+});
+var x = r.Stats.Primaries.Indexing.Types["elasticsearchprojects"].Current;
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/status.html b/indices/status.html new file mode 100644 index 00000000000..f4623706510 --- /dev/null +++ b/indices/status.html @@ -0,0 +1,113 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/indices/templates.html b/indices/templates.html new file mode 100644 index 00000000000..fd8efa279f9 --- /dev/null +++ b/indices/templates.html @@ -0,0 +1,113 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Index Templates API

+ +

The index templates api is not currently mapped in NEST.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/indices/update-settings.html b/indices/update-settings.html new file mode 100644 index 00000000000..f12ac6b8095 --- /dev/null +++ b/indices/update-settings.html @@ -0,0 +1,139 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Update Settings

+ +

This call allows you to update the index settings. +NEST whitelists which settings can be updated based on the allowed values mentioned here in the elasticsearch documentation this allows you to reuse an IndexSettings object.

+ +

Example

+ +

this example first creates an index and then uses the same IndexSettings to update the index.

+ +
var index = Guid.NewGuid().ToString();
+var client = this.ConnectedClient;
+var settings = new IndexSettings();
+settings.NumberOfReplicas = 1;
+settings.NumberOfShards = 5;
+settings.Add("refresh_interval", "1s");
+settings.Add("search.slowlog.threshold.fetch.warn", "1s");
+client.CreateIndex(index, settings);
+
+settings["refresh_interval"] = "-1";
+settings["search.slowlog.threshold.fetch.warn"] = "5s";
+
+var r = this.ConnectedClient.UpdateSettings(index, settings);
+
+Assert.True(r.Success);
+Assert.True(r.OK);
+var getResponse = this.ConnectedClient.GetIndexSettings(index);
+Assert.AreEqual(getResponse.Settings["refresh_interval"], "-1");
+Assert.AreEqual(getResponse.Settings["search.slowlog.threshold.fetch.warn"], "1s");
+
+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/prettify/lang-apollo.js b/prettify/lang-apollo.js new file mode 100644 index 00000000000..40420308094 --- /dev/null +++ b/prettify/lang-apollo.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_COMMENT,/^#[^\r\n]*/,null,'#'],[PR.PR_PLAIN,/^[\t\n\r \xA0]+/,null,' \n\r \xa0'],[PR.PR_STRING,/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'\"']],[[PR.PR_KEYWORD,/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,null],[PR.PR_TYPE,/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],[PR.PR_LITERAL,/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],[PR.PR_PLAIN,/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],[PR.PR_PUNCTUATION,/^[^\w\t\n\r \xA0()\"\\\';]+/]]),['apollo','agc','aea']) \ No newline at end of file diff --git a/prettify/lang-css.js b/prettify/lang-css.js new file mode 100644 index 00000000000..c650d8f0fdb --- /dev/null +++ b/prettify/lang-css.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null,' \r\n ']],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],['lang-css-str',/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],['lang-css-kw',/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),['css']),PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),['css-kw']),PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),['css-str']) \ No newline at end of file diff --git a/prettify/lang-hs.js b/prettify/lang-hs.js new file mode 100644 index 00000000000..27b221acd7c --- /dev/null +++ b/prettify/lang-hs.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[\t\n\x0B\x0C\r ]+/,null,' \n \r '],[PR.PR_STRING,/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'\"'],[PR.PR_STRING,/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,'\''],[PR.PR_LITERAL,/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,'0123456789']],[[PR.PR_COMMENT,/^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],[PR.PR_KEYWORD,/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/,null],[PR.PR_PLAIN,/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],[PR.PR_PUNCTUATION,/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),['hs']) \ No newline at end of file diff --git a/prettify/lang-lisp.js b/prettify/lang-lisp.js new file mode 100644 index 00000000000..85c6c23d0d3 --- /dev/null +++ b/prettify/lang-lisp.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([['opn',/^\(/,null,'('],['clo',/^\)/,null,')'],[PR.PR_COMMENT,/^;[^\r\n]*/,null,';'],[PR.PR_PLAIN,/^[\t\n\r \xA0]+/,null,' \n\r \xa0'],[PR.PR_STRING,/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'\"']],[[PR.PR_KEYWORD,/^(?:block|c[ad]+r|catch|cons|defun|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,null],[PR.PR_LITERAL,/^[+\-]?(?:0x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],[PR.PR_LITERAL,/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],[PR.PR_PLAIN,/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],[PR.PR_PUNCTUATION,/^[^\w\t\n\r \xA0()\"\\\';]+/]]),['cl','el','lisp','scm']) \ No newline at end of file diff --git a/prettify/lang-lua.js b/prettify/lang-lua.js new file mode 100644 index 00000000000..d107bab01eb --- /dev/null +++ b/prettify/lang-lua.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[\t\n\r \xA0]+/,null,' \n\r \xa0'],[PR.PR_STRING,/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,'\"\'']],[[PR.PR_COMMENT,/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],[PR.PR_STRING,/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],[PR.PR_KEYWORD,/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],[PR.PR_LITERAL,/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],[PR.PR_PLAIN,/^[a-z_]\w*/i],[PR.PR_PUNCTUATION,/^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]]),['lua']) \ No newline at end of file diff --git a/prettify/lang-ml.js b/prettify/lang-ml.js new file mode 100644 index 00000000000..698d6de4e98 --- /dev/null +++ b/prettify/lang-ml.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[\t\n\r \xA0]+/,null,' \n\r \xa0'],[PR.PR_COMMENT,/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,'#'],[PR.PR_STRING,/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,'\"\'']],[[PR.PR_COMMENT,/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],[PR.PR_KEYWORD,/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],[PR.PR_LITERAL,/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],[PR.PR_PLAIN,/^(?:[a-z_]\w*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],[PR.PR_PUNCTUATION,/^[^\t\n\r \xA0\"\'\w]+/]]),['fs','ml']) \ No newline at end of file diff --git a/prettify/lang-proto.js b/prettify/lang-proto.js new file mode 100644 index 00000000000..e67967f3e64 --- /dev/null +++ b/prettify/lang-proto.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.sourceDecorator({keywords:'bool bytes default double enum extend extensions false fixed32 fixed64 float group import int32 int64 max message option optional package repeated required returns rpc service sfixed32 sfixed64 sint32 sint64 string syntax to true uint32 uint64',cStyleComments:true}),['proto']) \ No newline at end of file diff --git a/prettify/lang-sql.js b/prettify/lang-sql.js new file mode 100644 index 00000000000..ff381cd4a54 --- /dev/null +++ b/prettify/lang-sql.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[\t\n\r \xA0]+/,null,' \n\r \xa0'],[PR.PR_STRING,/^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/,null,'\"\'']],[[PR.PR_COMMENT,/^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],[PR.PR_KEYWORD,/^(?:ADD|ALL|ALTER|AND|ANY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|NATIONAL|NOCHECK|NONCLUSTERED|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PERCENT|PLAN|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNION|UNIQUE|UPDATE|UPDATETEXT|USE|USER|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WRITETEXT)(?=[^\w-]|$)/i,null],[PR.PR_LITERAL,/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],[PR.PR_PLAIN,/^[a-z_][\w-]*/i],[PR.PR_PUNCTUATION,/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]]),['sql']) \ No newline at end of file diff --git a/prettify/lang-vb.js b/prettify/lang-vb.js new file mode 100644 index 00000000000..cabce853999 --- /dev/null +++ b/prettify/lang-vb.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[\t\n\r \xA0\u2028\u2029]+/,null,' \n\r \xa0\u2028\u2029'],[PR.PR_STRING,/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'\"\u201c\u201d'],[PR.PR_COMMENT,/^[\'\u2018\u2019][^\r\n\u2028\u2029]*/,null,'\'\u2018\u2019']],[[PR.PR_KEYWORD,/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i,null],[PR.PR_COMMENT,/^REM[^\r\n\u2028\u2029]*/i],[PR.PR_LITERAL,/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],[PR.PR_PLAIN,/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*\])/i],[PR.PR_PUNCTUATION,/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],[PR.PR_PUNCTUATION,/^(?:\[|\])/]]),['vb','vbs']) \ No newline at end of file diff --git a/prettify/lang-wiki.js b/prettify/lang-wiki.js new file mode 100644 index 00000000000..00a1b6b4bf2 --- /dev/null +++ b/prettify/lang-wiki.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[\t \xA0a-gi-z0-9]+/,null,' \xa0abcdefgijklmnopqrstuvwxyz0123456789'],[PR.PR_PUNCTUATION,/^[=*~\^\[\]]+/,null,'=*~^[]']],[['lang-wiki.meta',/(?:^^|\r\n?|\n)(#[a-z]+)\b/],[PR.PR_LITERAL,/^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/],['lang-',/^\{\{\{([\s\S]+?)\}\}\}/],['lang-',/^`([^\r\n`]+)`/],[PR.PR_STRING,/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],[PR.PR_PLAIN,/^(?:\r\n|[\s\S])[^#=*~^A-Zh\{`\[\r\n]*/]]),['wiki']),PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_KEYWORD,/^#[a-z]+/i,null,'#']],[]),['wiki.meta']) \ No newline at end of file diff --git a/prettify/prettify.css b/prettify/prettify.css new file mode 100644 index 00000000000..2eab84c7ff7 --- /dev/null +++ b/prettify/prettify.css @@ -0,0 +1 @@ +.str,.atv{color:#080}.kwd,.tag{color:#008}.com{color:#800}.typ,.atn,.dec{color:#606}.lit{color:#066}.pun{color:#660}.pln{color:#000}pre.prettyprint{padding:16px;font:"13px/18px monospace";}@media print{.str{color:#060}.kwd,.tag{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{font-weight:bold}.lit{color:#044}.pun{color:#440}.atn,.typ{color:#404}.atv{color:#060}} \ No newline at end of file diff --git a/prettify/prettify.js b/prettify/prettify.js new file mode 100644 index 00000000000..29b5e738e45 --- /dev/null +++ b/prettify/prettify.js @@ -0,0 +1,46 @@ +window.PR_SHOULD_USE_CONTINUATION=true,window.PR_TAB_WIDTH=8,window.PR_normalizedHtml=window.PR=window.prettyPrintOne=window.prettyPrint=void +0,window._pr_isIE6=function(){var a=navigator&&navigator.userAgent&&navigator.userAgent.match(/\bMSIE ([678])\./);return a=a?+a[1]:false,window._pr_isIE6=function(){return a},a},(function(){var +a=true,b=null,c='break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof ',d=c+'alignof align_union asm axiom bool '+'concept concept_map const_cast constexpr decltype '+'dynamic_cast explicit export friend inline late_check '+'mutable namespace nullptr reinterpret_cast static_assert static_cast '+'template typeid typename using virtual wchar_t where ',e=c+'abstract boolean byte extends final finally implements import '+'instanceof null native package strictfp super synchronized throws '+'transient ',f=e+'as base by checked decimal delegate descending event '+'fixed foreach from group implicit in interface internal into is lock '+'object out override orderby params partial readonly ref sbyte sealed '+'stackalloc string select uint ulong unchecked unsafe ushort var ',g=c+'debugger eval export function get null set undefined var with '+'Infinity NaN ',h='caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ',i='break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ',j='break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ',k='break continue do else for if return while case done elif esac eval fi function in local set then until ',l=d+f+g+h+i+j+k,m=(function(){var +a=['!','!=','!==','#','%','%=','&','&&','&&=','&=','(','*','*=','+=',',','-=','->','/','/=',':','::',';','<','<<','<<=','<=','=','==','===','>','>=','>>','>>=','>>>','>>>=','?','@','[','^','^=','^^','^^=','{','|','|=','||','||=','~','break','case','continue','delete','do','else','finally','instanceof','return','throw','try','typeof'],b='(?:^^|[+-]',c;for(c=0;c:&a-z])/g,'\\$1');return b+=')\\s*',b})(),n=/&/g,o=//g,q=/\"/g,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F;function +G(a){return a.replace(n,'&').replace(o,'<').replace(p,'>').replace(q,'"')}function +H(a){return a.replace(n,'&').replace(o,'<').replace(p,'>')}C=/</g,B=/>/g,w=/'/g,E=/"/g,v=/&/g,D=/ /g;function +I(a){var b=a.indexOf('&'),c,d,e,f;if(b<0)return a;for(--b;(b=a.indexOf('&#',b+1))>=0;)d=a.indexOf(';',b),d>=0&&(e=a.substring(b+3,d),f=10,e&&e.charAt(0)==='x'&&(e=e.substring(1),f=16),c=parseInt(e,f),isNaN(c)||(a=a.substring(0,b)+String.fromCharCode(c)+a.substring(d+1)));return a.replace(C,'<').replace(B,'>').replace(w,'\'').replace(E,'\"').replace(D,' ').replace(v,'&')}function +J(a){return'XMP'===a.tagName}u=/[\r\n]/g;function K(c,d){var e;return'PRE'===c.tagName?a:u.test(d)?(e='',c.currentStyle?(e=c.currentStyle.whiteSpace):window.getComputedStyle&&(e=window.getComputedStyle(c,b).whiteSpace),!e||e==='pre'):a}function +L(a,b){var c,d,e,f;switch(a.nodeType){case 1:f=a.tagName.toLowerCase(),b.push('<',f);for(e=0;e');for(d=a.firstChild;d;d=d.nextSibling)L(d,b);(a.firstChild||!/^(?:br|link|img)$/.test(f))&&b.push('');break;case +2:b.push(a.name.toLowerCase(),'=\"',G(a.value),'\"');break;case 3:case 4:b.push(H(a.nodeValue))}}function +M(b){var c=0,d=false,e=false,f,g,h,i;for(f=0,g=b.length;f122||(g<65||q>90||d.push([Math.max(65,q)|32,Math.min(g,90)|32]),g<97||q>122||d.push([Math.max(97,q)&-33,Math.min(g,122)&-33]))}d.sort(function(a,b){return a[0]-b[0]||b[1]-a[1]}),f=[],i=[NaN,NaN];for(h=0;hp[0]&&(p[1]+1>p[0]&&n.push('-'),n.push(k(p[1])));return n.push(']'),n.join('')}function +m(a){var b=a.source.match(new RegExp('(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)','g')),e=b.length,f=[],g,h,i,j,k;for(j=0,i=0;j=2&&g==='['?(b[j]=l(k)):g!=='\\'&&(b[j]=k.replace(/[a-zA-Z]/g,function(a){var +b=a.charCodeAt(0);return'['+String.fromCharCode(b&-33,b|32)+']'}));return b.join('')}i=[];for(f=0,g=b.length;f\n')),r=!/)[\r\n]+/g,'$1').replace(/(?:[\r\n]+[ \t]*)+/g,' ')),d;e=[];for(c=a.firstChild;c;c=c.nextSibling)L(c,e);return e.join('')}function +O(a){var c=0;return function(d){var e=b,f=0,g,h,i,j;for(h=0,i=d.length;h=0;j-=' '.length)e.push(' '.substring(0,j));f=h+1;break;case'\n':c=0;break;default:++c}}return e?(e.push(d.substring(f)),e.join('')):d}}z=new +RegExp('[^<]+|||\"\']|\'[^\']*\'|\"[^\"]*\")*>|<','g'),A=/^<\!--/,y=/^1&&j.charAt(0)==='<'){if(A.test(j))continue;if(y.test(j))c.push(j.substring(9,j.length-3)),d+=j.length-12;else +if(x.test(j))c.push('\n'),++d;else if(j.indexOf('nocode')>=0&&Q(j)){l=(j.match(F))[2],f=1;for(h=g+1;h=0;)d[o.charAt(i)]=m;n=m[1],k=''+n,g.hasOwnProperty(k)||(f.push(n),g[k]=b)}f.push(/[\0-\uffff]/),h=M(f)})(),f=c.length,g=/\S/,e=function(a){var +b=a.source,g=a.basePos,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;i=[g,'pln'],s=0,y=b.match(h)||[],u={};for(v=0,q=y.length;v=5&&'lang-'===t.substring(0,5),n&&!(p&&typeof +p[1]==='string')&&(n=false,t='src'),n||(u[w]=t)}x=s,s+=w.length,n?(j=p[1],l=w.indexOf(j),k=l+j.length,p[2]&&(k=w.length-p[2].length,l=k-j.length),o=t.substring(5),R(g+x,w.substring(0,l),e,i),R(g+x+l,j,W(o,j),i),R(g+x+k,w.substring(k),e,i)):i.push(g+x,t)}a.decorations=i},e}function +T(a){var c=[],d=[],e,f;return a.tripleQuotedStrings?c.push(['str',/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,b,'\'\"']):a.multiLineStrings?c.push(['str',/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,b,'\'\"`']):c.push(['str',/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,b,'\"\'']),a.verbatimStrings&&d.push(['str',/^@\"(?:[^\"]|\"\")*(?:\"|$)/,b]),a.hashComments&&(a.cStyleComments?(c.push(['com',/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,b,'#']),d.push(['str',/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,b])):c.push(['com',/^#[^\r\n]*/,b,'#'])),a.cStyleComments&&(d.push(['com',/^\/\/[^\r\n]*/,b]),d.push(['com',/^\/\*[\s\S]*?(?:\*\/|$)/,b])),a.regexLiterals&&(e='/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/',d.push(['lang-regex',new +RegExp('^'+m+'('+e+')')])),f=a.keywords.replace(/^\s+|\s+$/g,''),f.length&&d.push(['kwd',new +RegExp('^(?:'+f.replace(/\s+/g,'|')+')\\b'),b]),c.push(['pln',/^\s+/,b,' \r\n \xa0']),d.push(['lit',/^@[a-z_$][a-z_$@0-9]*/i,b],['typ',/^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/,b],['pln',/^[a-z_$][a-z_$@0-9]*/i,b],['lit',new +RegExp('^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*','i'),b,'0123456789'],['pun',/^.[^\s\w\.$@\'\"\`\/\#]*/,b]),S(c,d)}s=T({keywords:l,hashComments:a,cStyleComments:a,multiLineStrings:a,regexLiterals:a});function +U(c){var d=c.source,e=c.extractedTags,f=c.decorations,g=[],h=0,i=b,j=b,k=0,l=0,m=O(window.PR_TAB_WIDTH),n=/([\r\n ]) /g,o=/(^| ) /gm,p=/\r\n?|\n/g,q=/[ \r\n]$/,r=a,s;function +t(a){var c,e;a>h&&(i&&i!==j&&(g.push(''),i=b),!i&&j&&(i=j,g.push('')),c=H(m(d.substring(h,a))).replace(r?o:n,'$1 '),r=q.test(c),e=window._pr_isIE6()?' 
':'
',g.push(c.replace(p,e)),h=a)}while(a){k'),i=b),g.push(e[k+1]),k+=2;else +if(l'),c.prettyPrintedHtml=g.join('')}t={};function +V(a,b){var c,d;for(d=b.length;--d>=0;)c=b[d],t.hasOwnProperty(c)?'console'in window&&console.warn('cannot override language handler %s',c):(t[c]=a)}function +W(a,b){return a&&t.hasOwnProperty(a)||(a=/^\s*]*(?:>|$)/],['com',/^<\!--[\s\S]*?(?:-\->|$)/],['lang-',/^<\?([\s\S]+?)(?:\?>|$)/],['lang-',/^<%([\s\S]+?)(?:%>|$)/],['pun',/^(?:<[%?]|[%?]>)/],['lang-',/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],['lang-js',/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],['lang-css',/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],['lang-in.tag',/^(<\/?[a-z][^<>]*>)/i]]),['default-markup','htm','html','mxml','xhtml','xml','xsl']),V(S([['pln',/^[\s]+/,b,' \r\n'],['atv',/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,b,'\"\'']],[['tag',/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],['atn',/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],['lang-uq.val',/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],['pun',/^[=<>\/]+/],['lang-js',/^on\w+\s*=\s*\"([^\"]+)\"/i],['lang-js',/^on\w+\s*=\s*\'([^\']+)\'/i],['lang-js',/^on\w+\s*=\s*([^\"\'>\s]+)/i],['lang-css',/^style\s*=\s*\"([^\"]+)\"/i],['lang-css',/^style\s*=\s*\'([^\']+)\'/i],['lang-css',/^style\s*=\s*([^\"\'>\s]+)/i]]),['in.tag']),V(S([],[['atv',/^[\s\S]+/]]),['uq.val']),V(T({keywords:d,hashComments:a,cStyleComments:a}),['c','cc','cpp','cxx','cyc','m']),V(T({keywords:'null true false'}),['json']),V(T({keywords:f,hashComments:a,cStyleComments:a,verbatimStrings:a}),['cs']),V(T({keywords:e,cStyleComments:a}),['java']),V(T({keywords:k,hashComments:a,multiLineStrings:a}),['bsh','csh','sh']),V(T({keywords:i,hashComments:a,multiLineStrings:a,tripleQuotedStrings:a}),['cv','py']),V(T({keywords:h,hashComments:a,multiLineStrings:a,regexLiterals:a}),['perl','pl','pm']),V(T({keywords:j,hashComments:a,multiLineStrings:a,regexLiterals:a}),['rb']),V(T({keywords:g,cStyleComments:a,regexLiterals:a}),['js']),V(S([],[['str',/^[\s\S]+/]]),['regex']);function +X(a){var b=a.sourceCodeHtml,c=a.langExtension,d,e;a.prettyPrintedHtml=b;try{e=P(b),d=e.source,a.source=d,a.basePos=0,a.extractedTags=e.tags,W(c,d)(a),U(a)}catch(f){'console'in +window&&(console.log(f),console.trace())}}function Y(a,b){var c={sourceCodeHtml:a,langExtension:b};return X(c),c.prettyPrintedHtml}function +Z(c){var d=window._pr_isIE6(),e=d===6?'\r\n':'\r',f=[document.getElementsByTagName('pre'),document.getElementsByTagName('code'),document.getElementsByTagName('xmp')],g=[],h,i,j,k,l,m;for(i=0;i=0){f=e.className.match(/\blang-(\w+)\b/),f&&(f=f[1]),i=false;for(j=e.parentNode;j;j=j.parentNode)if((j.tagName==='pre'||j.tagName==='code'||j.tagName==='xmp')&&j.className&&j.className.indexOf('prettyprint')>=0){i=a;break}i||(d=N(e),d=d.replace(/(?:\r\n?|\n)$/,''),m={sourceCodeHtml:d,langExtension:f,sourceNode:e},X(m),o())}}k=0;)i=j[h],i.parentNode.replaceChild(document.createTextNode(e),i)}}n()}window.PR_normalizedHtml=L,window.prettyPrintOne=Y,window.prettyPrint=Z,window.PR={combinePrefixPatterns:M,createSimpleLexer:S,registerLangHandler:V,sourceDecorator:T,PR_ATTRIB_NAME:'atn',PR_ATTRIB_VALUE:'atv',PR_COMMENT:'com',PR_DECLARATION:'dec',PR_KEYWORD:'kwd',PR_LITERAL:'lit',PR_NOCODE:'nocode',PR_PLAIN:'pln',PR_PUNCTUATION:'pun',PR_SOURCE:'src',PR_STRING:'str',PR_TAG:'tag',PR_TYPE:'typ'}})() \ No newline at end of file diff --git a/prettify/sunburst.css b/prettify/sunburst.css new file mode 100644 index 00000000000..d3d6b439a29 --- /dev/null +++ b/prettify/sunburst.css @@ -0,0 +1,51 @@ +/* Pretty printing styles. Used with prettify.js. */ +/* Vim sunburst theme by David Leibovic */ + +pre .str, code .str { color: #65B042; } /* string - green */ +pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */ +pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */ +pre .typ, code .typ { color: #89bdff; } /* type - light blue */ +pre .lit, code .lit { color: #3387CC; } /* literal - blue */ +pre .pun, code .pun { color: #fff; } /* punctuation - white */ +pre .pln, code .pln { color: #fff; } /* plaintext - white */ +pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */ +pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */ +pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */ +pre .dec, code .dec { color: #3387CC; } /* decimal - blue */ + +pre.prettyprint, code.prettyprint { + background-color: #000; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -o-border-radius: 8px; + -ms-border-radius: 8px; + -khtml-border-radius: 8px; + border-radius: 8px; +} + +pre.prettyprint { + width: 95%; + margin: 1em auto; + padding: 1em; + white-space: pre-wrap; +} + + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */ +li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1,li.L3,li.L5,li.L7,li.L9 { } + +@media print { + pre .str, code .str { color: #060; } + pre .kwd, code .kwd { color: #006; font-weight: bold; } + pre .com, code .com { color: #600; font-style: italic; } + pre .typ, code .typ { color: #404; font-weight: bold; } + pre .lit, code .lit { color: #044; } + pre .pun, code .pun { color: #440; } + pre .pln, code .pln { color: #000; } + pre .tag, code .tag { color: #006; font-weight: bold; } + pre .atn, code .atn { color: #404; } + pre .atv, code .atv { color: #060; } +} \ No newline at end of file diff --git a/query/bool.html b/query/bool.html new file mode 100644 index 00000000000..8e15e64afc7 --- /dev/null +++ b/query/bool.html @@ -0,0 +1,146 @@ + + + + + + NEST - Bool Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Bool Query

+ +

A query that matches documents matching boolean combinations of other queries. The bool query maps to Lucene BooleanQuery. It is built using one or more boolean clauses, each clause with a typed occurrence.

+ +
.Query(qd=>qd
+    .Bool(b=>b
+        .Must(q => q.MatchAll())
+        .MustNot(q => q.Term(p => p.Name, "elasticsearch.pm"))
+        .Should(q => q.Term(p => p.Name, "elasticflume"))
+    )
+)
+
+ +

note each clause can take multiple queries e.g:

+ +
.Should(
+    q => q.Term(p => p.Name, "elasticflume"),
+    q => q.Term(p => p.Name, "Nest")
+
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/boosting.html b/query/boosting.html new file mode 100644 index 00000000000..b37ef67f82b --- /dev/null +++ b/query/boosting.html @@ -0,0 +1,137 @@ + + + + + + NEST - Boosting Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Boosting Query

+ +

The boosting query can be used to effectively demote results that match a given query. Unlike the “NOT” clause in bool query, this still selects documents that contain undesirable terms, but reduces their overall score.

+ +
.Query(qd=>qd
+    .Boosting(b=>b
+        .Positive(q => q.MatchAll())
+        .Negative(q => q.Term(p => p.Name, "elasticsearch.pm"))
+        .NegativeBoost(0.4)
+    )
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/constant-score.html b/query/constant-score.html new file mode 100644 index 00000000000..4e4265e159a --- /dev/null +++ b/query/constant-score.html @@ -0,0 +1,136 @@ + + + + + + NEST - Constant Score Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Constant Score Query

+ +

A query that wraps a filter or another query and simply returns a constant score equal to the query boost for every document in the filter. Maps to Lucene ConstantScoreQuery

+ +
.Query(qd=>qd
+    .ConstantScore(cs=>cs
+        .Query(qq=>qq.MatchAll())
+        .Boost(1.2)
+    )
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/custom-boost-factor.html b/query/custom-boost-factor.html new file mode 100644 index 00000000000..fe283fa3482 --- /dev/null +++ b/query/custom-boost-factor.html @@ -0,0 +1,136 @@ + + + + + + NEST - Custom Boost Factor Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Custom Boost Factor Query

+ +

customboostfactor query allows to wrap another query and multiply its score by the provided boost_factor. This can sometimes be desired since boost value set on specific queries gets normalized, while this query boost factor does not

+ +
.Query(qd=>qd
+    .CustomBoostFactor(cs=>cs
+        .BoostFactor(5.2)
+        .Query(qq=>qq.MatchAll())
+    )
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/custom-filters-score.html b/query/custom-filters-score.html new file mode 100644 index 00000000000..eb936318461 --- /dev/null +++ b/query/custom-filters-score.html @@ -0,0 +1,130 @@ + + + + + + NEST - Custom Filters Score Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Custom Filters Score Query

+ +

A customfiltersscore query allows to execute a query, and if the hit matches a provided filter (ordered), use either a boost or a script associated with it to compute the score.

+ +

This is currently only mapped in the Factory Query DSL see CustomFiltersScoreQueryBuilder

+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/custom-score-factor.html b/query/custom-score-factor.html new file mode 100644 index 00000000000..39ba30d1ef6 --- /dev/null +++ b/query/custom-score-factor.html @@ -0,0 +1,117 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ +
+
+
+
+ Fork me on GitHub + + + + diff --git a/query/custom-score.html b/query/custom-score.html new file mode 100644 index 00000000000..bebdc3d7efb --- /dev/null +++ b/query/custom-score.html @@ -0,0 +1,137 @@ + + + + + + NEST - Custom Score + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Custom Score

+ +

custom_score query allows to wrap another query and customize the scoring of it optionally with a computation derived from other field values in the doc (numeric ones) using script expression. Here is a simple sample:

+ +
.Query(qd=>qd
+    .CustomScore(cs => cs
+        .Script("doc['num1'].value > myvar")
+        .Params(p=>p.Add("myvar", 1.0))
+        .Query(qq => qq.MatchAll())
+    )
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/dis-max.html b/query/dis-max.html new file mode 100644 index 00000000000..f65c122c33c --- /dev/null +++ b/query/dis-max.html @@ -0,0 +1,146 @@ + + + + + + NEST - Dis Max Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Dis Max Query

+ +

A query that generates the union of documents produced by its subqueries, and that scores each document with the maximum score for that document as produced by any subquery, plus a tie breaking increment for any additional matching subqueries.

+ +

This is useful when searching for a word in multiple fields with different boost factors (so that the fields cannot be combined equivalently into a single search field). We want the primary score to be the one associated with the highest boost, not the sum of the field scores (as Boolean Query would give). If the query is “albino elephant” this ensures that “albino” matching one field and “elephant” matching another gets a higher score than “albino” matching both fields. To get this result, use both Boolean Query and DisjunctionMax Query: for each term a DisjunctionMaxQuery searches for it in each field, while the set of these DisjunctionMaxQuery’s is combined into a BooleanQuery.

+ +

The tie breaker capability allows results that include the same term in multiple fields to be judged better than results that include this term in only the best of those multiple fields, without confusing this with the better case of two different terms in the multiple fields.The default tie_breaker is 0.0.

+ +

This query maps to Lucene DisjunctionMaxQuery.

+ +
.Query(qd=>qd
+    .Dismax(d=>d
+        .Boost(1.2)
+        .TieBreaker(0.7)
+        .Queries(
+            q => q.MatchAll(),
+            q => q.Term(f=>f.Name, "elasticsearch.pm")
+        )
+    )
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/field.html b/query/field.html new file mode 100644 index 00000000000..126b9673456 --- /dev/null +++ b/query/field.html @@ -0,0 +1,128 @@ + + + + + + NEST - Field Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/query/filtered.html b/query/filtered.html new file mode 100644 index 00000000000..6973a337a2d --- /dev/null +++ b/query/filtered.html @@ -0,0 +1,136 @@ + + + + + + NEST - Filtered Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Filtered Query

+ +

A query that applies a filter to the results of another query. This query maps to Lucene FilteredQuery.

+ +
.Query(qd=>qd
+    .Filtered(cs=>cs
+        .Query(q=>q.MatchAll())
+        .Filter(f => f.MatchAll())
+    )
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/flt-field.html b/query/flt-field.html new file mode 100644 index 00000000000..b22eca40f68 --- /dev/null +++ b/query/flt-field.html @@ -0,0 +1,128 @@ + + + + + + NEST - Fuzzy Like This Field Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/query/flt.html b/query/flt.html new file mode 100644 index 00000000000..3c7af2a58c1 --- /dev/null +++ b/query/flt.html @@ -0,0 +1,141 @@ + + + + + + NEST - Fuzzy Like This Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Fuzzy Like This Query

+ +

Fuzzy like this query find documents that are “like” provided text by running it against one or more fields.

+ +
.Query(qd=>qd
+    .FuzzyLikeThis(fz => fz
+        .OnFields(f => f.Name)
+        .LikeText("elasticsearcc")
+        .PrefixLength(3)
+        .MaxQueryTerms(25)
+        .IgnoreTermFrequency(true)
+        .Boost(1.1)
+        .Analyzer("my_analyzer")
+    )
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/fuzzy.html b/query/fuzzy.html new file mode 100644 index 00000000000..c315ba92411 --- /dev/null +++ b/query/fuzzy.html @@ -0,0 +1,158 @@ + + + + + + NEST - Fuzzy Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Fuzzy Query

+ +

A fuzzy based query that uses similarity based on Levenshtein (edit distance) algorithm.

+ +

Warning: this query is not very scalable with its default prefix length of 0 – in this case, every term will be enumerated and cause an edit score calculation or max_expansions is not set.

+ +
.Query(qd=>qd
+    .Fuzzy(fz => fz
+        .OnField(f=>f.Name)
+        .Value("elasticsearcc")
+    )
+)
+
+ +

Numeric / Date Fuzzy

+ +

fuzzy query on a numeric field will result in a range query “around” the value using the min_similarity value. For example:

+ +
.FuzzyNumeric(fz => fz
+    .OnField(f=>f.LOC)
+    .Value(200)
+    .MinSimilarity(12)
+)
+
+ +

Same applies to dates, with support for time format for the min_similarity field:

+ +
.FuzzyDate(fz => fz
+    .OnField(f=>f.StartedOn)
+    .Value(new DateTime(1999,12,31))
+    .MinSimilarity("1d")
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/has-child.html b/query/has-child.html new file mode 100644 index 00000000000..af1b972f445 --- /dev/null +++ b/query/has-child.html @@ -0,0 +1,134 @@ + + + + + + NEST - Has Child Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Has Child Query

+ +

The has_child filter accepts a query and the child type to run against, and results in parent documents that have child docs matching the query. Here is an example:

+ +
.HasChild<Person>(fz => fz
+    .Query(qq=>qq.Term(f=>f.FirstName, "john"))
+    .Scope("my_scope")
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/ids.html b/query/ids.html new file mode 100644 index 00000000000..f1eed844f1c --- /dev/null +++ b/query/ids.html @@ -0,0 +1,131 @@ + + + + + + NEST - Ids Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Ids Query

+ +

Filters documents that only have the provided ids. Note, this filter does not require the _id field to be indexed since it works using the _uid field.

+ +
.Query(q=>q.Ids(new[] { "1", "4", "100" })
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/indices.html b/query/indices.html new file mode 100644 index 00000000000..c1f7d5ae4f5 --- /dev/null +++ b/query/indices.html @@ -0,0 +1,137 @@ + + + + + + NEST - Indices Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Indices Query

+ +

The indices query can be used when executed across multiple indices, allowing to have a query that executes only when executed on an index that matches a specific list of indices, and another query that executes when it is executed on an index that does not match the listed indices.

+ +
.Query(q => q
+    .Indices(fz => fz
+        .Indices(new[] { "elasticsearchprojects", "people", 
+        .Query<Person>(qq => qq.Term(f => f.FirstName, "joe"))
+        .NoMatchQuery(qq => qq.MatchAll())
+    )
+);
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/match-all.html b/query/match-all.html new file mode 100644 index 00000000000..7bca03d1b5b --- /dev/null +++ b/query/match-all.html @@ -0,0 +1,140 @@ + + + + + + NEST - Match All Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Match All Query

+ +

A query that matches all documents. Maps to Lucene MatchAllDocsQuery.

+ +
.From(0)
+.Size(10)
+.Query(q => q.MatchAll());
+
+ +

A special shortcut exists for matchall queries

+ +
.From(0)
+.Size(10)
+.MatchAll()
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/mlt-field.html b/query/mlt-field.html new file mode 100644 index 00000000000..27a1fb6f9f0 --- /dev/null +++ b/query/mlt-field.html @@ -0,0 +1,128 @@ + + + + + + NEST - More Like This Field Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ Fork me on GitHub + + + + diff --git a/query/mlt.html b/query/mlt.html new file mode 100644 index 00000000000..af038fb8939 --- /dev/null +++ b/query/mlt.html @@ -0,0 +1,136 @@ + + + + + + NEST - More Like This Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

More Like This Query

+ +

More like this query find documents that are “like” provided text by running it against one or more fields.

+ +
.Query(q => q
+    .MoreLikeThis(fz => fz
+        .OnFields(f => f.Name)
+        .LikeText("elasticsearcc")
+    )
+);
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/nested.html b/query/nested.html new file mode 100644 index 00000000000..d278be231f1 --- /dev/null +++ b/query/nested.html @@ -0,0 +1,134 @@ + + + + + + NEST - Nested Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Nested Query

+ +

Nested query allows to query nested objects / docs (see nested mapping. The query is executed against the nested objects / docs as if they were indexed as separate docs (they are, internally) and resulting in the root parent doc (or parent nested mapping).

+ +
.Nested(n=>n
+    .Path(f=>f.Followers[0])
+    .Query(q=>q.Term(f=>f.Followers[0].FirstName,"elasticsearch.pm"))
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/prefix.html b/query/prefix.html new file mode 100644 index 00000000000..41253ab9113 --- /dev/null +++ b/query/prefix.html @@ -0,0 +1,133 @@ + + + + + + NEST - Prefix Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Prefix Query

+ +

Matches documents that have fields containing terms with a specified prefix (not analyzed). The prefix query maps to Lucene PrefixQuery.

+ +
.Query(q => q
+    .Prefix(f => f.Name, "el", Boost: 1.2)
+);
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/query-string.html b/query/query-string.html new file mode 100644 index 00000000000..413f66266b4 --- /dev/null +++ b/query/query-string.html @@ -0,0 +1,166 @@ + + + + + + NEST - Query String Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Query String Query

+ +

A query that uses a query parser in order to parse its content

+ +

Bare example:

+ +
.QueryString(qs=>qs.Query("this AND that OR thus"))
+
+ +

Simple with field boosts:

+ +
.QueryString(qs=>qs
+    .OnFieldsWithBoost(d=>d
+        .Add(f=>f.Name, 2.0)
+        .Add(f=>f.Country, 5.0)
+    )
+    .Query("this AND that OR thus")
+)
+
+ +

All options are mapped:

+ +
.QueryString(qs => qs
+    .OnField(f=>f.Name)
+    .Query("this that thus")
+    .Operator(Operator.and)
+    .Analyzer("my_analyzer")
+    .AllowLeadingWildcard(true)
+    .LowercaseExpendedTerms(true)
+    .EnablePositionIncrements(true)
+    .FuzzyPrefixLength(2)
+    .FuzzyMinimumSimilarity(0.5)
+    .PhraseSlop(1.0)
+    .Boost(1.0)
+    .AnalyzeWildcard(true)
+    .AutoGeneratePhraseQueries(true)
+    .MinimumShouldMatchPercentage(20)
+    .UseDisMax(true)
+    .TieBreaker(0.7)
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/range.html b/query/range.html new file mode 100644 index 00000000000..06b793ce955 --- /dev/null +++ b/query/range.html @@ -0,0 +1,140 @@ + + + + + + NEST - Range Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Range Query

+ +

Matches documents with fields that have terms within a certain range. The type of the Lucene query depends on the field type, for string fields, the TermRangeQuery, while for number/date fields, the query is a NumericRangeQuery.

+ +
.Query(ff => ff
+    .Range(n => n
+        .OnField(f=>f.LOC)
+        .From("10")
+        .To("20")
+        .FromExclusive()
+    )
+);
+
+ +

alternatively .From(10) and .From(10.0) work as expected.

+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/span-first.html b/query/span-first.html new file mode 100644 index 00000000000..c25816c71c2 --- /dev/null +++ b/query/span-first.html @@ -0,0 +1,134 @@ + + + + + + NEST - Span First Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Span First Query

+ +

Matches spans near the beginning of a field. The span first query maps to Lucene SpanFirstQuery.

+ +
.SpanFirst(sf=>sf
+    .MatchTerm(f => f.Name, "elasticsearch.pm", 1.1)
+    .End(3)
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/span-near.html b/query/span-near.html new file mode 100644 index 00000000000..c14e9f5bfe6 --- /dev/null +++ b/query/span-near.html @@ -0,0 +1,144 @@ + + + + + + NEST - Span Near Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Span Near Query

+ +

Matches spans which are near one another. One can specify slop, the maximum number of intervening unmatched positions, as well as whether matches are required to be in-order. The span near query maps to Lucene SpanNearQuery.

+ +
.SpanNear(sn => sn
+    .Clauses(
+        c => c.SpanTerm(f => f.Name, "elasticsearch.pm", 1.1),
+        c => c.SpanFirst(sf => sf
+            .MatchTerm(f => f.Name, "elasticsearch.pm", 1.1)
+            .End(3)
+        )
+    )
+    .Slop(3)
+    .CollectPayloads(false)
+    .InOrder(false)
+)
+
+ +

The clauses element is a list of one or more other span type queries and the slop controls the maximum number of intervening unmatched positions permitted.

+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/span-not.html b/query/span-not.html new file mode 100644 index 00000000000..2ea3f08fc03 --- /dev/null +++ b/query/span-not.html @@ -0,0 +1,136 @@ + + + + + + NEST - Span Not Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Span Not Query

+ +

Removes matches which overlap with another span query. The span not query maps to Lucene SpanNotQuery

+ +
.SpanNot(sf=>sf
+    .Include(e =>e.SpanTerm(f => f.Name, "elasticsearch.pm", 1.1))
+    .Exclude(e=>e.SpanTerm(f => f.Name, "elasticsearch.pm", 1.1))
+)
+
+ +

The include and exclude clauses can be any span type query. The include clause is the span query whose matches are filtered, and the exclude clause is the span query whose matches must not overlap those returned.

+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/span-or.html b/query/span-or.html new file mode 100644 index 00000000000..7bdc8dd2901 --- /dev/null +++ b/query/span-or.html @@ -0,0 +1,141 @@ + + + + + + NEST - Span Or Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Span Or Query

+ +

Matches the union of its span clauses. The span or query maps to Lucene SpanOrQuery.

+ +
.SpanOr(sn => sn
+    .Clauses(
+        c => c.SpanTerm(f => f.Name, "elasticsearch.pm", 1.1),
+        c => c.SpanFirst(sf => sf
+            .MatchTerm(f => f.Name, "elasticsearch.pm", 1.1)
+            .End(3)
+        )
+    )
+)
+
+ +

The clauses element is a list of one or more other span type queries.

+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/span-term.html b/query/span-term.html new file mode 100644 index 00000000000..25f86da871b --- /dev/null +++ b/query/span-term.html @@ -0,0 +1,133 @@ + + + + + + NEST - Span Term Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Span Term Query

+ +

Matches spans containing a term. The span term query maps to Lucene SpanTermQuery.

+ +
.Query(q => q
+    .SpanTerm(f=>f.Name, "elasticsearch.pm", 1.1)
+);
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/term.html b/query/term.html new file mode 100644 index 00000000000..c95559e4da2 --- /dev/null +++ b/query/term.html @@ -0,0 +1,131 @@ + + + + + + NEST - Term Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Term Query

+ +

Matches documents that have fields that contain a term (not analyzed). The term query maps to Lucene TermQuery

+ +
.Term(f => f.Name, "elasticsearch.pm")
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/terms.html b/query/terms.html new file mode 100644 index 00000000000..3cc8db5e252 --- /dev/null +++ b/query/terms.html @@ -0,0 +1,147 @@ + + + + + + NEST - Terms Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Terms Query

+ +

A query that match on any (configurable) of the provided terms. This is a simpler syntax query for using a bool query with several term queries in the should clauses.

+ +

Several overloads exists including

+ +
.Terms(f => f.Name, new[] { "elasticsearch.pm" })
+
+ +

or

+ +
.Terms(f => f.Name, "elasticsearch.pm", "nest")
+
+ +

or

+ +
.TermsDescriptor(tq => tq
+    .OnField(f=>f.Name)
+    .Terms("elasticsearch.pm", "nest")
+    .MinimumMatch(2)
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/text.html b/query/text.html new file mode 100644 index 00000000000..cba894b1ce4 --- /dev/null +++ b/query/text.html @@ -0,0 +1,162 @@ + + + + + + NEST - Text Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Text Query

+ +

A family of text queries that accept text, analyzes it, and constructs a query out of it.

+ +

Boolean

+ +
.Text(t => t
+    .OnField(f => f.Name)
+    .QueryString("this is a test")
+    .Fuzziness(1.0)
+    .Analyzer("my_analyzer")
+    .PrefixLength(2)
+)
+
+ +

Phrase

+ +
.TextPhrase(t => t
+    .OnField(f => f.Name)
+    .QueryString("this is a test")
+    .Fuzziness(1.0)
+    .Analyzer("my_analyzer")
+    .PrefixLength(2)
+)
+
+ +

Phrase Prefix

+ +
.TextPhrasePrefix(t => t
+    .OnField(f => f.Name)
+    .QueryString("this is a test")
+    .Fuzziness(1.0)
+    .Analyzer("my_analyzer")
+    .PrefixLength(2)
+    .Operator(Operator.and)
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/top-children.html b/query/top-children.html new file mode 100644 index 00000000000..208c7c561ac --- /dev/null +++ b/query/top-children.html @@ -0,0 +1,148 @@ + + + + + + NEST - Top Children Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Top Children Query

+ +

The top_children query runs the child query with an estimated hits size, and out of the hit docs, aggregates it into parent docs. If there aren’t enough parent docs matching the requested from/size search request, then it is run again with a wider (more hits) search.

+ +

The top_children also provide scoring capabilities, with the ability to specify max, sum or avg as the score type.

+ +

Simple example:

+ +
.TopChildren<Person>(fz => fz
+    .Query(qq=>qq.Term(f=>f.FirstName, "john"))
+    .Scope("my_scope")
+)
+
+ +

Custom scoring

+ +
.TopChildren<Person>(fz => fz
+    .Query(qq => qq.Term(f => f.FirstName, "john"))
+    .Score(TopChildrenScore.avg)
+    .Scope("my_scope")
+    .Type("sillypeople")
+)
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/query/wildcard.html b/query/wildcard.html new file mode 100644 index 00000000000..3739ffe86fd --- /dev/null +++ b/query/wildcard.html @@ -0,0 +1,135 @@ + + + + + + NEST - Wildcard Query + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Wildcard Query

+ +

Matches documents that have fields matching a wildcard expression (not analyzed). Supported wildcards are *, which matches any character sequence (including the empty one), and ?, which matches any single character. Note this query can be slow, as it needs to iterate over many terms. In order to prevent extremely slow wildcard queries, a wildcard term should not start with one of the wildcards * or ?. The wildcard query maps to Lucene WildcardQuery.

+ +
.From(0)
+.Size(10)
+.Query(q => q
+    .Wildcard(f => f.Name, "elasticsearch.*")
+);
+
+ + + Be sure to read the original documentation + on this subject. + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/basics.html b/search/basics.html new file mode 100644 index 00000000000..2dd484ed26d --- /dev/null +++ b/search/basics.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/explain.html b/search/explain.html new file mode 100644 index 00000000000..3ee80349cab --- /dev/null +++ b/search/explain.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/fields.html b/search/fields.html new file mode 100644 index 00000000000..4b220e294e2 --- /dev/null +++ b/search/fields.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/highlighting.html b/search/highlighting.html new file mode 100644 index 00000000000..79512f83e7d --- /dev/null +++ b/search/highlighting.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/index-boost.html b/search/index-boost.html new file mode 100644 index 00000000000..63b5321cef4 --- /dev/null +++ b/search/index-boost.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/named-filers.html b/search/named-filers.html new file mode 100644 index 00000000000..efcbb78e22f --- /dev/null +++ b/search/named-filers.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/named-filters.html b/search/named-filters.html new file mode 100644 index 00000000000..3d85aff6c72 --- /dev/null +++ b/search/named-filters.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/preference.html b/search/preference.html new file mode 100644 index 00000000000..968e16f6406 --- /dev/null +++ b/search/preference.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/script-fields.html b/search/script-fields.html new file mode 100644 index 00000000000..42c1d308305 --- /dev/null +++ b/search/script-fields.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/scroll.html b/search/scroll.html new file mode 100644 index 00000000000..9dcf19cc527 --- /dev/null +++ b/search/scroll.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/search-type.html b/search/search-type.html new file mode 100644 index 00000000000..d9bc608d161 --- /dev/null +++ b/search/search-type.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/sort.html b/search/sort.html new file mode 100644 index 00000000000..17278625fad --- /dev/null +++ b/search/sort.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/search/version.html b/search/version.html new file mode 100644 index 00000000000..2197a59533a --- /dev/null +++ b/search/version.html @@ -0,0 +1,105 @@ + + + + + + NEST - Connecting + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+

Documentation still in progress

+ +

This is sadly still a marker file.

+ + +

+ Spotted a mistake? Something to add? + + Fork and edit this file on github + + without leaving the browser + +

+
+
+
+ Fork me on GitHub + + + + diff --git a/src/Nest.Dsl.Factory/Factory/Sort/FieldSortBuilder.cs b/src/Nest.Dsl.Factory/Factory/Sort/FieldSortBuilder.cs index 5888ffb19bf..f5796070619 100644 --- a/src/Nest.Dsl.Factory/Factory/Sort/FieldSortBuilder.cs +++ b/src/Nest.Dsl.Factory/Factory/Sort/FieldSortBuilder.cs @@ -8,6 +8,7 @@ public class FieldSortBuilder : ISortBuilder private object _missing; private SortOrder _order; private bool? _ignoreUnampped; + private TermFilterBuilder _nestedFilter; public FieldSortBuilder(string fieldName) { @@ -26,6 +27,17 @@ public FieldSortBuilder IgnoreUnmapped(bool ignoreUnmapped) return this; } + /// + /// Sets sort nested filter + /// + /// nested filter + /// + public FieldSortBuilder NestedFilter(TermFilterBuilder nestedFilter) + { + _nestedFilter = nestedFilter; + return this; + } + #region ISortBuilder Members public ISortBuilder Order(SortOrder order) @@ -60,6 +72,11 @@ public object ToJsonObject() content[_fieldName]["ignore_unmapped"] = _ignoreUnampped; } + if (_nestedFilter != null) + { + content[_fieldName]["nested_filter"] = _nestedFilter.ToJsonObject() as JObject; + } + return content; } diff --git a/styles/layout.css b/styles/layout.css new file mode 100644 index 00000000000..bba5aeffd25 --- /dev/null +++ b/styles/layout.css @@ -0,0 +1,120 @@ +body { + background:url(../images/bg-body.png) top left repeat-x #7692BF; + font-family: 'Georgia', 'Helvetica Neue', 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-size: 16px; + font-style: normal; + font-weight: 400; + text-shadow: none; + text-transform: none; + letter-spacing: 0em; + word-spacing: 0em; + line-height: 1.4; + margin:0; + padding:0; +} +section#site +{ + margin:auto; + width:80%; + max-width:1200px; + min-height:500px; + background:url(../images/bg-header.png) top left no-repeat; +} +aside { + font-family: 'Georgia', serif; + float:right; + width:20%; + margin-top:180px; + border-left:4px solid black; +} +aside ul { + list-style:none; + padding:0; + margin:0px; + margin-left:12px; +} +aside ul h4 +{ + + color:black; + padding:0; + margin:0px; + font-weight:normal; +} +aside ul a { + color:#C8D3E6; + text-decoration:none; + display:block; + padding:2px; + width:100%; + border-radius:5px; +} +aside ul a:hover, +aside ul a.selected { + background:#C8D3E6; + color:black; +} +aside ul a.selected { + background:black; + color:white !important; +} + +section#content { + clear:both; + padding-top:20px; +} +article { + width:78%; +} +article div#content-margin-fix +{ + margin-left:74px; +} +aside#menu +{ + margin-top:0px; +} +pre.prettyprint +{ + border-radius:5px; +} +pre.prettyprint code +{ + font-family: 'Ubuntu Mono', sans-serif; +} +h1 { + font-size: 24px; + margin:0; + padding:0; +} +h2 { + font-size: 20px; +} +h3 { + font-weight:bold; +} +article a { + text-decoration:none; + display:inline-block; + background:#C8D3E6; + color:black; + padding:2px; + border-radius:5px; +} +article a:hover { + text-decoration:none; + display:inline-block; + background:black; + color:white; + padding:2px; + border-radius:5px; +} +code { + text-decoration:none; + display:inline-block; + background:black; + color:white; + padding:2px; + border-radius:5px; + font-family: 'Ubuntu Mono', sans-serif; +} \ No newline at end of file diff --git a/styles/pygments.css b/styles/pygments.css new file mode 100644 index 00000000000..122b4294b9c --- /dev/null +++ b/styles/pygments.css @@ -0,0 +1,61 @@ +.hll { background-color: #ffffcc } +.c { color: #408080; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #008000; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.cp { color: #BC7A00 } /* Comment.Preproc */ +.c1 { color: #408080; font-style: italic } /* Comment.Single */ +.cs { color: #408080; font-style: italic } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #00A000 } /* Generic.Inserted */ +.go { color: #808080 } /* Generic.Output */ +.gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0040D0 } /* Generic.Traceback */ +.kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #008000 } /* Keyword.Pseudo */ +.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #B00040 } /* Keyword.Type */ +.m { color: #666666 } /* Literal.Number */ +.s { color: #BA2121 } /* Literal.String */ +.na { color: #7D9029 } /* Name.Attribute */ +.nb { color: #008000 } /* Name.Builtin */ +.nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.no { color: #880000 } /* Name.Constant */ +.nd { color: #AA22FF } /* Name.Decorator */ +.ni { color: #999999; font-weight: bold } /* Name.Entity */ +.ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.nf { color: #0000FF } /* Name.Function */ +.nl { color: #A0A000 } /* Name.Label */ +.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.nt { color: #008000; font-weight: bold } /* Name.Tag */ +.nv { color: #19177C } /* Name.Variable */ +.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mf { color: #666666 } /* Literal.Number.Float */ +.mh { color: #666666 } /* Literal.Number.Hex */ +.mi { color: #666666 } /* Literal.Number.Integer */ +.mo { color: #666666 } /* Literal.Number.Oct */ +.sb { color: #BA2121 } /* Literal.String.Backtick */ +.sc { color: #BA2121 } /* Literal.String.Char */ +.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #BA2121 } /* Literal.String.Double */ +.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #BA2121 } /* Literal.String.Heredoc */ +.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.sx { color: #008000 } /* Literal.String.Other */ +.sr { color: #BB6688 } /* Literal.String.Regex */ +.s1 { color: #BA2121 } /* Literal.String.Single */ +.ss { color: #19177C } /* Literal.String.Symbol */ +.bp { color: #008000 } /* Name.Builtin.Pseudo */ +.vc { color: #19177C } /* Name.Variable.Class */ +.vg { color: #19177C } /* Name.Variable.Global */ +.vi { color: #19177C } /* Name.Variable.Instance */ +.il { color: #666666 } /* Literal.Number.Integer.Long */