SlideShare a Scribd company logo
AngularJS + Asp.Net Web Api,
Signalr, EF6, Redis +
Elasticsearch:前後端整合篇
開發技巧實戰系列(6/6) - Web 前後端整合
講師: 郭二文 (erhwenkuo@gmail.com)
Document, Source code & Training
Video (6/6)
• https://github.com/erhwenkuo/PracticalCoding
Previous Training Session Document,
Source code & Training Video (5/6)
• https://www.youtube.com/watch?v=
Xfu4EVBdBKo
• http://www.slideshare.net/erhwenku
o/05-integrate-redis
Agenda
• Elasticsearch Introduction
• Elasticsearch Workshop
• Elasticsearch in action using Stackoverflow Datadump
• Developing Angularjs with Elasticsearch
• Highchart , AngularJS ,Web API2 , SignalR2 , EF6 , Redis +
Elasticsearch Integration
Elasticsearch Introduction
Elasticsearch Website
Http://www.elasticsearch.com/
Who’s using elasticsearch?
• GitHub
• GitHub uses Elasticsearch’s robust sharding and
advanced queries to serve up search across data in 4
million users’ code repositories.
• GitHub uses Elasticsearch’s routing parameter and
flexible sharding schemes to perform searches within
a single repository on a single shard, doubling the
speed at which results are served.
• GitHub uses Elasticsearch’s histogram facet
queries, as well as other Elasticsearch analytic
queries, to monitor their internal infrastructure
for abuse, bugs and more.
Who’s using elasticsearch?
• Wikipedia
• Elasticsearch’s reference manual and contribution
documentation promised an easy start and pleasant
time getting changes upstream when needed to.
• Elasticsearch’s super expressive search API lets
Wikimedia search any way needed and gives the
company confidence that it can be expanded,
including via expressive ad-hoc queries.
• Elasticsearch’s index maintenance API lets Wikimedia
maintain the index right from its MediaWiki extension
Who’s using elasticsearch?
• 3 machines doing search with
ElasticSearch
• stackoverflow
ElasticWho?
• ElasticSearch is a flexible and powerful open source, distributed real-time
search and analytics engine
• Features:
• Real time analytics
• Distributed
• High availability
• Multi tenant architecture
• Full text index
• Document oriented
• Schema free
• RESTful API
• Per-operation persistence
Elasticsearch Workshop
Download & Start
• Download Elasticsearch (Current version: 1.4.2)
• http://www.elasticsearch.com/downloads
• Unzip & Modify “elasticsearch.yml”
• “cluster.name: {your_searchcluster_name}”
• “node.name: {your_cluster_node_name}”
• “http.cors.enabled: true”
• Use command console to run:
• “bin/elasticsearch” on *nix
• “bin/elasticsearch.bat” on Windows
1
2
3
Install Elasticsearch Plugins
(elasticsearch-head)
• A web front end for an Elasticsearch cluster
• https://github.com/mobz/elasticsearch-head
You need to have
internet access,
otherwise it would
fail!!
1
Restart elasticsearch and key in below url
in browser:
http://localhost:9200/_plugin/head/
2
RESTful interface
• Elasticsearch default use port “9200” for Http Restful interface
• Let’s check if Elasticsearch is alive!!
Elasticsearch TERMs
Create Index
• Elasticsearch “Index” is similar like “Database” in relational DB
• For example, create a index named “stackoverflow”
Default setting in
Elasticsearch:
Each “Index” will split to
5shards and has 1
replication
Create Another Elasticsearch Node
• Copy “elasticsearch-1.4.2” folder to “elasticsearch-1.4.2-Node2”
• Modify “elasticsearch-1.4.2-Node2/config/elasticsearch.yml”
• “cluster.name: {your_searchcluster_name}”
• “node.name: {your_cluster_node_name-Node2}”
• “http.cors.enabled: true”
• “transport.tcp.port: 9301”
• “http.port: 9201”
If we set different
Elasticsearch Node on the
sameMachine, then we
need to assisgn different
communication ports.
Start All Elasticsearch Nodes
• Use command console to start two Elasticsearch Nodes
Now we a Elasticsearch
Cluster!
So so so easy~!
Delete Index
The Index is deleted!!
Index a “Document” under a specific
“Type”
“Type” is similar to
“Table” in RelationDB
“Document.Id” is the
unique Id to identify each
document
The content of a
“Document”
Index a “Document”
Unber “Browser”
tab, we can search
document
Get a “Document”
“Type” is similar to
“Table” in RelationDB
“Document.Id” is the
unique Id to identify each
document
The content of a
“Document” return by
Elasticsearch
Update a “Document”
“Type” is similar to
“Table” in RelationDB
“Document.Id” is the
unique Id to identify each
document
The “version no.” of
document is incremental if
it got updated!!
Searching “Document”
Control Searching
Scope base on
URL
Elasticsearch has very rich Search/Query DSL for
document searching. Check below URL for details:
http://www.elasticsearch.org/guide/en/elastic
search/reference/current/query-dsl.html
Searching Result
The documents which hits the
searching query will be located
under “hits/hits”
How long it takes to
calculate the result
(in milli-
seconds)
Delete a “Document”
“Type” is similar to
“Table” in RelationDB
“Document.Id” is the
unique Id to identify each
document
Elasticsearch in action
using Stackoverflow
Datadump
Environment Setup – Elasticsearch C#
Client
1. Use NuGet to search “NEST” (C# elasticsearch client)
2. Click “Install”
NEST (Elasticsearch C# client)
• NEST provides very friendly C# interfaces to interact with Elasticseach, also
there are many sample codes in its web site
• http://nest.azurewebsites.net/
Stackoverflow Datadump
• Stackoverflow periodically dump their data for public study use
• https://archive.org/details/stackexchange
• For demonstration purpose, we pick a smaller dataset
• apple.stackexchange.com.7z (73.7MB)
• Badges.xml
• Commenets.xml
• PostHistory.xml
• PostLinks.xml
• Posts.xml (116,071 records)
• Tags.xml
• Users.xml
• Votes.xml
Session_06_DataloadToElasticsearch
• A new C# “Console” program project
(“Session_06_DataloadToElasticsearch”) is
created to parsing data dump xml file and
import into Elasticsarch
• Open “Program.cs” file and modify below:
Change the Uri of
your elasticsearch
cluster IP & port
Change the
xmlDataFile path
to the location of
data dump file
This is the
“Index” need to
be created before
running this
program
Execute “Session_06_DataloadToElasticsearch”
”Program.cs”
1
2
3
It spends 67
seconds to index
116071 records
Exploer Data via “Brower”
The _search endpoing
• To search with ElasticSearch we use the “_search” endpoint
• We make http requests to an URL following this pattern: (“index” &
“type” are both optional)
• <index>/<type>/_search
• For example:
• Search across all indexes and all types
• http://localhost:9200/_search
• Search across all types in the “stackoverflow” index
• http://localhost:9200/stackoverflow/_search
• Search explicitly for documents of type “post” within the
“stackoverflow” index
• http://localhost:9200/stackoverflow/post/_search
Search request body and ElasticSearch's
query DSL
• elasticsearch provides a full Query DSL based on JSON to define queries
• http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html
• Think of it like ElasticSearch's equivalent of SQL for a relational database
• Query DSL contains:
• Query
• Filter
*** Filter are very handy since they perform an order of magnitude better than plain
query since no scoring is performed and they are automatically cached
Basic free text search
• The query DSL features a long list of different
types of queries that we can use
• For "ordinary" free text search we'll most likely
want to use one called "query string query".
Elasticsearch Query DSL - Filter
• As a general rule, filters should be
used instead of queryies:
• for binary yes/no searches
• for queries on exact values
• Filters can be caching. Caching the
result of a filter does not require a lot
of memory, and will cause other
queries executing against the same
filter (same parameters) to be
blazingly fast
Filter without Query
Developing Angularjs with
Elasticsearch
Elasticsearch Javascript Client
Library
1. Go to Elasticsearch web site & get javascript
client
• elasticsearch-js-2.4.3.zip
• http://www.elasticsearch.org/guide/en/elasticsearc
h/client/javascript-api/current/browser-builds.html
• Unzip and import to “PracticalCoding.Web”
Project under “/Scripts/elasticsearch” folder
Setup Fulltext-Search SPA Skelton
1. Create “11_AngularWithElasticsearch” folder under “MyApp”
2. Create files and subfolder according to the diagram
index.html
“angular-sanitize.js”
is used to handle “html
content” showing on UI
“ui-bootstrap-tpls-
.js” is used to show &
control “pagination”
“elasticsearch.angul
ar.js” is used to connect
Elasticsearch & submit
query command
factories.js
define our elasticsearch
cluster host IPs
use “esFactory” to
connect elasticsearch
clusters
app.js
define our routing, UI
template & controller
fulltext-search.html (1)
fulltext-search.html (2)
fulltext-search.html (2)
controllers.js
Fulltext-Search Demo
1. Select “11_AngularWithElasticsearch/index.html” and Hit “F5” to run
Demo Page
Highchart , AngularJS
,Web API2 , SignalR2,
Redis + Elasticsearch
Integration
Integration with Entity Framework
• Copy “10_IntegrationWithRedis ” to
“12_IntegrationWithElasticsearch ”
Create New
ElasticDashboardRepo.cs
Control Unique ID
generation and
management via Redis
Switch “RedisDashboardRepo” to
“ElasticsearchDashboardRepo”
• Copy “RedisDashboardController.cs” to “ElasticsearchDashboardController.cs”
Switch our Repository
from “Redis” to
“Elasticsearch”
Modify Our Angular “ChartDataFactory”
• Switch angular $http communication end point to our new WebAPI url
Before After
Integration with Elasticsearch
1. Select “12_IntegrationWithElasticsearch/index.html” and Hit “F5” to run
2. Open Multi-Browser to see charts reflect changes whenever C/U/D
operations occurred
Demo

More Related Content

What's hot

The Spring Update
The Spring UpdateThe Spring Update
The Spring Update
Gunnar Hillert
 
Powershell For Developers
Powershell For DevelopersPowershell For Developers
Powershell For Developers
Ido Flatow
 
Ajug - The Spring Update
Ajug - The Spring UpdateAjug - The Spring Update
Ajug - The Spring Update
Gunnar Hillert
 
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff NorrisRESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
mfrancis
 
Spring Projects Infrastructure
Spring Projects InfrastructureSpring Projects Infrastructure
Spring Projects Infrastructure
Gunnar Hillert
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Matthew Groves
 
Spring Batch Performance Tuning
Spring Batch Performance TuningSpring Batch Performance Tuning
Spring Batch Performance Tuning
Gunnar Hillert
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.jsAyush Mishra
 
Apache spark with akka couchbase code by bhawani
Apache spark with akka couchbase code by bhawaniApache spark with akka couchbase code by bhawani
Apache spark with akka couchbase code by bhawani
Bhawani N Prasad
 
S2GX 2012 - Spring Projects Infrastructure
S2GX 2012 - Spring Projects InfrastructureS2GX 2012 - Spring Projects Infrastructure
S2GX 2012 - Spring Projects Infrastructure
Gunnar Hillert
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internals
carlo-rtr
 
Iac d.damyanov 4.pptx
Iac d.damyanov 4.pptxIac d.damyanov 4.pptx
Iac d.damyanov 4.pptx
Dimitar Damyanov
 
Don't Wait! Develop Responsive Applications with Java EE7 Instead
Don't Wait! Develop Responsive Applications with Java EE7 InsteadDon't Wait! Develop Responsive Applications with Java EE7 Instead
Don't Wait! Develop Responsive Applications with Java EE7 Instead
WASdev Community
 
Building a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to SpaceBuilding a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to Space
Maarten Balliauw
 
Prototyping applications with heroku and elasticsearch
 Prototyping applications with heroku and elasticsearch Prototyping applications with heroku and elasticsearch
Prototyping applications with heroku and elasticsearch
protofy
 
Firebase slide
Firebase slideFirebase slide
Firebase slide
Apaichon Punopas
 
Grails Plugin Best Practices
Grails Plugin Best PracticesGrails Plugin Best Practices
Grails Plugin Best Practices
Burt Beckwith
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)
Michael Collier
 
Esri Dev Summit 2009 Rest and Mvc Final
Esri Dev Summit 2009 Rest and Mvc FinalEsri Dev Summit 2009 Rest and Mvc Final
Esri Dev Summit 2009 Rest and Mvc Final
guestcd4688
 

What's hot (20)

The Spring Update
The Spring UpdateThe Spring Update
The Spring Update
 
Powershell For Developers
Powershell For DevelopersPowershell For Developers
Powershell For Developers
 
Ajug - The Spring Update
Ajug - The Spring UpdateAjug - The Spring Update
Ajug - The Spring Update
 
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff NorrisRESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
 
Spring Projects Infrastructure
Spring Projects InfrastructureSpring Projects Infrastructure
Spring Projects Infrastructure
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
Spring Batch Performance Tuning
Spring Batch Performance TuningSpring Batch Performance Tuning
Spring Batch Performance Tuning
 
Mule 2.2.1-users-guide
Mule 2.2.1-users-guideMule 2.2.1-users-guide
Mule 2.2.1-users-guide
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.js
 
Apache spark with akka couchbase code by bhawani
Apache spark with akka couchbase code by bhawaniApache spark with akka couchbase code by bhawani
Apache spark with akka couchbase code by bhawani
 
S2GX 2012 - Spring Projects Infrastructure
S2GX 2012 - Spring Projects InfrastructureS2GX 2012 - Spring Projects Infrastructure
S2GX 2012 - Spring Projects Infrastructure
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internals
 
Iac d.damyanov 4.pptx
Iac d.damyanov 4.pptxIac d.damyanov 4.pptx
Iac d.damyanov 4.pptx
 
Don't Wait! Develop Responsive Applications with Java EE7 Instead
Don't Wait! Develop Responsive Applications with Java EE7 InsteadDon't Wait! Develop Responsive Applications with Java EE7 Instead
Don't Wait! Develop Responsive Applications with Java EE7 Instead
 
Building a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to SpaceBuilding a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to Space
 
Prototyping applications with heroku and elasticsearch
 Prototyping applications with heroku and elasticsearch Prototyping applications with heroku and elasticsearch
Prototyping applications with heroku and elasticsearch
 
Firebase slide
Firebase slideFirebase slide
Firebase slide
 
Grails Plugin Best Practices
Grails Plugin Best PracticesGrails Plugin Best Practices
Grails Plugin Best Practices
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)
 
