This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Movie | |
| { | |
| public string Title { get; private set; } | |
| public List<string> Genres { get; private set; } | |
| public Movie(string title, List<string> genres) | |
| { | |
| Title = title; | |
| Genres = genres; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Movie | |
| { | |
| private readonly string <Title>k__BackingField | |
| private readonly List<string> <Genres>k__BackingField; | |
| public string Title | |
| { | |
| get { return this.<Title>k__BackingField; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Movie | |
| { | |
| public string Title { get; } = "The Big Lebowski"; | |
| public List<string> Genres { get; } = new List<string> { "Comedy", "Crime" }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Movie | |
| { | |
| public string Title { get; private set; } | |
| public List<string> Genres { get; private set; } | |
| public Movie() | |
| { | |
| Title = "The Big Lebowski"; | |
| Genres = new List<string> { "Comedy", "Crime" }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |
| <PlatformTarget>AnyCPU</PlatformTarget> | |
| <DebugSymbols>true</DebugSymbols> | |
| <DebugType>full</DebugType> | |
| <Optimize>false</Optimize> | |
| <OutputPath>bin\Debug\</OutputPath> | |
| <DefineConstants>DEBUG;TRACE</DefineConstants> | |
| <ErrorReport>prompt</ErrorReport> | |
| <WarningLevel>4</WarningLevel> | |
| <LangVersion>Experimental</LangVersion> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var result = elasticClient.Search<ErrorDocument>(search => search | |
| .SearchType(SearchType.Count) | |
| .Query(q => q | |
| .Range(range => range | |
| .OnField(field => field.Time) | |
| .GreaterOrEquals(DateTime.UtcNow.AddHours(-24)) | |
| .LowerOrEquals(DateTime.UtcNow) | |
| ) | |
| ) | |
| .Aggregations(a => a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| elasticClient.DeleteIndex(d => d.Index("customers-v1")); | |
| elasticClient.Alias(x => x.Add(a => a.Alias("customers").Index("customers-v2"))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var reindex = | |
| elasticClient.Reindex<Customer>(r => | |
| r.FromIndex("customers-v1") | |
| .ToIndex("customers-v2") | |
| .Query(q => q.MatchAll()) | |
| .Scroll("10s") | |
| .CreateIndex(i => | |
| i.AddMapping<Customer>(m => | |
| m.Properties(p => | |
| p.String(n => n.Name(name => name.Zipcode).Index(FieldIndexOption.not_analyzed)))))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| elasticClient.Index(new Customer { Zipcode = 8000 }); |