SlideShare une entreprise Scribd logo
1  sur  24
Why so serious?
   Cloud friendly database
   Based on Apache Lucene (Java)
   Linux only
   Document oriented
   Schema free – why bother?
   REST API
   JSON
_________
{
    "book": {
        "name": "PHP a XML",
        "ean": 9788024711164,
        "producer": "Grada",
        "price": 249,
        "author": {
            "name": "Jiří",
            "lastname": "Kosek"
        },
        "categories": [
            "XML",
            "PHP"
        ]
    }
}
$ curl –XPUT localhost:9200/amazon/book/978802471164 –d‘
{
     "book": {
         "name": "PHP a XML",
         "ean": 9788024711164,
         "producer": "Grada",
         "price": 249,
         "author": {
             "name": "Jiří",
             "lastname": "Kosek"
         },
         "categories": [
             "XML",
             "PHP"
         ]
     }
}‘
$ curl –XPUT localhost:9200/amazon/book/978802471164 –d‘
{
     "book": {
         "name": "PHP a XML",
         "ean": 9788024711164,
         "producer": "Grada",
         "price": 249,
         "author": {
             "name": "Jiří",
             "lastname": "Kosek"
         },
         "categories": [
             "XML",
             "PHP"
         ]
     }
}‘
$ curl –XPUT localhost:9200/amazon/book/978802471164 –d‘
{
     "book": {
         "name": "PHP a XML",
         "ean": 9788024711164,
         "producer": "Grada",
         "price": 249,
         "author": {
             "name": "Jiří",
             "lastname": "Kosek"
         },
         "categories": [
             "XML",
             "PHP"
         ]
     }
}‘
$ curl –XPUT localhost:9200/amazon/book/978802471164 –d‘
{
     "book": {
         "name": "PHP a XML",
         "ean": 9788024711164,
         "producer": "Grada",
         "price": 249,
         "author": {
             "name": "Jiří",
             "lastname": "Kosek"
         },
         "categories": [
             "XML",
             "PHP"
         ]
     }
}‘
$ curl –XGET
localhost:9200/amazon/book/9788024711
164
$ curl –XGET
localhost:9200/amazon/book/_search?q=
category:XML
$ curl –XGET
localhost:9200/amazon/book/_search?q=
category:XML
&from=10&size=10
$ curl –XGET
localhost:9200/amazon/book,page/
_search?q=category:XML
$ curl –XGET
localhost:9200/amazon/_search?q=
category:XML
{
    "took": 3,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "failed": 0
    },
    "hits": {
        "total": 119,
        "max_score": 0.23119758,
        "hits": [
            {
                "_index": "levneucebnice_fulltext4",
                "_type": "products",
                "_id": "64135",
                "_score": 0.23119758,
                "_source": {
                    "id": "64135",
                    "name": "Anatomie 1 - Třetí, upravené a doplněné
vydání",
   Specific searching
   Multiple conditions
{
    "match" : {
        "book.name" : "PHP a XML"
    }
}

WHERE name = "PHP a XML"
{
    "ids" : {
        "type" : "book",
        "values" : [
              9788024711164,
              9788024727257
         ]
    }
}

WHERE id IN(...)
{
    "prefix" : { "producer" : "gra" }
}

WHERE producer LIKE "gra%"
{
     "range":
         "price": {
              "from": 200,
              "to": 300
        }
    }
}

WHERE price BETWEEN 200 AND 300
+ = single character
* = mulitple characters


{
    "wildcard" : { "book.name" :
"P+P *" }
}
{
    "span_first" : {
        "match" : {
            "span_term" : { "name" : "PHP" }
        },
        "end" : 1
    }
}
   Combining conditions
   No default order
{
     "bool" : {
         "must" : {
             "term" : { "producer" : "grada" }
         },
         "must_not" : {
             "range" : {
                 "price" : { "from" : 100, "to" : 200 }
             }
         },
         "should" : [
             {
                 "term" : { "category" : "PHP" }
             },
             {
                 "term" : { "category" : "XML" }
             }
         ]
     }
}
{
    "query": {
        "bool": {
            "should": [
                {
                    "ids": {
                        "values": [
                             "64135"
                        ],
                        "boost": 1000000
                    }
                },
                {
                    "ids": {
                        "values": [
                             "60558"
                        ],
                        "boost": 999000
                    }
                },
   Sometimes too easy

   Many ways to hit the target

   Sometimes too complicated

   Sometimes unpredicted behaviour

   Difficult debugging

Contenu connexe

Tendances

"Powerful Analysis with the Aggregation Pipeline (Tutorial)"
"Powerful Analysis with the Aggregation Pipeline (Tutorial)""Powerful Analysis with the Aggregation Pipeline (Tutorial)"
"Powerful Analysis with the Aggregation Pipeline (Tutorial)"
MongoDB
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
Jeremy Kendall
 

Tendances (20)

ELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboardELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboard
 
Montreal Elasticsearch Meetup
Montreal Elasticsearch MeetupMontreal Elasticsearch Meetup
Montreal Elasticsearch Meetup
 
MongoDB .local Munich 2019: Aggregation Pipeline Power++: How MongoDB 4.2 Pip...
MongoDB .local Munich 2019: Aggregation Pipeline Power++: How MongoDB 4.2 Pip...MongoDB .local Munich 2019: Aggregation Pipeline Power++: How MongoDB 4.2 Pip...
MongoDB .local Munich 2019: Aggregation Pipeline Power++: How MongoDB 4.2 Pip...
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev Teams
 
Building a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and JavaBuilding a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and Java
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDB
 
Beyond the Basics 2: Aggregation Framework
Beyond the Basics 2: Aggregation Framework Beyond the Basics 2: Aggregation Framework
Beyond the Basics 2: Aggregation Framework
 
Inside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source DatabaseInside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source Database
 
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
Apache CouchDB Presentation @ Sept. 2104 GTALUG MeetingApache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
 
NoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBNoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDB
 
"Powerful Analysis with the Aggregation Pipeline (Tutorial)"
"Powerful Analysis with the Aggregation Pipeline (Tutorial)""Powerful Analysis with the Aggregation Pipeline (Tutorial)"
"Powerful Analysis with the Aggregation Pipeline (Tutorial)"
 
Real World CouchDB
Real World CouchDBReal World CouchDB
Real World CouchDB
 
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB Performance
 
An Introduction to JSON JavaScript Object Notation
An Introduction to JSON JavaScript Object NotationAn Introduction to JSON JavaScript Object Notation
An Introduction to JSON JavaScript Object Notation
 
Elastic search 검색
Elastic search 검색Elastic search 검색
Elastic search 검색
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web development
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
Php 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the GoodPhp 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the Good
 
Data Governance with JSON Schema
Data Governance with JSON SchemaData Governance with JSON Schema
Data Governance with JSON Schema
 

Similaire à Elasticsearch

The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
MongoDB
 
Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @Moldcamp
Alexei Gorobets
 

Similaire à Elasticsearch (20)

Elasticsearch in 15 Minutes
Elasticsearch in 15 MinutesElasticsearch in 15 Minutes
Elasticsearch in 15 Minutes
 
Example-driven Web API Specification Discovery
Example-driven Web API Specification DiscoveryExample-driven Web API Specification Discovery
Example-driven Web API Specification Discovery
 
Automatic discovery of Web API Specifications: an example-driven approach
Automatic discovery of Web API Specifications: an example-driven approachAutomatic discovery of Web API Specifications: an example-driven approach
Automatic discovery of Web API Specifications: an example-driven approach
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
elasticsearch - advanced features in practice
elasticsearch - advanced features in practiceelasticsearch - advanced features in practice
elasticsearch - advanced features in practice
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
AWS CloudFormation Session
AWS CloudFormation SessionAWS CloudFormation Session
AWS CloudFormation Session
 
Parallel SQL and Analytics with Solr: Presented by Yonik Seeley, Cloudera
Parallel SQL and Analytics with Solr: Presented by Yonik Seeley, ClouderaParallel SQL and Analytics with Solr: Presented by Yonik Seeley, Cloudera
Parallel SQL and Analytics with Solr: Presented by Yonik Seeley, Cloudera
 
Webinar: Strongly Typed Languages and Flexible Schemas
Webinar: Strongly Typed Languages and Flexible SchemasWebinar: Strongly Typed Languages and Flexible Schemas
Webinar: Strongly Typed Languages and Flexible Schemas
 
Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...
Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...
Liferay Search: Best Practices to Dramatically Improve Relevance - Liferay Sy...
 
Webinar: Data Processing and Aggregation Options
Webinar: Data Processing and Aggregation OptionsWebinar: Data Processing and Aggregation Options
Webinar: Data Processing and Aggregation Options
 
Aggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichAggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days Munich
 
d3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in Berlind3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in Berlin
 
Strongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible SchemasStrongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible Schemas
 
ElasticSearch at berlinbuzzwords 2010
ElasticSearch at berlinbuzzwords 2010ElasticSearch at berlinbuzzwords 2010
ElasticSearch at berlinbuzzwords 2010
 
Ams adapters
Ams adaptersAms adapters
Ams adapters
 
Introduction to GraphQL at API days
Introduction to GraphQL at API daysIntroduction to GraphQL at API days
Introduction to GraphQL at API days
 
Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @Moldcamp
 
Agile Testing Days 2018 - API Fundamentals - postman collection
Agile Testing Days 2018 - API Fundamentals - postman collectionAgile Testing Days 2018 - API Fundamentals - postman collection
Agile Testing Days 2018 - API Fundamentals - postman collection
 
SDKs, the good the bad the ugly - Japan
SDKs, the good the bad the ugly - JapanSDKs, the good the bad the ugly - Japan
SDKs, the good the bad the ugly - Japan
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Elasticsearch

  • 2. Cloud friendly database  Based on Apache Lucene (Java)  Linux only
  • 3. Document oriented  Schema free – why bother?  REST API  JSON
  • 4. _________ { "book": { "name": "PHP a XML", "ean": 9788024711164, "producer": "Grada", "price": 249, "author": { "name": "Jiří", "lastname": "Kosek" }, "categories": [ "XML", "PHP" ] } }
  • 5. $ curl –XPUT localhost:9200/amazon/book/978802471164 –d‘ { "book": { "name": "PHP a XML", "ean": 9788024711164, "producer": "Grada", "price": 249, "author": { "name": "Jiří", "lastname": "Kosek" }, "categories": [ "XML", "PHP" ] } }‘
  • 6. $ curl –XPUT localhost:9200/amazon/book/978802471164 –d‘ { "book": { "name": "PHP a XML", "ean": 9788024711164, "producer": "Grada", "price": 249, "author": { "name": "Jiří", "lastname": "Kosek" }, "categories": [ "XML", "PHP" ] } }‘
  • 7. $ curl –XPUT localhost:9200/amazon/book/978802471164 –d‘ { "book": { "name": "PHP a XML", "ean": 9788024711164, "producer": "Grada", "price": 249, "author": { "name": "Jiří", "lastname": "Kosek" }, "categories": [ "XML", "PHP" ] } }‘
  • 8. $ curl –XPUT localhost:9200/amazon/book/978802471164 –d‘ { "book": { "name": "PHP a XML", "ean": 9788024711164, "producer": "Grada", "price": 249, "author": { "name": "Jiří", "lastname": "Kosek" }, "categories": [ "XML", "PHP" ] } }‘
  • 14. { "took": 3, "timed_out": false, "_shards": { "total": 1, "successful": 1, "failed": 0 }, "hits": { "total": 119, "max_score": 0.23119758, "hits": [ { "_index": "levneucebnice_fulltext4", "_type": "products", "_id": "64135", "_score": 0.23119758, "_source": { "id": "64135", "name": "Anatomie 1 - Třetí, upravené a doplněné vydání",
  • 15. Specific searching  Multiple conditions
  • 16. { "match" : { "book.name" : "PHP a XML" } } WHERE name = "PHP a XML"
  • 17. { "ids" : { "type" : "book", "values" : [ 9788024711164, 9788024727257 ] } } WHERE id IN(...)
  • 18. { "prefix" : { "producer" : "gra" } } WHERE producer LIKE "gra%"
  • 19. { "range": "price": { "from": 200, "to": 300 } } } WHERE price BETWEEN 200 AND 300
  • 20. + = single character * = mulitple characters { "wildcard" : { "book.name" : "P+P *" } }
  • 21. { "span_first" : { "match" : { "span_term" : { "name" : "PHP" } }, "end" : 1 } }
  • 22. Combining conditions  No default order { "bool" : { "must" : { "term" : { "producer" : "grada" } }, "must_not" : { "range" : { "price" : { "from" : 100, "to" : 200 } } }, "should" : [ { "term" : { "category" : "PHP" } }, { "term" : { "category" : "XML" } } ] } }
  • 23. { "query": { "bool": { "should": [ { "ids": { "values": [ "64135" ], "boost": 1000000 } }, { "ids": { "values": [ "60558" ], "boost": 999000 } },
  • 24. Sometimes too easy  Many ways to hit the target  Sometimes too complicated  Sometimes unpredicted behaviour  Difficult debugging