Esri Dev Summit 2009 Rest and Mvc Final
Esri Dev Summit 2009 Rest and Mvc FinalEsri Dev Summit 2009 Rest and Mvc Final
Esri Dev Summit 2009 Rest and Mvc Final
 

Similar to 06 integrate elasticsearch

Elasticsearch Introduction
Elasticsearch IntroductionElasticsearch Introduction
Elasticsearch Introduction
Roopendra Vishwakarma
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
Taylor Lovett
 
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Oleksiy Panchenko
 
Getting started with Laravel & Elasticsearch
Getting started with Laravel & ElasticsearchGetting started with Laravel & Elasticsearch
Getting started with Laravel & Elasticsearch
Peter Steenbergen
 
Using ElasticSearch as a fast, flexible, and scalable solution to search occu...
Using ElasticSearch as a fast, flexible, and scalable solution to search occu...Using ElasticSearch as a fast, flexible, and scalable solution to search occu...
Using ElasticSearch as a fast, flexible, and scalable solution to search occu...
kristgen
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUlrich Krause
 
Scaling Django Apps using AWS Elastic Beanstalk
Scaling Django Apps using AWS Elastic BeanstalkScaling Django Apps using AWS Elastic Beanstalk
Scaling Django Apps using AWS Elastic Beanstalk
Lushen Wu
 
