├── .gitignore
├── AngularAutoCompleteAspNetCoreElasticsearch.sln
├── README.md
└── src
└── AngularAutoCompleteAspNetCoreElasticsearch
├── AngularAutoCompleteAspNetCoreElasticsearch.csproj
├── Controllers
└── PersonCityController.cs
├── ElasticsearchProvider
├── IPersonCitySearchProvider.cs
├── PersonCity.cs
├── PersonCityData.cs
├── PersonCityMapping.cs
├── PersonCityMappingDto.cs
├── PersonCitySearchProvider.cs
└── PersonCitySearchResult.cs
├── Program.cs
├── Properties
└── launchSettings.json
├── Startup.cs
├── angularApp
├── app
│ ├── app.component.html
│ ├── app.component.scss
│ ├── app.component.ts
│ ├── app.constants.ts
│ ├── app.module.ts
│ ├── app.routes.ts
│ ├── home
│ │ ├── home.component.html
│ │ └── home.component.ts
│ ├── homesearch
│ │ ├── homesearch.component.html
│ │ └── homesearch.component.ts
│ ├── model
│ │ ├── personCity.ts
│ │ └── personCitySearchResult.ts
│ ├── personcityautocomplete
│ │ ├── personcityautocomplete.component.scss
│ │ ├── personcityautocomplete.component.ts
│ │ └── personcityautocompleteService.ts
│ ├── personcitysearch
│ │ ├── personcitysearch.component.scss
│ │ ├── personcitysearch.component.ts
│ │ └── personcitysearchService.ts
│ └── services
│ │ └── searchDataService.ts
├── css
│ ├── bootstrap-theme.css
│ ├── bootstrap-theme.css.map
│ ├── bootstrap-theme.min.css
│ ├── bootstrap-theme.min.css.map
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ ├── bootstrap.min.css
│ └── bootstrap.min.css.map
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
├── images
│ ├── damienbod.jpg
│ ├── github.png
│ ├── mvp.png
│ └── socialTwitter.png
├── index.html
├── main-aot.ts
├── main.ts
├── polyfills.ts
├── style
│ └── app.scss
└── vendor.ts
├── appsettings.json
├── favicon.ico
├── package.json
├── runtimeconfig.template.json
├── tsconfig-aot.json
├── tsconfig.json
├── tslint.json
├── web.config
├── webpack.config.js
├── webpack.dev.js
├── webpack.helpers.js
└── webpack.prod.js
/.gitignore:
--------------------------------------------------------------------------------
1 | src/Angular2AutoCompleteAspNetCoreElasticsearch/obj
2 |
3 | .vs
4 | src/AngularAutoCompleteAspNetCoreElasticsearch/aot
5 | src/AngularAutoCompleteAspNetCoreElasticsearch/angularApp/**/*.js
6 |
7 | src/AngularAutoCompleteAspNetCoreElasticsearch/node_modules
8 | src/AngularAutoCompleteAspNetCoreElasticsearch/angularApp/app/**/*.map
9 | src/AngularAutoCompleteAspNetCoreElasticsearch/wwwroot
10 | src/AngularAutoCompleteAspNetCoreElasticsearch/angularApp/main.js.map
11 | src/AngularAutoCompleteAspNetCoreElasticsearch/angularApp/polyfills.js.map
12 | src/AngularAutoCompleteAspNetCoreElasticsearch/angularApp/vendor.js.map
13 | src/AngularAutoCompleteAspNetCoreElasticsearch/bin
14 | src/AngularAutoCompleteAspNetCoreElasticsearch/obj
15 |
--------------------------------------------------------------------------------
/AngularAutoCompleteAspNetCoreElasticsearch.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26206.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{599448E5-ED3D-44C2-93DA-46650CE8B1CC}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{14F7F195-ABA8-42B3-9C78-B4B6B7F13DB6}"
9 | ProjectSection(SolutionItems) = preProject
10 | README.md = README.md
11 | EndProjectSection
12 | EndProject
13 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AngularAutoCompleteAspNetCoreElasticsearch", "src\AngularAutoCompleteAspNetCoreElasticsearch\AngularAutoCompleteAspNetCoreElasticsearch.csproj", "{16E13622-7E32-4D3B-A382-CABA654D359F}"
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug|Any CPU = Debug|Any CPU
18 | Debug|x64 = Debug|x64
19 | Debug|x86 = Debug|x86
20 | Release|Any CPU = Release|Any CPU
21 | Release|x64 = Release|x64
22 | Release|x86 = Release|x86
23 | EndGlobalSection
24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
25 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Debug|Any CPU.Build.0 = Debug|Any CPU
27 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Debug|x64.ActiveCfg = Debug|x64
28 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Debug|x64.Build.0 = Debug|x64
29 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Debug|x86.ActiveCfg = Debug|x86
30 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Debug|x86.Build.0 = Debug|x86
31 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Release|Any CPU.ActiveCfg = Release|Any CPU
32 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Release|Any CPU.Build.0 = Release|Any CPU
33 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Release|x64.ActiveCfg = Release|x64
34 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Release|x64.Build.0 = Release|x64
35 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Release|x86.ActiveCfg = Release|x86
36 | {16E13622-7E32-4D3B-A382-CABA654D359F}.Release|x86.Build.0 = Release|x86
37 | EndGlobalSection
38 | GlobalSection(SolutionProperties) = preSolution
39 | HideSolutionNode = FALSE
40 | EndGlobalSection
41 | GlobalSection(NestedProjects) = preSolution
42 | {16E13622-7E32-4D3B-A382-CABA654D359F} = {599448E5-ED3D-44C2-93DA-46650CE8B1CC}
43 | EndGlobalSection
44 | EndGlobal
45 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Angular autocomplete with ASP.NET Core and Elasticsearch
2 |
3 | 2017.02.10: Updated to VS2017, Angular 2.4.6 and webpack 2.2.1
4 |
5 | 2017.01.04: Updated to VS2017, Angular 2.4.1 and webpack 2.2.0-rc.3
6 |
7 | Use the VS2015 tag to get xproj, VS 2015 version
8 |
9 | https://damienbod.com/2016/10/17/angular2-autocomplete-with-asp-net-core-and-elasticsearch/
10 |
11 | https://damienbod.com/2016/10/29/angular2-search-with-asp-net-core-and-elasticsearch/
12 |
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/AngularAutoCompleteAspNetCoreElasticsearch.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | netcoreapp1.1
5 | true
6 | AngularAutoCompleteAspNetCoreElasticsearch
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/Controllers/PersonCityController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using SearchComponent;
3 |
4 | namespace Angular2AutoCompleteAspNetCoreElasticsearch.Controllers
5 | {
6 | [Route("api/[controller]")]
7 | public class PersonCityController : Controller
8 | {
9 | private readonly IPersonCitySearchProvider _personCitySearchProvider;
10 |
11 | public PersonCityController(IPersonCitySearchProvider personCitySearchProvider)
12 | {
13 | _personCitySearchProvider = personCitySearchProvider;
14 | }
15 |
16 | [HttpGet("search/{from}/{searchtext}")]
17 | public IActionResult Search(string searchtext, int from)
18 | {
19 | return Ok(_personCitySearchProvider.Search(searchtext.ToLower(), from));
20 | }
21 |
22 | [HttpGet("querystringsearch/{searchtext}")]
23 | public IActionResult QueryString(string searchtext)
24 | {
25 | return Ok(_personCitySearchProvider.QueryString(searchtext));
26 | }
27 |
28 | [HttpGet("autocomplete/{searchtext}")]
29 | public IActionResult AutoComplete(string searchtext)
30 | {
31 | return Ok(_personCitySearchProvider.AutocompleteSearch(searchtext.ToLower()));
32 | }
33 |
34 | [HttpGet("createindex")]
35 | public IActionResult CreateIndex()
36 | {
37 | _personCitySearchProvider.CreateIndex();
38 | return Ok("index created");
39 | }
40 |
41 | [HttpGet("createtestdata")]
42 | public IActionResult CreateTestData()
43 | {
44 | _personCitySearchProvider.CreateTestData();
45 | return Ok("test data created");
46 | }
47 |
48 | [HttpGet("indexexists")]
49 | public IActionResult GetElasticsearchStatus()
50 | {
51 | return Ok(_personCitySearchProvider.GetStatus());
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/ElasticsearchProvider/IPersonCitySearchProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace SearchComponent
4 | {
5 | public interface IPersonCitySearchProvider
6 | {
7 | void CreateIndex();
8 |
9 | void CreateTestData();
10 |
11 | IEnumerable AutocompleteSearch(string term);
12 |
13 | PersonCitySearchResult Search(string term, int from);
14 |
15 | bool GetStatus();
16 |
17 | IEnumerable QueryString(string term);
18 | }
19 | }
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/ElasticsearchProvider/PersonCity.cs:
--------------------------------------------------------------------------------
1 | namespace SearchComponent
2 | {
3 | public class PersonCity
4 | {
5 | public long Id { get; set; }
6 | public string Name { get; set; }
7 | public string FamilyName { get; set; }
8 | public string Info { get; set; }
9 | public string CityCountry { get; set; }
10 | public string Metadata { get; set; }
11 | public string Web { get; set; }
12 | public string Github { get; set; }
13 | public string Twitter { get; set; }
14 | public string Mvp { get; set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/ElasticsearchProvider/PersonCityData.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace SearchComponent
4 | {
5 | public static class PersonCityData
6 | {
7 | public static List Data = new List();
8 |
9 | public static void CreateTestData()
10 | {
11 | Data.Add(new PersonCity {
12 | Id = 1, Name = "Damien", FamilyName = "Bowden", CityCountry="Switzerland",
13 | Metadata = "ASP.NET Core EFCore SQLite Angular2 Angular Typescript javascript Microsoft MVP webpack security",
14 | Info = "I am an engineer, Microsoft MVP, living in Switzerland interested in web development. My favorite technologies are ASP.NET Core, EFCore, ASP.NET, WebAPI, AngularJS, Angular 2, Typescript, MS SQL Server, SQLite and Elasticsearch.",
15 | Web= "https://damienbod.com",
16 | Twitter= "https://twitter.com/damien_bod",
17 | Github = "https://github/damienbod",
18 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/5002218"
19 | });
20 |
21 | Data.Add(new PersonCity
22 | {
23 | Id = 2,
24 | Name = "Fabian",
25 | FamilyName = "Grossbrink",
26 | CityCountry = "Switzerland St Gallen",
27 | Metadata = "ASP.NET Core Angular2 Angular Typescript javascript Microsoft MVP webpack",
28 | Info = "Fabian is Professional Software Engineer in Winterthur at the Noser Engineering AG. He is Microsoft Technology Ambassador in Switzerland, MVP and Microsoft Certified Specialist in Desktop- (WPF) and Web application development with Asp.Net, WebAPI/MVC, HTML, Javascript, Azure and Webservices. His attention is particularly on developing cross platform (web) applications with AngularJs, Ionic, Cordova, Electron and connected frameworks and tools. Additionally Fabian is certified Scrum Master and Scrum developer as well as active speaker for Microsoft in topics of web development.Interests are ASP.NET Core, Javascript(AngularJs, Angular2,...), Typescript, WebAPI(and Architecture), modern architecture for distributed systems (REST - Services), Entity Framework, TFS, Coaching, Agile Development(Scrum) and many more",
29 | Web = "http://fabian-gosebrink.com/",
30 | Twitter = "https://twitter.com/FabianGosebrink",
31 | Github = "https://github.com/FabianGosebrink",
32 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/5001666?fullName=Fabian%20%20Gosebrink"
33 | });
34 |
35 | Data.Add(new PersonCity
36 | {
37 | Id = 3,
38 | Name = "Jürgen",
39 | FamilyName = "Gutsch",
40 | CityCountry = "Switzerland Basel",
41 | Metadata = "ASP.NET Core Angular2 Angular Typescript javascript Microsoft MVP Azure",
42 | Info = "Jürgen Gutsch is software developer, consultant and trainer at the YooApplications AG (yooapps.com) in Basel (Switzerland). Along with family and job, he is a free author trainer und consultant, writes about ASP.NET, .NET, web technologies and Community in a blog on http://asp.net-hacker.rocks und leads the .NET user group in Basel (Switzerland)",
43 | Web = "http://asp.net-hacker.rocks/",
44 | Twitter = "https://twitter.com/sharpcms",
45 | Github = "https://github.com/JuergenGutsch",
46 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/5001508?fullName=J%C3%BCrgen%20%20Gutsch"
47 | });
48 |
49 | Data.Add(new PersonCity
50 | {
51 | Id = 4,
52 | Name = "Benjamin",
53 | FamilyName = "Abt",
54 | CityCountry = "Germany",
55 | Metadata = "ASP.NET Core Microsoft MVP Azure AngularJS TypeScript",
56 | Info = "Benjamin Abt is a software architect and developer focused on .NET, ASP.NET, Azure, AngularJS and TypeScript. He became an ASP.NET/IIS MVP on July, 2015. Studio is his second home. He's an administrator and moderator of the largest german-speaking C# forum, www.mycsharp.de and he spends a lot of time supporting other users on their problems and projects. His blog SCHWABENCODE.com is well known in the german - speaking community. It's focused on german, because he thinks the DACH region has great developers, is a great location for research and development but still there are a lot of developers who do easier with their native language. On GitHub you can follow him on https://github.com/SchwabenCode/ for releases and https://github.com/BenjaminAbt for samples. Ben currently works as Software Architect focused on.NET and Cloud technologies.",
57 | Web = "http://www.benjamin-abt.com",
58 | Twitter = "https://twitter.com/SCHWABENCODEcom",
59 | Github = "https://github.com/BenjaminAbt",
60 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/5001507?fullName=Benjamin%20%20Abt"
61 | });
62 |
63 | Data.Add(new PersonCity
64 | {
65 | Id = 5,
66 | Name = "Alexander",
67 | FamilyName = "Zeitler",
68 | CityCountry = "Germany Karlsruhe, BW",
69 | Metadata = "ASP.NET MVC Microsoft MVP Web API",
70 | Info = "Alexander Zeitler is a self-employed Web Developer who has spent 17 years working mainly for the tooling and machining industry as well as plant manufacturing, where he works mainly with ASP.NET MVC and now ASP.NET Web API on the server side and HTML5, CSS3 and JavaScript on the client side. He has been rewarded repeatedly with the Microsoft MVP award in ASP.NET for his engagement with the German.NET community and he maintains a blog at http://blog.alexonasp.net, which he has kept since 2003.",
71 | Web = "https://alexanderzeitler.com/",
72 | Twitter = "https://twitter.com/alexzeitler_",
73 | Github = "https://github.com/alexzeitler",
74 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/10225?fullName=Alexander%20%20Zeitler"
75 | });
76 |
77 | Data.Add(new PersonCity
78 | {
79 | Id = 6,
80 | Name = "Christos",
81 | FamilyName = "Sakellarios",
82 | CityCountry = "Greece Athens Attica",
83 | Metadata = "ASP.NET MVC Microsoft MVP Web API Typescript security",
84 | Info = "Senior Web Developer Blogger ",
85 | Web = "https://chsakell.com/",
86 | Twitter = "https://twitter.com/chsakellsblog",
87 | Github = "https://github.com/chsakell",
88 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/5002193?fullName=Christos%20%20Sakellarios"
89 | });
90 |
91 | Data.Add(new PersonCity
92 | {
93 | Id = 7,
94 | Name = "Ali Tugberk",
95 | FamilyName = "Ugurlu",
96 | CityCountry = "United Kingdom Cambridge",
97 | Metadata = "ASP.NET MVC Microsoft MVP Web API",
98 | Info = "I am a web guy, Microsoft MVP and software developer specialized mainly on .NET Web technologies. I've worked at the tourism industry to build tourism software services and products for long time and now, I am working at Redgate Software as a Software Engineer helping people do database delivery in a joyful way. I am also a very involved member in the community and try my way to expose my knowledge to others through my blog, webcasts, authoring books, giving talks on various topics and so on. I live in lovely and green Cambridge, UK and I am married to a lovely woman.",
99 | Web = "http://www.tugberkugurlu.com",
100 | Twitter = "https://twitter.com/tourismgeek",
101 | Github = "https://github.com/tugberkugurlu",
102 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/4039968?fullName=Ali%20Tugberk%20%20Ugurlu"
103 | });
104 |
105 | Data.Add(new PersonCity
106 | {
107 | Id = 8,
108 | Name = "Scott",
109 | FamilyName = "Hanselman",
110 | CityCountry = "USA",
111 | Metadata = "ASP.NET Core Web API",
112 | Info = "My name is Scott Hanselman. I'm a programmer, teacher, and speaker. I work out of my home office in Portland, Oregon for the Web Platform Team at Microsoft, but this blog, its content and opinions are my own. I blog about technology, culture, gadgets, diversity, code, the web, where we're going and where we've been. I'm excited about community, social equity, media, entrepreneurship and above all, the open web.",
113 | Web = "http://www.hanselman.com/",
114 | Twitter = "https://twitter.com/shanselman",
115 | Github = "",
116 | Mvp = ""
117 | });
118 |
119 | Data.Add(new PersonCity
120 | {
121 | Id = 9,
122 | Name = "Roberto",
123 | FamilyName = "Simonetti",
124 | CityCountry = "Italy",
125 | Metadata = ".NET TypeScript Angular Angular2 ASP.NET Core",
126 | Info = "My passion was born with Basic on TI-99/4A & Commodore. At school I discovered Turbo Pascal & Java. I loved Visual Basic, .NET, and now TypeScript & Angular.",
127 | Web = "https://github.com/robisim74",
128 | Twitter = "https://twitter.com/robisim74",
129 | Github = "https://github.com/robisim74",
130 | Mvp = ""
131 | });
132 |
133 | Data.Add(new PersonCity
134 | {
135 | Id = 10,
136 | Name = "John",
137 | FamilyName = "Papa",
138 | CityCountry = "USA",
139 | Metadata = "Angular2 Angular",
140 | Info = "Hi, I'm John Papa. I author this blog, create courses for Pluralsight and am a Google Developer Expert and Microsoft Regional Director. I speak at events and train technology thought leaders",
141 | Web = "https://johnpapa.net/about/",
142 | Twitter = "https://twitter.com/john_papa",
143 | Github = "https://github.com/johnpapa",
144 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/4040095?fullName=John%20%20Papa"
145 | });
146 |
147 | Data.Add(new PersonCity
148 | {
149 | Id = 11,
150 | Name = "Dan",
151 | FamilyName = "Wahlin",
152 | CityCountry = "USA",
153 | Metadata = "JavaScript Angular Node.js, C# ASP.NET MVC Web API Docker",
154 | Info = "Dan Wahlin founded Wahlin Consulting which provides consulting and training services on Web technologies such as JavaScript, Angular, Node.js, C#, ASP.NET MVC, Web API, and Docker. He’s also published over 10 developer courses on Pluralsight.com and Udemy.com including the new Docker for Web Developers course. Dan is a Microsoft MVP and Regional Director and speaks at conferences and user groups around the world. Dan has written several books on Web technologies, hundreds of technical articles and blog posts (http://blog.codewithdan.com) and runs the Web Weekly newsletter - a great way to stay up on the latest technologies. Follow Dan on Twitter @DanWahlin.",
155 | Web = "https://blog.codewithdan.com/",
156 | Twitter = "https://twitter.com/danwahlin",
157 | Github = "https://github.com/danwahlin",
158 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/7586?fullName=Dan%20%20Wahlin"
159 | });
160 |
161 | Data.Add(new PersonCity
162 | {
163 | Id = 12,
164 | Name = "Jeremy",
165 | FamilyName = "Likness",
166 | CityCountry = "USA",
167 | Metadata = "JavaScript Angular Angular2 C# ASP.NET",
168 | Info = "Jeremy Likness leads the application development practice for Atlanta-based iVision and is an experienced entrepreneur and technology executive who has successfully helped ship commercial enterprise software for 20 years. He specializes in catalyzing growth, developing ideas and creating value through delivering software in technical enterprises. His roles as business owner, technology executive and hands-on developer provided unique opportunities to directly impact the bottom line of multiple businesses by helping them grow and increase their organizational capacity while improving operational efficiency. He has worked with several initially small companies like Manhattan Associates and AirWatch before they grew large and experienced their transition from good to great while helping direct vision and strategy to embrace changing technology and markets. Jeremy is capable of quickly adapting to new paradigms and helps technology teams endure change by providing strong leadership, working with team members “in the trenches” and mentoring them in the soft skills that are key for engineers to bridge the gap between business and technology.",
169 | Web = "http://csharperimage.jeremylikness.com/",
170 | Twitter = "https://twitter.com/jeremylikness",
171 | Github = "https://github.com/jeremylikness",
172 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/4028936?fullName=Jeremy%20%20Likness"
173 | });
174 |
175 | Data.Add(new PersonCity
176 | {
177 | Id = 13,
178 | Name = "Julie",
179 | FamilyName = "Lerman",
180 | CityCountry = "USA Vermont",
181 | Metadata = "Entity Framework EFCore C# ASP.NET PostgreSQL DDD Microsoft MVP",
182 | Info = "Vermont Geekette, DDD, .NET (& EF) Mentor, Author, MS MVP, MS Regional Director, VTdotNET, Pluralsight, MSDN Mag. Talk to me about mentoring your dev team!",
183 | Web = "http://thedatafarm.com/blog/",
184 | Twitter = "https://twitter.com/julielerman",
185 | Github = "https://github.com/julielerman",
186 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/8987?fullName=Julie%20%20Lerman"
187 | });
188 |
189 | Data.Add(new PersonCity
190 | {
191 | Id = 14,
192 | Name = "Kurata",
193 | FamilyName = "Deborah",
194 | CityCountry = "Pleasanton, CA",
195 | Metadata = "Angular Angular2 Microsoft MVP",
196 | Info = "Software developer, independent consultant, Pluralsight author, speaker, Microsoft MVP, Google GDE. Co-chair of Eastbay .NET, which meets in Berkeley.",
197 | Web = "http://blogs.msmvps.com/deborahk/",
198 | Twitter = "https://twitter.com/DeborahKurata",
199 | Github = "https://github.com/DeborahK",
200 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/10169?fullName=Deborah%20%20Kurata"
201 | });
202 |
203 | Data.Add(new PersonCity
204 | {
205 | Id = 15,
206 | Name = "Andrew",
207 | FamilyName = "Lock",
208 | CityCountry = "Plymouth, UK",
209 | Metadata = "ASP.NET Core security",
210 | Info = "My name is Andrew Lock, though everyone knows me as ‘Sock’. I am a full-time developer, working predominantly in full stack ASP.NET development in Devon, UK. I graduated with an MEng in Engineering from Cambridge University in 2008, and completed my PhD in Medical Image Processing in 2014. I have experience primarily with C# and VB ASP.NET, working both in MVC and WebForms, but have also worked professionally with C++ and WinForms. ",
211 | Web = "http://andrewlock.net/",
212 | Twitter = "https://twitter.com/andrewlocknet",
213 | Github = "https://github.com/andrewlock",
214 | Mvp = ""
215 | });
216 |
217 | Data.Add(new PersonCity
218 | {
219 | Id = 16,
220 | Name = "Brock",
221 | FamilyName = "Allen",
222 | CityCountry = "Barrington, RI ",
223 | Metadata = "ASP.NET Core security identityserver oidc javascript",
224 | Info = "Currently Brock is an independent consultant specializing in .NET, web development, and web - based security with 20 years of industry experience.Brock is the co - author of many security - related open source frameworks including IdentityServer, IdentityManager, and MembershipReboot.He also frequently posts to the ASP.NET forums, is a MVP for ASP.NET / IIS, a member of ASPInsiders and a contributor to the ASP.NET platform. Brock lives in Barrington, RI and can be reached at brockallen@gmail.com.",
225 | Web = "https://brockallen.com/",
226 | Twitter = "https://twitter.com/brocklallen",
227 | Github = "https://github.com/brockallen",
228 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/4039969?fullName=Brock%20%20Allen"
229 | });
230 |
231 | Data.Add(new PersonCity
232 | {
233 | Id = 17,
234 | Name = "Dominick",
235 | FamilyName = "Baier",
236 | CityCountry = "Germany",
237 | Metadata = "ASP.NET Core security identityserver",
238 | Info = "I am an independent consultant specializing in identity & access control. I help companies around the world designing & implementing authentication and authorization for their distributed web and native applications. I am the co-author of the popular OpenID Connect & OAuth 2.0 framework called IdentityServer (http://identityserver.io) , have written a couple of books and tweet as @leastprivilege.",
239 | Web = "https://leastprivilege.com/",
240 | Twitter = "https://twitter.com/leastprivilege",
241 | Github = "https://github.com/leastprivilege",
242 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/21554?fullName=Dominick%20%20Baier"
243 | });
244 |
245 | Data.Add(new PersonCity
246 | {
247 | Id = 18,
248 | Name = "Scott",
249 | FamilyName = "Brady",
250 | CityCountry = "Bristol, United Kingdom",
251 | Metadata = "ASP.NET Core security identityserver",
252 | Info = "I am a Senior Software Engineer at Rock Solid Knowledge. We offer software development consultancy, development and training services with myself specialising in all things Identity Server. I work predominantly in C# back-end and middleware systems with the beginnings of a specialisation in web security. I have had a focus on cloud computing since my MSc dissertation in 2013, gaining experience using various cloud based PaaS and IaaS offerings ever since. ",
253 | Web = "https://www.scottbrady91.com/",
254 | Twitter = "https://twitter.com/scottbrady91",
255 | Github = "https://github.com/scottbrady91",
256 | Mvp = ""
257 | });
258 |
259 | Data.Add(new PersonCity
260 | {
261 | Id = 19,
262 | Name = "Shawn",
263 | FamilyName = "Wildermuth",
264 | CityCountry = "USA",
265 | Metadata = "ASP.NET Core .NET C#",
266 | Info = "Shawn Wildermuth is a fourteen-time Microsoft MVP (ASP.NET/IIS) and is involved with Microsoft as an ASP.NET Insider, ClientDev Insider and Windows Phone Insider. You may have taken one of his more than twenty courses for Pluralsight including Building a Web App with ASP.NET Core, MVC, EF and Angular and Bootstrap 3. He is also the author of eight books and dozens of articles on software development. He has been seen speaking at a variety of international conferences including TechEd, Oredev, SDC, VSLive, DevIntersection, MIX, DevTeach, DevConnections and DevReach. He is one of the Wilder Minds LLC.",
267 | Web = "http://wildermuth.com/",
268 | Twitter = "https://twitter.com/shawnwildermuth",
269 | Github = "https://github.com/shawnwildermuth",
270 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/9072?fullName=Shawn%20%20Wildermuth"
271 | });
272 |
273 | Data.Add(new PersonCity
274 | {
275 | Id = 20,
276 | Name = "Minko",
277 | FamilyName = "Gechev",
278 | CityCountry = "San Francisco, California USA",
279 | Metadata = "Angular Angular2",
280 | Info = "I created a JavaScript user group in Sofia, which has (had) regular Beer.js meet-ups. For about fifteen years I’ve been training karate (since 1999) and since 2005 I’ve been using different programming languages (including Pascal, Haskell, C, C++, PHP, JavaScript, Io, Java, AspectJ, C#, VisualBasic, Ruby, Python, Perl, ActionScript, Prolog…even Clips) so as you might see I’ve met different programming paradigms – functional, object-oriented, prototype-based oo, aspect-oriented, logical programming, procedural…I just don’t have a patience to see what’s coming next after the OO “dictatorship” :-).",
281 | Web = "http://blog.mgechev.com/",
282 | Twitter = "https://twitter.com/mgechev",
283 | Github = "https://github.com/mgechev",
284 | Mvp = ""
285 | });
286 |
287 | Data.Add(new PersonCity
288 | {
289 | Id = 21,
290 | Name = "Mike",
291 | FamilyName = "Brind",
292 | CityCountry = "Rochester United Kingdom",
293 | Metadata = "ASP.NET Core MVC EFCore SQL Microsoft MVP",
294 | Info = "Despite that (or perhaps because of it) I have been awarded Microsoft MVP for ASP/ASP.NET each year since 2008. I wrote a book for Wrox that covers the ASP.NET Web Pages framework and working with WebMatrix. It's called Beginning ASP.NET Web Pages With WebMatrix. I have been developing web sites since 2002, and am completely self-taught. I live in Rochester in the UK.",
295 | Web = "http://www.mikesdotnetting.com/",
296 | Twitter = "https://twitter.com/mikesdotnetting",
297 | Github = "",
298 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/4015684?fullName=Mike%20%20Brind"
299 | });
300 |
301 | Data.Add(new PersonCity
302 | {
303 | Id = 22,
304 | Name = "Rion",
305 | FamilyName = "Williams",
306 | CityCountry = "Lake Charles, Louisiana USA",
307 | Metadata = "ASP.NET Core MVC EFCore SQL Microsoft MVP javascript",
308 | Info = "Rion is an experienced, Full Stack Software Developer and Designer from Lake Charles, Louisiana. He is currently the Senior Software Developer at Structure X, a Systems Integrator and Software Development firm focusing in Healthcare. Rion graduated with three degrees (Computer Science, Mathematics and Visual Arts) from McNeese State University and has been building applications in the industrial and healthcare arenas ever since.",
309 | Web = "http://rion.io/",
310 | Twitter = "https://twitter.com/rionmonster",
311 | Github = "https://github.com/rionmonster",
312 | Mvp = "http://mvp.microsoft.com/en-us/MVP/Rion%20Williams-5000660"
313 | });
314 |
315 | Data.Add(new PersonCity
316 | {
317 | Id = 23,
318 | Name = "Shayne",
319 | FamilyName = "Boyer",
320 | CityCountry = "Florida, USA",
321 | Metadata = "ASP.NET Core Node.js JavaScript TypeScript Microsoft Azure Angular Mobile Development Microsoft MVP",
322 | Info = "Hi, I'm Shayne Boyer, I write this site, am a Microsoft MVP and Telerik Developer Expert who speaks at national and community events while helping teams architect web and cloud applications",
323 | Web = "http://tattoocoder.com/",
324 | Twitter = "https://twitter.com/spboyer",
325 | Github = "https://github.com/tattoocoder",
326 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/5000582?fullName=Shayne%20%20Boyer"
327 | });
328 |
329 | Data.Add(new PersonCity
330 | {
331 | Id = 24,
332 | Name = "Torgeir",
333 | FamilyName = "Helgevold",
334 | CityCountry = "New York USA",
335 | Metadata = "Angular Angular2",
336 | Info = "Software Engineer. Focusing on Angular 2.0 these days ",
337 | Web = "http://www.syntaxsuccess.com/",
338 | Twitter = "https://twitter.com/helgevold",
339 | Github = "https://github.com/thelgevold/",
340 | Mvp = ""
341 | });
342 |
343 | Data.Add(new PersonCity
344 | {
345 | Id = 25,
346 | Name = "Rob",
347 | FamilyName = "Wormald",
348 | CityCountry = "Mountain View CA",
349 | Metadata = "Angular Angular2",
350 | Info = "I’m a Javascripter, currently spending most of my time working on Angular2. ",
351 | Web = "http://www.roblog.io/",
352 | Twitter = "https://twitter.com/robwormald",
353 | Github = "https://github.com/robwormald",
354 | Mvp = ""
355 | });
356 |
357 | Data.Add(new PersonCity
358 | {
359 | Id = 26,
360 | Name = "Brad",
361 | FamilyName = "Green",
362 | CityCountry = "Mountain View CA",
363 | Metadata = "Angular Angular2",
364 | Info = "Engineering director at Google where I manage AngularJS and GreenTea (CRM). Also, I have 2 children and 4 chickens. Chickens are easier. ",
365 | Web = "https://plus.google.com/+BradGreen",
366 | Twitter = "https://twitter.com/bradlygreen",
367 | Github = "https://github.com/bradlygreen",
368 | Mvp = ""
369 | });
370 |
371 | Data.Add(new PersonCity
372 | {
373 | Id = 27,
374 | Name = "Victor",
375 | FamilyName = "Savkin",
376 | CityCountry = "Mountain View CA",
377 | Metadata = "Angular Angular2",
378 | Info = "Victor toys with eclectic programming technologies and obsesses over fonts and keyboard layouts. He also makes Angular.",
379 | Web = "https://vsavkin.com/",
380 | Twitter = "https://twitter.com/victorsavkin",
381 | Github = "https://github.com/vsavkin",
382 | Mvp = ""
383 | });
384 |
385 | Data.Add(new PersonCity
386 | {
387 | Id = 28,
388 | Name = "Todd",
389 | FamilyName = "Motto",
390 | CityCountry = "England UK",
391 | Metadata = "Angular Angular2",
392 | Info = "I’m Todd, a 26 year old front-end engineer from England, UK, working as a Developer Advocate at Telerik. Co-Founder of Ultimate Angular, a project to bring the Angular 1.x and Angular 2 ecosystem to developers through online courses. I’m also a Developer Expert at Google, conference speaker and open source lover.",
393 | Web = "https://toddmotto.com",
394 | Twitter = "https://twitter.com/toddmotto",
395 | Github = "https://github.com/toddmotto",
396 | Mvp = ""
397 | });
398 |
399 | Data.Add(new PersonCity
400 | {
401 | Id = 29,
402 | Name = "Pascal",
403 | FamilyName = "Precht",
404 | CityCountry = "Hanover Germany ",
405 | Metadata = "Angular Angular2",
406 | Info = "I like headphones, art, skateboarding and coding. Angular GDE at @Google, @thoughtram co-founder and creator of @5thingsAngular.",
407 | Web = "http://thoughtram.io/",
408 | Twitter = "https://twitter.com/PascalPrecht",
409 | Github = "https://github.com/PascalPrecht",
410 | Mvp = ""
411 | });
412 |
413 | Data.Add(new PersonCity
414 | {
415 | Id = 30,
416 | Name = "Martijn",
417 | FamilyName = "Laarman",
418 | CityCountry = "Amsterdam, Netherlands ",
419 | Metadata = "elasticsearch nest C# .NET",
420 | Info = "I work for Elasticsearch as .NET developer. ",
421 | Web = "http://localghost.io/",
422 | Twitter = "https://twitter.com/mpdreamz",
423 | Github = "https://github.com/Mpdreamz",
424 | Mvp = ""
425 | });
426 |
427 | Data.Add(new PersonCity
428 | {
429 | Id = 31,
430 | Name = "Troy",
431 | FamilyName = "Hunt",
432 | CityCountry = " Australia",
433 | Metadata = "security .NET",
434 | Info = "I'm Troy Hunt, an Australian Microsoft Regional Director and also a Microsoft Most Valuable Professional for Developer Security. I don't work for Microsoft, but they're kind enough to recognise my community contributions by way of their award programs which I've been an awardee of since 2011. I get to interact with some fantastic people building their best products and then share what I know about creating secure applications for the web with the broader community.",
435 | Web = "https://www.troyhunt.com/",
436 | Twitter = "https://twitter.com/troyhunt",
437 | Github = "",
438 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/4031649?fullName=Troy%20%20Hunt"
439 | });
440 |
441 | Data.Add(new PersonCity
442 | {
443 | Id = 32,
444 | Name = "Rick",
445 | FamilyName = "Strahl",
446 | CityCountry = " Paia, HI ",
447 | Metadata = " ASPNET, C#, HTML5, Mobile, JavaScript, Angular",
448 | Info = "Wind, waves, code and everything in between... ASP.NET • C# • HTML5 • JavaScript • AngularJs ",
449 | Web = "https://weblog.west-wind.com/",
450 | Twitter = "https://twitter.com/RickStrahl",
451 | Github = "https://github.com/RickStrahl",
452 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/5000249?fullName=Rick%20Strahl"
453 | });
454 |
455 | Data.Add(new PersonCity
456 | {
457 | Id = 33,
458 | Name = "Taiseer",
459 | FamilyName = "Joudeh",
460 | CityCountry = "Jordan",
461 | Metadata = " ASPNET, C#, HTML5, JavaScript, Angular Microsoft",
462 | Info = "My name is Taiseer Joudeh and this is my professional blog. I consider myself a passionate software engineer who is always willing to learn and explore new technologies, then apply it in real world scenarios and share this knowledge with the community. I have more than 10 years of experience spent in developing and managing different software solutions for finance, transportation, logistics, and e - commerce sectors.I’ve been deeply involved in .NET development since early framework versions and currently I work on different technologies on the ASP.NET stack with deep passion for Web API, and Microsoft Azure.Recently I’ve been focusing on building Single Page Applications, Hybrid Mobile Solutions using AngularJS, and focusing on the building identity solutions for modern apps. I have been awarded the Microsoft Most Valuable Professional(MVP) Award for the years 2015 and 2016 in the Visual Studio and Development Technologies, also I’m a regular speaker in local events and Dev user groups.",
463 | Web = "http://bitoftech.net/",
464 | Twitter = "https://twitter.com/TJoudeh",
465 | Github = "https://github.com/tjoudeh",
466 | Mvp = ""
467 | });
468 |
469 | Data.Add(new PersonCity
470 | {
471 | Id = 34,
472 | Name = "Simon",
473 | FamilyName = "Rigby",
474 | CityCountry = "USA",
475 | Metadata = " ASPNET, C#, HTML5, JavaScript, Angular Microsoft responsive design",
476 | Info = "Hey there. Nice to meet you. Let me introduce myself. My name is Simon Rigby. I've been working in the web industry since the end of that first dotcom boom. In that time I've been lucky enough to work for/with some great companies. I've rubbed shoulders with some top notch techies and savvy business owners. I've learned a lot of great things along the way, from keys to success to mistakes to avoid. And I bring all that experience to the table in every project I work on. Which means, if we work together, you get that benefit too. ",
477 | Web = "http://levelnis.co.uk/blog",
478 | Twitter = "https://twitter.com/levelnis",
479 | Github = "https://github.com/levelnis",
480 | Mvp = ""
481 | });
482 |
483 | Data.Add(new PersonCity
484 | {
485 | Id = 35,
486 | Name = "Scott",
487 | FamilyName = "Addie",
488 | CityCountry = "Verona, WI USA",
489 | Metadata = " ASP.NET Core, C# Microsoft MVP JavaScript OSS",
490 | Info = "Scott Addie is an ambitious, self-driven software architect & technical evangelist specializing in JavaScript and the modern Microsoft web stack. He is a Microsoft Certified Solutions Developer (MCSD – Web Applications), a Microsoft MVP (Visual Studio and Development Technologies), a frequent conference, code camp, and user group attendee, an ASP.NET and JavaScript blogger, and a technical speaker who has been developing enterprise web applications professionally since 2005. Scott lives in Madison, WI with his wife and 3 children.When not hacking away at an ASP.NET Core side project or slinging code on the latest JavaScript libraries / frameworks, he can be found spending time with his family. ",
491 | Web = "https://scottaddie.com/",
492 | Twitter = "https://twitter.com/Scott_Addie",
493 | Github = "https://github.com/scottaddie",
494 | Mvp = "https://mvp.microsoft.com/en-us/PublicProfile/5001850?fullName=Scott%20%20Addie"
495 | });
496 |
497 | Data.Add(new PersonCity
498 | {
499 | Id = 36,
500 | Name = "Jon",
501 | FamilyName = "Galloway",
502 | CityCountry = "Rancho San Diego, CA USA",
503 | Metadata = " ASP.NET Core C# Microsoft JavaScript",
504 | Info = "Jon works at Microsoft as a Technical Evangelist focused on ASP.NET and Windows Azure. He’s co-author of Wrox Professional ASP.NET MVC, writes samples and tutorials like the MVC Music Store and is a frequent speaker at conferences and international Web Camps events. Jon’s been doing professional web development for 17 years, including high scale applications in financial, entertainment and healthcare analytics. He’s part of the Herding Code podcast, Twitters as @jongalloway and blogs at http://weblogs.asp.net/jongalloway. He likes to travel, but spends most of his time in San Diego with his amazingly patient wife Rachel, three wonderful daughters, a dozen avocado trees and the occasional rattlesnake.",
505 | Web = "https://weblogs.asp.net/jongalloway/",
506 | Twitter = "https://twitter.com/jongalloway",
507 | Github = "https://github.com/jongalloway",
508 | Mvp = ""
509 | });
510 |
511 | Data.Add(new PersonCity
512 | {
513 | Id = 37,
514 | Name = "David",
515 | FamilyName = "Fowler",
516 | CityCountry = "Redmond USA",
517 | Metadata = " ASP.NET Core C# Microsoft SignalR",
518 | Info = "Software Developer at Microsoft on the http://ASP.NET team, Creator of SignalR, http://ASP.NET Core Architect, Tennis Player, Father and Husband",
519 | Web = "http://davidfowl.com/",
520 | Twitter = "https://twitter.com/davidfowl",
521 | Github = "https://github.com/davidfowl",
522 | Mvp = ""
523 | });
524 |
525 | Data.Add(new PersonCity
526 | {
527 | Id = 38,
528 | Name = "Steve",
529 | FamilyName = "Smith",
530 | CityCountry = "Kent OH USA",
531 | Metadata = " ASP.NET Core C# Microsoft DDD",
532 | Info = "Speaker, Author, and Software Craftsman. Microsoft MVP. Available for training / mentoring on DDD, ASPNET Core, and quality software: http://ardalis.com",
533 | Web = "http://ardalis.com/",
534 | Twitter = "https://twitter.com/ardalis",
535 | Github = "https://github.com/davidfowl",
536 | Mvp = ""
537 | });
538 |
539 | Data.Add(new PersonCity
540 | {
541 | Id = 39,
542 | Name = "Barry",
543 | FamilyName = "Dorrans",
544 | CityCountry = "Redmond USA",
545 | Metadata = " ASP.NET Core C# Microsoft Security",
546 | Info = "Sweary Security Snark. Microsoft's .NET security person. Opinions here are mine and not speaking on behalf of Microsoft or Microsoft Security.",
547 | Web = "https://idunno.org/",
548 | Twitter = "https://twitter.com/blowdart",
549 | Github = "https://github.com/blowdart",
550 | Mvp = ""
551 | });
552 |
553 | Data.Add(new PersonCity
554 | {
555 | Id = 40,
556 | Name = "Brice",
557 | FamilyName = "Lambson",
558 | CityCountry = "Redmond USA",
559 | Metadata = " ASP.NET Core C# Microsoft Entity Framework EFCore",
560 | Info = "Hello, my name is Brice Lambson. I’m a senior software engineer on the Entity Framework team at Microsoft. In my spare time, I enjoy giving back to the community through blogging and open source.",
561 | Web = "http://www.bricelam.net/",
562 | Twitter = "https://twitter.com/bricelambs",
563 | Github = "https://github.com/bricelam",
564 | Mvp = ""
565 | });
566 |
567 | }
568 | }
569 | }
570 |
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/ElasticsearchProvider/PersonCityMapping.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ElasticsearchCRUD;
3 |
4 | namespace SearchComponent
5 | {
6 | public class PersonCityMapping : ElasticsearchMapping
7 | {
8 | public override string GetIndexForType(Type type)
9 | {
10 | return "personcitys";
11 | }
12 |
13 | public override string GetDocumentType(Type type)
14 | {
15 | return "personcity";
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/ElasticsearchProvider/PersonCityMappingDto.cs:
--------------------------------------------------------------------------------
1 | using ElasticsearchCRUD.ContextAddDeleteUpdate.CoreTypeAttributes;
2 |
3 | namespace SearchComponent
4 | {
5 | public class PersonCityMappingDto
6 | {
7 | public long Id { get; set; }
8 |
9 | [ElasticsearchString(CopyToList = new[] { "autocomplete", "searchfield" })]
10 | public string Name { get; set; }
11 |
12 | [ElasticsearchString(CopyToList = new[] { "autocomplete", "searchfield" })]
13 | public string FamilyName { get; set; }
14 |
15 | [ElasticsearchString(CopyToList = new[] { "autocomplete", "searchfield" })]
16 | public string Info { get; set; }
17 |
18 | [ElasticsearchString(CopyToList = new[] { "autocomplete", "searchfield" })]
19 | public string CityCountry { get; set; }
20 |
21 | [ElasticsearchString(CopyToList = new[] { "autocomplete", "searchfield" })]
22 | public string Metadata { get; set; }
23 |
24 | public string Web { get; set; }
25 |
26 | public string Github { get; set; }
27 |
28 | public string Twitter { get; set; }
29 |
30 | public string Mvp { get; set; }
31 |
32 | [ElasticsearchString(Analyzer = "edge_ngram_search", SearchAnalyzer = "standard", TermVector = TermVector.yes)]
33 | public string searchfield { get; set; }
34 |
35 | [ElasticsearchString(Analyzer = "autocomplete")]
36 | public string autocomplete { get; set; }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/ElasticsearchProvider/PersonCitySearchProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using ElasticsearchCRUD;
4 | using ElasticsearchCRUD.ContextAddDeleteUpdate.IndexModel.MappingModel;
5 | using ElasticsearchCRUD.ContextAddDeleteUpdate.IndexModel.SettingsModel;
6 | using ElasticsearchCRUD.ContextAddDeleteUpdate.IndexModel.SettingsModel.Analyzers;
7 | using ElasticsearchCRUD.ContextAddDeleteUpdate.IndexModel.SettingsModel.Filters;
8 | using ElasticsearchCRUD.ContextSearch.SearchModel.AggModel;
9 | using ElasticsearchCRUD.Model;
10 | using ElasticsearchCRUD.Model.SearchModel;
11 | using ElasticsearchCRUD.Model.SearchModel.Aggregations;
12 | using ElasticsearchCRUD.Model.SearchModel.Queries;
13 | using ElasticsearchCRUD.Model.SearchModel.Sorting;
14 | using ElasticsearchCRUD.Tracing;
15 |
16 | namespace SearchComponent
17 | {
18 | public class PersonCitySearchProvider : IPersonCitySearchProvider
19 | {
20 | private readonly IElasticsearchMappingResolver _elasticsearchMappingResolver = new ElasticsearchMappingResolver();
21 | // const string ConnectionString = "http://localhost.fiddler:9200";
22 | private const string ConnectionString = "http://localhost:9200";
23 | private readonly ElasticsearchContext _context;
24 |
25 | public PersonCitySearchProvider()
26 | {
27 | _elasticsearchMappingResolver.AddElasticSearchMappingForEntityType(typeof(PersonCityMappingDto), new PersonCityMapping());
28 | _context = new ElasticsearchContext(ConnectionString, new ElasticsearchSerializerConfiguration(_elasticsearchMappingResolver))
29 | {
30 | TraceProvider = new ConsoleTraceProvider()
31 | };
32 | }
33 |
34 | public void CreateIndex()
35 | {
36 | _context.IndexCreate(CreateNewIndexDefinition());
37 | }
38 |
39 | public void CreateMapping()
40 | {
41 | _context.IndexCreateTypeMapping(new MappingDefinition() {});
42 | }
43 |
44 | private IndexDefinition CreateNewIndexDefinition()
45 | {
46 | return new IndexDefinition
47 | {
48 | IndexSettings =
49 | {
50 | Analysis = new Analysis
51 | {
52 | Filters =
53 | {
54 | CustomFilters = new List
55 | {
56 | new StemmerTokenFilter("stemmer"),
57 | new ShingleTokenFilter("autocompletefilter")
58 | {
59 | MaxShingleSize = 5,
60 | MinShingleSize = 2
61 | },
62 | new StopTokenFilter("stopwords"),
63 | new EdgeNGramTokenFilter("edge_ngram_filter")
64 | {
65 | MaxGram = 20,
66 | MinGram = 2
67 | }
68 | }
69 | },
70 | Analyzer =
71 | {
72 | Analyzers = new List
73 | {
74 | new CustomAnalyzer("edge_ngram_search")
75 | {
76 | Tokenizer = DefaultTokenizers.Standard,
77 | Filter = new List {DefaultTokenFilters.Lowercase, "edge_ngram_filter"},
78 | CharFilter = new List {DefaultCharFilters.HtmlStrip}
79 | },
80 | new CustomAnalyzer("autocomplete")
81 | {
82 | Tokenizer = DefaultTokenizers.Standard,
83 | Filter = new List {DefaultTokenFilters.Lowercase, "autocompletefilter", "stopwords", "stemmer"},
84 | CharFilter = new List {DefaultCharFilters.HtmlStrip}
85 | },
86 | new CustomAnalyzer("default")
87 | {
88 | Tokenizer = DefaultTokenizers.Standard,
89 | Filter = new List {DefaultTokenFilters.Lowercase, "stopwords", "stemmer"},
90 | CharFilter = new List {DefaultCharFilters.HtmlStrip}
91 | }
92 |
93 |
94 | }
95 | }
96 | //Tokenizers =
97 | //{
98 | // CustomTokenizers = new List
99 | // {
100 | // new EdgeNGramTokenizer("ngram_tokenizer")
101 | // {
102 | // MaxGram = 4,
103 | // MinGram = 4
104 | // }
105 | // }
106 | //}
107 |
108 | }
109 | },
110 | };
111 |
112 | }
113 |
114 | public IEnumerable AutocompleteSearch(string term)
115 | {
116 | var search = new Search
117 | {
118 | Size = 0,
119 | Aggs = new List
120 | {
121 | new TermsBucketAggregation("autocomplete", "autocomplete")
122 | {
123 | Order= new OrderAgg("_count", OrderEnum.desc),
124 | Include = new IncludeExpression(term + ".*")
125 | }
126 | }
127 | //Query = new Query(new PrefixQuery("autocomplete", term))
128 | };
129 |
130 | var items = _context.Search(search);
131 | var aggResult = items.PayloadResult.Aggregations.GetComplexValue("autocomplete");
132 | IEnumerable results = aggResult.Buckets.Select(t => t.Key.ToString());
133 | return results;
134 | }
135 |
136 | public PersonCitySearchResult Search(string term, int from)
137 | {
138 | var personCitySearchResult = new PersonCitySearchResult();
139 | var search = new Search
140 | {
141 | Size = 10,
142 | From = from,
143 | Query = new Query(new MatchQuery("searchfield", term))
144 | };
145 |
146 | var results = _context.Search(search);
147 |
148 | personCitySearchResult.PersonCities = results.PayloadResult.Hits.HitsResult.Select(t => t.Source);
149 | personCitySearchResult.Hits = results.PayloadResult.Hits.Total;
150 | personCitySearchResult.Took = results.PayloadResult.Took;
151 | return personCitySearchResult;
152 | }
153 |
154 | public bool GetStatus()
155 | {
156 | return _context.IndexExists();
157 | }
158 |
159 | ///
160 | /// Used for basic auto complete
161 | ///
162 | ///
163 | ///
164 | public IEnumerable QueryString(string term)
165 | {
166 | var results = _context.Search(BuildQueryStringSearch(term));
167 |
168 | return results.PayloadResult.Hits.HitsResult.Select(t => t.Source);
169 | }
170 |
171 | public void CreateTestData()
172 | {
173 | PersonCityData.CreateTestData();
174 |
175 | foreach (var item in PersonCityData.Data)
176 | {
177 | _context.AddUpdateDocument(item, item.Id);
178 | }
179 |
180 | _context.SaveChanges();
181 | }
182 |
183 | ///
184 | /// TODO protect against injection!
185 | ///
186 | ///
187 | ///
188 | private Search BuildQueryStringSearch(string term)
189 | {
190 | var names = "";
191 | if (term != null)
192 | {
193 | names = term.Replace("+", " OR *");
194 | }
195 |
196 | var search = new Search
197 | {
198 | Query = new Query(new QueryStringQuery(names + "*"))
199 | };
200 |
201 | return search;
202 | }
203 | }
204 | }
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/ElasticsearchProvider/PersonCitySearchResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace SearchComponent
5 | {
6 | public class PersonCitySearchResult
7 | {
8 | public IEnumerable PersonCities { get; set; }
9 |
10 | public long Hits { get; set; }
11 |
12 | public long Took { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/Program.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using Microsoft.AspNetCore.Hosting;
3 | using Microsoft.AspNetCore.Builder;
4 |
5 | namespace Angular2AutoCompleteAspNetCoreElasticsearch
6 | {
7 | public class Program
8 | {
9 | public static void Main(string[] args)
10 | {
11 | var host = new WebHostBuilder()
12 | .UseKestrel()
13 | .UseContentRoot(Directory.GetCurrentDirectory())
14 | .UseIISIntegration()
15 | .UseStartup()
16 | .Build();
17 |
18 | host.Run();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:5000/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "launchUrl": "index.html",
15 | "environmentVariables": {
16 | "ASPNETCORE_ENVIRONMENT": "Development"
17 | }
18 | },
19 | "Angular2WebpackVisualStudio": {
20 | "commandName": "Project",
21 | "launchBrowser": true,
22 | "launchUrl": "http://localhost:5000/",
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using Microsoft.AspNetCore.Builder;
4 | using Microsoft.AspNetCore.Http;
5 | using Microsoft.AspNetCore.Hosting;
6 | using Microsoft.Extensions.Configuration;
7 | using Microsoft.Extensions.DependencyInjection;
8 | using Microsoft.Extensions.Logging;
9 | using SearchComponent;
10 |
11 | namespace Angular2AutoCompleteAspNetCoreElasticsearch
12 | {
13 | public class Startup
14 | {
15 | public Startup(IHostingEnvironment env)
16 | {
17 | var builder = new ConfigurationBuilder()
18 | .SetBasePath(env.ContentRootPath)
19 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
20 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
21 | .AddEnvironmentVariables();
22 | Configuration = builder.Build();
23 | }
24 |
25 | public IConfigurationRoot Configuration { get; }
26 |
27 | // This method gets called by the runtime. Use this method to add services to the container.
28 | public void ConfigureServices(IServiceCollection services)
29 | {
30 | services.AddTransient();
31 |
32 | // Add framework services.
33 | services.AddMvc();
34 |
35 | }
36 |
37 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
38 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
39 | {
40 | loggerFactory.AddConsole(Configuration.GetSection("Logging"));
41 | loggerFactory.AddDebug();
42 |
43 | var angularRoutes = new[] {
44 | "/home"
45 | };
46 |
47 | app.Use(async (context, next) =>
48 | {
49 | if (context.Request.Path.HasValue && null != angularRoutes.FirstOrDefault(
50 | (ar) => context.Request.Path.Value.StartsWith(ar, StringComparison.OrdinalIgnoreCase)))
51 | {
52 | context.Request.Path = new PathString("/");
53 | }
54 |
55 | await next();
56 | });
57 |
58 | app.UseDefaultFiles();
59 |
60 | app.UseStaticFiles();
61 |
62 | app.UseMvc(routes =>
63 | {
64 | routes.MapRoute(
65 | name: "default",
66 | template: "{controller=Home}/{action=Index}/{id?}");
67 | });
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/AngularAutoCompleteAspNetCoreElasticsearch/angularApp/app/app.component.html:
--------------------------------------------------------------------------------
1 |