Skip to content

Commit f571a1a

Browse files
committed
Merge branch 'master' of github.com:elastic/elasticsearch-net
2 parents 8cccbc2 + 1c9b62e commit f571a1a

File tree

47 files changed

+9128
-7916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+9128
-7916
lines changed

docs/asciidoc/ClientConcepts/HighLevel/Inferrence/FieldInference.doc.asciidoc

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Expect("name")
2323
.WhenSerializing(fieldExpression)
2424
.WhenSerializing(fieldString);
2525
----
26-
Therefor you can also implicitly convert strings and expressions to Field's
26+
Therefore you can also implicitly convert strings and expressions to Field's
2727

2828
[source, csharp]
2929
----
@@ -52,7 +52,7 @@ but for expressions this is still rather involved
5252

5353
[source, csharp]
5454
----
55-
var fieldExpression = Field<Project>(p => p.Name);
55+
var fieldExpression = Infer.Field<Project>(p => p.Name);
5656
----
5757
Using static imports in c# 6 this can be even shortened:
5858
using static Nest.Static;
@@ -175,6 +175,36 @@ var suffix = "unanalyzed";
175175
Expect("metadata.var.unanalyzed").WhenSerializing(Field<Project>(p => p.Metadata[variable].Suffix(suffix)));
176176
Expect("metadata.var.created.unanalyzed").WhenSerializing(Field<Project>(p => p.Metadata[variable].Created.Suffix(suffix)));
177177
----
178+
179+
Suffixes can be appended to expressions. This is useful in cases where you want to apply the same suffix
180+
to a list of fields
181+
182+
183+
184+
[source, csharp]
185+
----
186+
var expressions = new List<Expression<Func<Project, object>>>
187+
{
188+
p => p.Name,
189+
p => p.Description,
190+
p => p.CuratedTags.First().Name,
191+
p => p.LeadDeveloper.FirstName
192+
};
193+
----
194+
append the suffix "raw" to each expression
195+
196+
[source, csharp]
197+
----
198+
var fieldExpressions =
199+
expressions.Select<Expression<Func<Project, object>>, Field>(e => e.AppendSuffix("raw")).ToList();
200+
----
201+
[source, csharp]
202+
----
203+
Expect("name.raw").WhenSerializing(fieldExpressions[0]);
204+
Expect("description.raw").WhenSerializing(fieldExpressions[1]);
205+
Expect("curatedTags.name.raw").WhenSerializing(fieldExpressions[2]);
206+
Expect("leadDeveloper.firstName.raw").WhenSerializing(fieldExpressions[3]);
207+
----
178208
Annotations
179209

180210
When using NEST's property attributes you can specify a new name for the properties

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Repository for both **NEST** and **Elasticsearch.Net**, the two official [elasti
3232
<td>:white_check_mark:</td>
3333
<td><a href="http://elasticdotnettemp.westeurope.cloudapp.azure.com/project.html?projectId=Nest2x_BuildTestAndIntegrate&tab=projectOverview"><img src="http://elasticdotnettemp.westeurope.cloudapp.azure.com/app/rest/builds/buildType:Nest2x_BuildTestAndIntegrate_Fake/statusIcon.svg"></a></td>
3434
<td><a href="https://www.myget.org/gallery/elasticsearch-net"><img src="https://www.myget.org/BuildSource/Badge/elasticsearch-net?identifier=624cebb3-a461-466f-9bac-7026c8ba615a"></a></td>
35-
<td>:heavy_minus_sign:</td>
35+
<td><a href="https://www.nuget.org/packages/NEST/2.0.0-rc1"><img src="https://img.shields.io/badge/nuget-2.0.0--rc1-blue.svg?style=flat-square"><img src="https://img.shields.io/nuget/dt/NEST.svg?style=flat-square"></a>
3636
</tr>
3737
</table>
3838

src/Benchmarking/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
[assembly: AssemblyCompanyAttribute("Elasticsearch")]
88
[assembly: AssemblyConfigurationAttribute("Release")]
99
[assembly: AssemblyVersionAttribute("2.0.0")]
10-
[assembly: AssemblyFileVersionAttribute("2.1.0")]
11-
[assembly: AssemblyInformationalVersionAttribute("2.1.0-ci20160129160552")]
10+
[assembly: AssemblyFileVersionAttribute("2.0.0")]
11+
[assembly: AssemblyInformationalVersionAttribute("2.0.0-rc1")]
1212
namespace System {
1313
internal static class AssemblyVersionInformation {
1414
internal const string Version = "2.0.0";

src/Benchmarking/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.0-ci20160129160552",
2+
"version": "2.0.0-rc1",
33
"compilationOptions": {
44
"warningsAsErrors": false,
55
"define": [ "LINQ", "NDESK_OPTIONS" ],

0 commit comments

Comments
 (0)