[2 d1] elasticsearch 성능 최적화
[2 d1] elasticsearch 성능 최적화[2 d1] elasticsearch 성능 최적화
[2 d1] elasticsearch 성능 최적화
Henry Jeong
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화
NAVER D2
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
Prajal Kulkarni
 
Elastic Stack Introduction
Elastic Stack IntroductionElastic Stack Introduction
Elastic Stack Introduction
Vikram Shinde
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web Performance
Adam Norwood
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
Ulrich Krause
 
Apache Lucene intro - Breizhcamp 2015
Apache Lucene intro - Breizhcamp 2015Apache Lucene intro - Breizhcamp 2015
Apache Lucene intro - Breizhcamp 2015
Adrien Grand
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearch
Anton Udovychenko
 
10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster
Brij Mishra
 
Play framework productivity formula
Play framework   productivity formula Play framework   productivity formula
Play framework productivity formula
Sorin Chiprian
 
CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009
Jason Davies
 
Accelerating Rails with edge caching
Accelerating Rails with edge cachingAccelerating Rails with edge caching
Accelerating Rails with edge caching
Michael May
 

Similar to 06 integrate elasticsearch (20)

Elasticsearch Introduction
Elasticsearch IntroductionElasticsearch Introduction
Elasticsearch Introduction
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
 
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
 
Getting started with Laravel & Elasticsearch
Getting started with Laravel & ElasticsearchGetting started with Laravel & Elasticsearch
Getting started with Laravel & Elasticsearch
 
Using ElasticSearch as a fast, flexible, and scalable solution to search occu...
Using ElasticSearch as a fast, flexible, and scalable solution to search occu...Using ElasticSearch as a fast, flexible, and scalable solution to search occu...
Using ElasticSearch as a fast, flexible, and scalable solution to search occu...
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 
Scaling Django Apps using AWS Elastic Beanstalk
Scaling Django Apps using AWS Elastic BeanstalkScaling Django Apps using AWS Elastic Beanstalk
Scaling Django Apps using AWS Elastic Beanstalk
 
[2 d1] elasticsearch 성능 최적화
[2 d1] elasticsearch 성능 최적화[2 d1] elasticsearch 성능 최적화
[2 d1] elasticsearch 성능 최적화
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
Elastic Stack Introduction
Elastic Stack IntroductionElastic Stack Introduction
Elastic Stack Introduction
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web Performance
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Apache Lucene intro - Breizhcamp 2015
Apache Lucene intro - Breizhcamp 2015Apache Lucene intro - Breizhcamp 2015
Apache Lucene intro - Breizhcamp 2015
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearch
 
10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster
 
Play framework productivity formula
Play framework   productivity formula Play framework   productivity formula
Play framework productivity formula
 
CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009
 
Accelerating Rails with edge caching
Accelerating Rails with edge cachingAccelerating Rails with edge caching
Accelerating Rails with edge caching
 

More from Erhwen Kuo

Datacon 2019-ksql-kubernetes-prometheus
Datacon 2019-ksql-kubernetes-prometheusDatacon 2019-ksql-kubernetes-prometheus
Datacon 2019-ksql-kubernetes-prometheus
Erhwen Kuo
 
Cncf k8s Ingress Example-03
Cncf k8s Ingress Example-03Cncf k8s Ingress Example-03
Cncf k8s Ingress Example-03
Erhwen Kuo
 
Cncf k8s Ingress Example-02
Cncf k8s Ingress Example-02Cncf k8s Ingress Example-02
Cncf k8s Ingress Example-02
Erhwen Kuo
 
Cncf k8s Ingress Example-01
Cncf k8s Ingress Example-01Cncf k8s Ingress Example-01
Cncf k8s Ingress Example-01
Erhwen Kuo
 
Cncf k8s_network_03 (Ingress introduction)
Cncf k8s_network_03 (Ingress introduction)Cncf k8s_network_03 (Ingress introduction)
Cncf k8s_network_03 (Ingress introduction)
Erhwen Kuo
 
Cncf k8s_network_02
Cncf k8s_network_02Cncf k8s_network_02
Cncf k8s_network_02
Erhwen Kuo
 
Cncf k8s_network_part1
Cncf k8s_network_part1Cncf k8s_network_part1
Cncf k8s_network_part1
Erhwen Kuo
 
Cncf explore k8s_api_go
Cncf explore k8s_api_goCncf explore k8s_api_go
Cncf explore k8s_api_go
Erhwen Kuo
 
CNCF explore k8s api using java client
CNCF explore k8s api using java clientCNCF explore k8s api using java client
CNCF explore k8s api using java client
Erhwen Kuo
 
CNCF explore k8s_api
CNCF explore k8s_apiCNCF explore k8s_api
CNCF explore k8s_api
Erhwen Kuo
 
Cncf Istio introduction
Cncf Istio introductionCncf Istio introduction
Cncf Istio introduction
Erhwen Kuo
 
TDEA 2018 Kafka EOS (Exactly-once)
TDEA 2018 Kafka EOS (Exactly-once)TDEA 2018 Kafka EOS (Exactly-once)
TDEA 2018 Kafka EOS (Exactly-once)
Erhwen Kuo
 
啟動你的AI工匠魂
啟動你的AI工匠魂啟動你的AI工匠魂
啟動你的AI工匠魂
Erhwen Kuo
 
Realtime analytics with Flink and Druid
Realtime analytics with Flink and DruidRealtime analytics with Flink and Druid
Realtime analytics with Flink and Druid
Erhwen Kuo
 
Spark手把手:[e2-spk-s03]
Spark手把手:[e2-spk-s03]Spark手把手:[e2-spk-s03]
Spark手把手:[e2-spk-s03]
Erhwen Kuo
 
Spark手把手:[e2-spk-s02]
Spark手把手:[e2-spk-s02]Spark手把手:[e2-spk-s02]
Spark手把手:[e2-spk-s02]
Erhwen Kuo
 
Spark手把手:[e2-spk-s01]
Spark手把手:[e2-spk-s01]Spark手把手:[e2-spk-s01]
Spark手把手:[e2-spk-s01]
Erhwen Kuo
 

More from Erhwen Kuo (17)

Datacon 2019-ksql-kubernetes-prometheus
Datacon 2019-ksql-kubernetes-prometheusDatacon 2019-ksql-kubernetes-prometheus
Datacon 2019-ksql-kubernetes-prometheus
 
Cncf k8s Ingress Example-03
Cncf k8s Ingress Example-03Cncf k8s Ingress Example-03
Cncf k8s Ingress Example-03
 
Cncf k8s Ingress Example-02
Cncf k8s Ingress Example-02Cncf k8s Ingress Example-02
Cncf k8s Ingress Example-02
 
Cncf k8s Ingress Example-01
Cncf k8s Ingress Example-01Cncf k8s Ingress Example-01
Cncf k8s Ingress Example-01
 
Cncf k8s_network_03 (Ingress introduction)
Cncf k8s_network_03 (Ingress introduction)Cncf k8s_network_03 (Ingress introduction)
Cncf k8s_network_03 (Ingress introduction)
 
Cncf k8s_network_02
Cncf k8s_network_02Cncf k8s_network_02
Cncf k8s_network_02
 
Cncf k8s_network_part1
Cncf k8s_network_part1Cncf k8s_network_part1
Cncf k8s_network_part1
 
Cncf explore k8s_api_go
Cncf explore k8s_api_goCncf explore k8s_api_go
Cncf explore k8s_api_go
 
CNCF explore k8s api using java client
CNCF explore k8s api using java clientCNCF explore k8s api using java client
CNCF explore k8s api using java client
 
CNCF explore k8s_api
CNCF explore k8s_apiCNCF explore k8s_api
CNCF explore k8s_api
 
Cncf Istio introduction
Cncf Istio introductionCncf Istio introduction
Cncf Istio introduction
 
TDEA 2018 Kafka EOS (Exactly-once)
TDEA 2018 Kafka EOS (Exactly-once)TDEA 2018 Kafka EOS (Exactly-once)
TDEA 2018 Kafka EOS (Exactly-once)
 
啟動你的AI工匠魂
啟動你的AI工匠魂啟動你的AI工匠魂
啟動你的AI工匠魂
 
Realtime analytics with Flink and Druid
Realtime analytics with Flink and DruidRealtime analytics with Flink and Druid
Realtime analytics with Flink and Druid
 
Spark手把手:[e2-spk-s03]
Spark手把手:[e2-spk-s03]Spark手把手:[e2-spk-s03]
Spark手把手:[e2-spk-s03]
 
Spark手把手:[e2-spk-s02]
Spark手把手:[e2-spk-s02]Spark手把手:[e2-spk-s02]
Spark手把手:[e2-spk-s02]
 
Spark手把手:[e2-spk-s01]
Spark手把手:[e2-spk-s01]Spark手把手:[e2-spk-s01]
Spark手把手:[e2-spk-s01]
 

Recently uploaded

June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 

Recently uploaded (20)

June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 

06 integrate elasticsearch

  • 1. AngularJS + Asp.Net Web Api, Signalr, EF6, Redis + Elasticsearch:前後端整合篇 開發技巧實戰系列(6/6) - Web 前後端整合 講師: 郭二文 (erhwenkuo@gmail.com)
  • 2. Document, Source code & Training Video (6/6) • https://github.com/erhwenkuo/PracticalCoding
  • 3. Previous Training Session Document, Source code & Training Video (5/6) • https://www.youtube.com/watch?v= Xfu4EVBdBKo • http://www.slideshare.net/erhwenku o/05-integrate-redis
  • 4. Agenda • Elasticsearch Introduction • Elasticsearch Workshop • Elasticsearch in action using Stackoverflow Datadump • Developing Angularjs with Elasticsearch • Highchart , AngularJS ,Web API2 , SignalR2 , EF6 , Redis + Elasticsearch Integration
  • 7. Who’s using elasticsearch? • GitHub • GitHub uses Elasticsearch’s robust sharding and advanced queries to serve up search across data in 4 million users’ code repositories. • GitHub uses Elasticsearch’s routing parameter and flexible sharding schemes to perform searches within a single repository on a single shard, doubling the speed at which results are served. • GitHub uses Elasticsearch’s histogram facet queries, as well as other Elasticsearch analytic queries, to monitor their internal infrastructure for abuse, bugs and more.
  • 8. Who’s using elasticsearch? • Wikipedia • Elasticsearch’s reference manual and contribution documentation promised an easy start and pleasant time getting changes upstream when needed to. • Elasticsearch’s super expressive search API lets Wikimedia search any way needed and gives the company confidence that it can be expanded, including via expressive ad-hoc queries. • Elasticsearch’s index maintenance API lets Wikimedia maintain the index right from its MediaWiki extension
  • 9. Who’s using elasticsearch? • 3 machines doing search with ElasticSearch • stackoverflow
  • 10. ElasticWho? • ElasticSearch is a flexible and powerful open source, distributed real-time search and analytics engine • Features: • Real time analytics • Distributed • High availability • Multi tenant architecture • Full text index • Document oriented • Schema free • RESTful API • Per-operation persistence
  • 12. Download & Start • Download Elasticsearch (Current version: 1.4.2) • http://www.elasticsearch.com/downloads • Unzip & Modify “elasticsearch.yml” • “cluster.name: {your_searchcluster_name}” • “node.name: {your_cluster_node_name}” • “http.cors.enabled: true” • Use command console to run: • “bin/elasticsearch” on *nix • “bin/elasticsearch.bat” on Windows 1 2 3
  • 13. Install Elasticsearch Plugins (elasticsearch-head) • A web front end for an Elasticsearch cluster • https://github.com/mobz/elasticsearch-head You need to have internet access, otherwise it would fail!! 1 Restart elasticsearch and key in below url in browser: http://localhost:9200/_plugin/head/ 2
  • 14. RESTful interface • Elasticsearch default use port “9200” for Http Restful interface • Let’s check if Elasticsearch is alive!!
  • 16. Create Index • Elasticsearch “Index” is similar like “Database” in relational DB • For example, create a index named “stackoverflow” Default setting in Elasticsearch: Each “Index” will split to 5shards and has 1 replication
  • 17. Create Another Elasticsearch Node • Copy “elasticsearch-1.4.2” folder to “elasticsearch-1.4.2-Node2” • Modify “elasticsearch-1.4.2-Node2/config/elasticsearch.yml” • “cluster.name: {your_searchcluster_name}” • “node.name: {your_cluster_node_name-Node2}” • “http.cors.enabled: true” • “transport.tcp.port: 9301” • “http.port: 9201” If we set different Elasticsearch Node on the sameMachine, then we need to assisgn different communication ports.
  • 18. Start All Elasticsearch Nodes • Use command console to start two Elasticsearch Nodes Now we a Elasticsearch Cluster! So so so easy~!
  • 19. Delete Index The Index is deleted!!
  • 20. Index a “Document” under a specific “Type” “Type” is similar to “Table” in RelationDB “Document.Id” is the unique Id to identify each document The content of a “Document”
  • 21. Index a “Document” Unber “Browser” tab, we can search document
  • 22. Get a “Document” “Type” is similar to “Table” in RelationDB “Document.Id” is the unique Id to identify each document The content of a “Document” return by Elasticsearch
  • 23. Update a “Document” “Type” is similar to “Table” in RelationDB “Document.Id” is the unique Id to identify each document The “version no.” of document is incremental if it got updated!!
  • 24. Searching “Document” Control Searching Scope base on URL Elasticsearch has very rich Search/Query DSL for document searching. Check below URL for details: http://www.elasticsearch.org/guide/en/elastic search/reference/current/query-dsl.html
  • 25. Searching Result The documents which hits the searching query will be located under “hits/hits” How long it takes to calculate the result (in milli- seconds)
  • 26. Delete a “Document” “Type” is similar to “Table” in RelationDB “Document.Id” is the unique Id to identify each document
  • 27. Elasticsearch in action using Stackoverflow Datadump
  • 28. Environment Setup – Elasticsearch C# Client 1. Use NuGet to search “NEST” (C# elasticsearch client) 2. Click “Install”
  • 29. NEST (Elasticsearch C# client) • NEST provides very friendly C# interfaces to interact with Elasticseach, also there are many sample codes in its web site • http://nest.azurewebsites.net/
  • 30. Stackoverflow Datadump • Stackoverflow periodically dump their data for public study use • https://archive.org/details/stackexchange • For demonstration purpose, we pick a smaller dataset • apple.stackexchange.com.7z (73.7MB) • Badges.xml • Commenets.xml • PostHistory.xml • PostLinks.xml • Posts.xml (116,071 records) • Tags.xml • Users.xml • Votes.xml
  • 31. Session_06_DataloadToElasticsearch • A new C# “Console” program project (“Session_06_DataloadToElasticsearch”) is created to parsing data dump xml file and import into Elasticsarch • Open “Program.cs” file and modify below: Change the Uri of your elasticsearch cluster IP & port Change the xmlDataFile path to the location of data dump file This is the “Index” need to be created before running this program
  • 33. Exploer Data via “Brower”
  • 34. The _search endpoing • To search with ElasticSearch we use the “_search” endpoint • We make http requests to an URL following this pattern: (“index” & “type” are both optional) • <index>/<type>/_search • For example: • Search across all indexes and all types • http://localhost:9200/_search • Search across all types in the “stackoverflow” index • http://localhost:9200/stackoverflow/_search • Search explicitly for documents of type “post” within the “stackoverflow” index • http://localhost:9200/stackoverflow/post/_search
  • 35. Search request body and ElasticSearch's query DSL • elasticsearch provides a full Query DSL based on JSON to define queries • http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html • Think of it like ElasticSearch's equivalent of SQL for a relational database • Query DSL contains: • Query • Filter *** Filter are very handy since they perform an order of magnitude better than plain query since no scoring is performed and they are automatically cached
  • 36. Basic free text search • The query DSL features a long list of different types of queries that we can use • For "ordinary" free text search we'll most likely want to use one called "query string query".
  • 37. Elasticsearch Query DSL - Filter • As a general rule, filters should be used instead of queryies: • for binary yes/no searches • for queries on exact values • Filters can be caching. Caching the result of a filter does not require a lot of memory, and will cause other queries executing against the same filter (same parameters) to be blazingly fast
  • 40. Elasticsearch Javascript Client Library 1. Go to Elasticsearch web site & get javascript client • elasticsearch-js-2.4.3.zip • http://www.elasticsearch.org/guide/en/elasticsearc h/client/javascript-api/current/browser-builds.html • Unzip and import to “PracticalCoding.Web” Project under “/Scripts/elasticsearch” folder
  • 41. Setup Fulltext-Search SPA Skelton 1. Create “11_AngularWithElasticsearch” folder under “MyApp” 2. Create files and subfolder according to the diagram
  • 42. index.html “angular-sanitize.js” is used to handle “html content” showing on UI “ui-bootstrap-tpls- .js” is used to show & control “pagination” “elasticsearch.angul ar.js” is used to connect Elasticsearch & submit query command
  • 43. factories.js define our elasticsearch cluster host IPs use “esFactory” to connect elasticsearch clusters
  • 44. app.js define our routing, UI template & controller
  • 49. Fulltext-Search Demo 1. Select “11_AngularWithElasticsearch/index.html” and Hit “F5” to run Demo Page
  • 50. Highchart , AngularJS ,Web API2 , SignalR2, Redis + Elasticsearch Integration
  • 51. Integration with Entity Framework • Copy “10_IntegrationWithRedis ” to “12_IntegrationWithElasticsearch ”
  • 52. Create New ElasticDashboardRepo.cs Control Unique ID generation and management via Redis
  • 53. Switch “RedisDashboardRepo” to “ElasticsearchDashboardRepo” • Copy “RedisDashboardController.cs” to “ElasticsearchDashboardController.cs” Switch our Repository from “Redis” to “Elasticsearch”
  • 54. Modify Our Angular “ChartDataFactory” • Switch angular $http communication end point to our new WebAPI url Before After
  • 55. Integration with Elasticsearch 1. Select “12_IntegrationWithElasticsearch/index.html” and Hit “F5” to run 2. Open Multi-Browser to see charts reflect changes whenever C/U/D operations occurred Demo

Editor's Notes

  1. 開發技巧實戰 1. AngularJS入門篇 2. AngularJS + HighChart:完美網頁圖表整合篇 3. AngularJS + Asp.Net WebApi 2 +SignalR:前後端整合篇 4. AngularJS + Asp.Net WebApi 2+ SignalR + Entity Framework 6 (ORM):前後端整合篇 5. AngularJS + Asp.Net WebApi 2+ SignalR +Entity Framework 6 (ORM) + Redis (Nosql):前後端整合篇 6. AngularJS + Asp.Net WebApi 2+ SignalR +Entity Framework 6 (ORM) + Redis (Nosql) + Elasticsearch (全文檢索):前後端整合篇
  2. 本章節的內容會延續前一個Session的知識與內容, 如果對前一章節不熟悉的話, 可以在Yoube或Slideshare找到文件與教學錄影
  3. Hightchart是位處於北歐挪威的一家小公司Highsoft AS所開發. 在2014年, 這家公司只有14名員工, 其中8位是工程師. 下載Hightcharts, 再把它的的javascripts全部都include到專案中