SlideShare a Scribd company logo
1 of 34
Laravel and SOLR
How to build a powerful search combination
- Peter Steenbergen
Who am I?
What I am about to cover
• The meaning of the term powerful
• MySQL Drawbacks
• Why SOLR
• Usage of tools
• Setting up / starting with SOLR Server
• Starting with SOLR
• Integrate SOLR with Laravel
• Laravel and SOLR Searching
What I do NOT cover
• Front-End implementation
• No Angular, VueJS or React integration (recommend VueJS though)
• Authentication
• Internals of SOLR / Elasticsearch
• Talk of Elze Kool in the summer
https://bitbucket.org/elzekool/talk-solr-elasticsearch-internals/src
What do I mean by “powerful search”?
• Fast
Search in milliseconds, not in seconds.
• Relevant
If you search for a Hotel in California, don’t return Hotels in
Groningen. Or a black Audi, you don’t want to see a white Peugeot
107.
• Scalable
If your data grows, then you need more resources. It could mean by
vertical scaling or (better) horizontal scaling of capacity.
MySQL Drawbacks for searching through text
• LIKE %%
• Fast? No, try searching for millions of records with multiple joins to combine
all the information needed.
• Relevant? No, Try search for “PHP programmeur” or “PHP developer”, or
“Audi A8 zwart” or “zwarte Audi A8“.
• Scalable? Could be, but with much hassle in configurations in production and
backing up.
• Counts – How many Audi’s? How many black cars? Takes multiple
query’s for the calculation of those counts.
NB: FULL TEXT not noted here, gave a bit better result but not great.
Why I started with SOLR
• Providers send vehicle updates daily between 06:00 and 22:00
more than 25.000 vehicles are changed throughout the day.
• Encountered MySQL limitations
• Speed – With JOINS for additional data.
• Table LOCK during write actions.
• Relevancy was not great.
• A temporary solution was creating a flat table, that contains all the
data to be shown at the searchoverview pages.
Why I started with SOLR
Thats why I started with SOLR
After changing the search from MySQL to SOLR
• Search time decreased from seconds to milliseconds.
• Relevancy went up since the search internals work differently.
• Costs went down, less resources needed.
• Organic traffic went up since the improved loading times.
• Visitors viewed more paged since better performance.
Statistics: 17.k daily visitors, 160k vehicles, 25k-30k changes
Next up: coverage of the following tools
• MySQL (for main storage)
• SOLR
• Docker (Optionaly)
• Laravel
Let the fun stuff begin!
Setting up / Starting MySQL on OSX
• Default credentials
User: root
Password: <empty>
Port: 3301
Setting up / starting SOLR on OSX
https://github.com/petericebear/solr-configsets
http://brew.sh
Setting up / starting SOLR with docker
https://github.com/petericebear/solr-configsets
Where to begin with SOLR - schema.xml
• Fields
1. Type
What kind of field is it?
2. Indexed
Do you want to search in it?
3. Stored
Return the data in results?
4. Multivalued
Can it contain more than 1 value?
• Fieldtypes
• String
• Integer
• Float
• Boolean
• Date
• Location (Latitude/Longitude)
• ..
Where to begin with SOLR - additional
Copy contents of a field to another field
Add analyzer to a fieldtype – remove stop words “de, het, een, op, in, naar” etc.
Installing laravel
• We use composer for the installation
• If you don’t have it, get it from here: https://getcomposer.org
Run the following in your terminal:
Communicating with SOLR
• https://github.com/solariumphp/solarium
• Over 1.2million downloads
Run the following in your terminal:
Adding a configuration
• config/solarium.php
Add ServiceProvider
When the application needs the SolariumClient
class, it will inject the created configuration to
its Client. This way you will never have to touch
the code when something changes to the server
or core setting.
Notice the $defer setting. When true this
ServiceProvider only will autoload when the
Client is needed and NOT with evry request.
Activate ServiceProvider
To make use of the new ServiceProvider in your application you must
add it in config/app.php and add it to the list of providers.
Testing the connection with SOLR
Adding contents
to SOLR
Can contain single or multiple documents. Basic
object for setting the data.
Removing a document from SOLR
Basic search with SOLR
Facets query
inStock possible values
True [200]
False [100]
Combine for API endpoint
More examples
• https://github.com/solariumphp/solarium/tree/master/examples
• Well documented examples
• http://petericebear.github.io/
• Personal blog with more SOLR integrations
Questions?
Twitter / Github: @petericebear
Email: psteenbergen@gmail.com
COUPONCODE: SOLRMEETING
50% OFF - FIRST MONTH
info@virtio.nl

More Related Content

What's hot

Interactive real time dashboards on data streams using Kafka, Druid, and Supe...
Interactive real time dashboards on data streams using Kafka, Druid, and Supe...Interactive real time dashboards on data streams using Kafka, Druid, and Supe...
Interactive real time dashboards on data streams using Kafka, Druid, and Supe...DataWorks Summit
 
Monitoring Apache Kafka
Monitoring Apache KafkaMonitoring Apache Kafka
Monitoring Apache Kafkaconfluent
 
AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...
AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...
AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...Amazon Web Services
 
Web Crawling with Apache Nutch
Web Crawling with Apache NutchWeb Crawling with Apache Nutch
Web Crawling with Apache Nutchsebastian_nagel
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Stamatis Zampetakis
 
Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...
Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...
Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...Lviv Startup Club
 
Flink Forward San Francisco 2019: Building Financial Identity Platform using ...
Flink Forward San Francisco 2019: Building Financial Identity Platform using ...Flink Forward San Francisco 2019: Building Financial Identity Platform using ...
Flink Forward San Francisco 2019: Building Financial Identity Platform using ...Flink Forward
 
Boosting Documents in Solr by Recency, Popularity and Personal Preferences - ...
Boosting Documents in Solr by Recency, Popularity and Personal Preferences - ...Boosting Documents in Solr by Recency, Popularity and Personal Preferences - ...
Boosting Documents in Solr by Recency, Popularity and Personal Preferences - ...lucenerevolution
 
Apache Solr-Webinar
Apache Solr-WebinarApache Solr-Webinar
Apache Solr-WebinarEdureka!
 
Building an open data platform with apache iceberg
Building an open data platform with apache icebergBuilding an open data platform with apache iceberg
Building an open data platform with apache icebergAlluxio, Inc.
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBLee Theobald
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkDatabricks
 
SQL for NoSQL and how Apache Calcite can help
SQL for NoSQL and how  Apache Calcite can helpSQL for NoSQL and how  Apache Calcite can help
SQL for NoSQL and how Apache Calcite can helpChristian Tzolov
 
Streaming SQL with Apache Calcite
Streaming SQL with Apache CalciteStreaming SQL with Apache Calcite
Streaming SQL with Apache CalciteJulian Hyde
 
The evolution of Apache Calcite and its Community
The evolution of Apache Calcite and its CommunityThe evolution of Apache Calcite and its Community
The evolution of Apache Calcite and its CommunityJulian Hyde
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaGuido Schmutz
 
Interactive real-time dashboards on data streams using Kafka, Druid, and Supe...
Interactive real-time dashboards on data streams using Kafka, Druid, and Supe...Interactive real-time dashboards on data streams using Kafka, Druid, and Supe...
Interactive real-time dashboards on data streams using Kafka, Druid, and Supe...DataWorks Summit
 

What's hot (20)

Interactive real time dashboards on data streams using Kafka, Druid, and Supe...
Interactive real time dashboards on data streams using Kafka, Druid, and Supe...Interactive real time dashboards on data streams using Kafka, Druid, and Supe...
Interactive real time dashboards on data streams using Kafka, Druid, and Supe...
 
Monitoring Apache Kafka
Monitoring Apache KafkaMonitoring Apache Kafka
Monitoring Apache Kafka
 
AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...
AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...
AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...
 
Web Crawling with Apache Nutch
Web Crawling with Apache NutchWeb Crawling with Apache Nutch
Web Crawling with Apache Nutch
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21
 
Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...
Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...
Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...
 
Flink Forward San Francisco 2019: Building Financial Identity Platform using ...
Flink Forward San Francisco 2019: Building Financial Identity Platform using ...Flink Forward San Francisco 2019: Building Financial Identity Platform using ...
Flink Forward San Francisco 2019: Building Financial Identity Platform using ...
 
Boosting Documents in Solr by Recency, Popularity and Personal Preferences - ...
Boosting Documents in Solr by Recency, Popularity and Personal Preferences - ...Boosting Documents in Solr by Recency, Popularity and Personal Preferences - ...
Boosting Documents in Solr by Recency, Popularity and Personal Preferences - ...
 
Fleet and elastic agent
Fleet and elastic agentFleet and elastic agent
Fleet and elastic agent
 
Apache Solr-Webinar
Apache Solr-WebinarApache Solr-Webinar
Apache Solr-Webinar
 
Building an open data platform with apache iceberg
Building an open data platform with apache icebergBuilding an open data platform with apache iceberg
Building an open data platform with apache iceberg
 
ELK introduction
ELK introductionELK introduction
ELK introduction
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
 
SQL for NoSQL and how Apache Calcite can help
SQL for NoSQL and how  Apache Calcite can helpSQL for NoSQL and how  Apache Calcite can help
SQL for NoSQL and how Apache Calcite can help
 
Streaming SQL with Apache Calcite
Streaming SQL with Apache CalciteStreaming SQL with Apache Calcite
Streaming SQL with Apache Calcite
 
The evolution of Apache Calcite and its Community
The evolution of Apache Calcite and its CommunityThe evolution of Apache Calcite and its Community
The evolution of Apache Calcite and its Community
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
 
Prestogres internals
Prestogres internalsPrestogres internals
Prestogres internals
 
Interactive real-time dashboards on data streams using Kafka, Druid, and Supe...
Interactive real-time dashboards on data streams using Kafka, Druid, and Supe...Interactive real-time dashboards on data streams using Kafka, Druid, and Supe...
Interactive real-time dashboards on data streams using Kafka, Druid, and Supe...
 

Viewers also liked

Secciones estilos encabezados
Secciones estilos encabezadosSecciones estilos encabezados
Secciones estilos encabezadosguisselle guevara
 
Laravel, the right way - PHPConference 2016
Laravel, the right way - PHPConference 2016Laravel, the right way - PHPConference 2016
Laravel, the right way - PHPConference 2016Matheus Marabesi
 
Testing and TDD - Laravel and Express Examples
Testing and TDD - Laravel and Express ExamplesTesting and TDD - Laravel and Express Examples
Testing and TDD - Laravel and Express ExamplesDragos Strugar
 
Datech2014 - Cataloguing for a Billion Word Library of Greek and Latin
Datech2014 - Cataloguing for a Billion Word Library of Greek and LatinDatech2014 - Cataloguing for a Billion Word Library of Greek and Latin
Datech2014 - Cataloguing for a Billion Word Library of Greek and LatinIMPACT Centre of Competence
 
Library of Congress New Bibliographic Framework - What is it?
Library of Congress New Bibliographic Framework - What is it?Library of Congress New Bibliographic Framework - What is it?
Library of Congress New Bibliographic Framework - What is it?Lukas Koster
 
Cataloguing in the Real World
Cataloguing in the Real WorldCataloguing in the Real World
Cataloguing in the Real WorldEmily Porta
 
Censorship by Omission: Closing off fiction in cataloguing
Censorship by Omission: Closing off fiction in cataloguingCensorship by Omission: Closing off fiction in cataloguing
Censorship by Omission: Closing off fiction in cataloguingNational Library of Australia
 
The Future of Library Cataloguing
The Future of Library CataloguingThe Future of Library Cataloguing
The Future of Library CataloguingKathryne Dunlap
 
Day in the life of a data librarian [presentation for ANU 23Things group]
Day in the life of a data librarian [presentation for ANU 23Things group]Day in the life of a data librarian [presentation for ANU 23Things group]
Day in the life of a data librarian [presentation for ANU 23Things group]Jane Frazier
 
Library Carpentry: software skills training for library professionals, Chart...
 Library Carpentry: software skills training for library professionals, Chart... Library Carpentry: software skills training for library professionals, Chart...
Library Carpentry: software skills training for library professionals, Chart...James Baker
 
Microdata cataloging tool (nada)
Microdata cataloging tool (nada)Microdata cataloging tool (nada)
Microdata cataloging tool (nada)Divya Vyas
 
Computer Science Library Training
Computer Science Library TrainingComputer Science Library Training
Computer Science Library Trainingpvhead123
 
Presentacion mineria
Presentacion mineriaPresentacion mineria
Presentacion mineriaviktor93
 
Reactive Laravel - Laravel meetup Groningen
Reactive Laravel - Laravel meetup GroningenReactive Laravel - Laravel meetup Groningen
Reactive Laravel - Laravel meetup GroningenJasper Staats
 
Taller de catalogación Linked Open Data y RDA: posibilidades y desafíos. Prim...
Taller de catalogación Linked Open Data y RDA: posibilidades y desafíos. Prim...Taller de catalogación Linked Open Data y RDA: posibilidades y desafíos. Prim...
Taller de catalogación Linked Open Data y RDA: posibilidades y desafíos. Prim...DIGIBIS
 
Really Simple Document Management with Alfresco
Really Simple Document Management with AlfrescoReally Simple Document Management with Alfresco
Really Simple Document Management with AlfrescoAlfresco Software
 

Viewers also liked (20)

Secciones estilos encabezados
Secciones estilos encabezadosSecciones estilos encabezados
Secciones estilos encabezados
 
Laravel, the right way - PHPConference 2016
Laravel, the right way - PHPConference 2016Laravel, the right way - PHPConference 2016
Laravel, the right way - PHPConference 2016
 
Testing and TDD - Laravel and Express Examples
Testing and TDD - Laravel and Express ExamplesTesting and TDD - Laravel and Express Examples
Testing and TDD - Laravel and Express Examples
 
Datech2014 - Cataloguing for a Billion Word Library of Greek and Latin
Datech2014 - Cataloguing for a Billion Word Library of Greek and LatinDatech2014 - Cataloguing for a Billion Word Library of Greek and Latin
Datech2014 - Cataloguing for a Billion Word Library of Greek and Latin
 
Library of Congress New Bibliographic Framework - What is it?
Library of Congress New Bibliographic Framework - What is it?Library of Congress New Bibliographic Framework - What is it?
Library of Congress New Bibliographic Framework - What is it?
 
Cataloguing in the Real World
Cataloguing in the Real WorldCataloguing in the Real World
Cataloguing in the Real World
 
Censorship by Omission: Closing off fiction in cataloguing
Censorship by Omission: Closing off fiction in cataloguingCensorship by Omission: Closing off fiction in cataloguing
Censorship by Omission: Closing off fiction in cataloguing
 
The Future of Library Cataloguing
The Future of Library CataloguingThe Future of Library Cataloguing
The Future of Library Cataloguing
 
Day in the life of a data librarian [presentation for ANU 23Things group]
Day in the life of a data librarian [presentation for ANU 23Things group]Day in the life of a data librarian [presentation for ANU 23Things group]
Day in the life of a data librarian [presentation for ANU 23Things group]
 
Library Carpentry: software skills training for library professionals, Chart...
 Library Carpentry: software skills training for library professionals, Chart... Library Carpentry: software skills training for library professionals, Chart...
Library Carpentry: software skills training for library professionals, Chart...
 
Building a Search Engine Using Lucene
Building a Search Engine Using LuceneBuilding a Search Engine Using Lucene
Building a Search Engine Using Lucene
 
Microdata cataloging tool (nada)
Microdata cataloging tool (nada)Microdata cataloging tool (nada)
Microdata cataloging tool (nada)
 
Computer Science Library Training
Computer Science Library TrainingComputer Science Library Training
Computer Science Library Training
 
Presentacion mineria
Presentacion mineriaPresentacion mineria
Presentacion mineria
 
Reactive Laravel - Laravel meetup Groningen
Reactive Laravel - Laravel meetup GroningenReactive Laravel - Laravel meetup Groningen
Reactive Laravel - Laravel meetup Groningen
 
Taller de catalogación Linked Open Data y RDA: posibilidades y desafíos. Prim...
Taller de catalogación Linked Open Data y RDA: posibilidades y desafíos. Prim...Taller de catalogación Linked Open Data y RDA: posibilidades y desafíos. Prim...
Taller de catalogación Linked Open Data y RDA: posibilidades y desafíos. Prim...
 
(Have a) rest with Laravel
(Have a) rest with Laravel(Have a) rest with Laravel
(Have a) rest with Laravel
 
Presentation laravel 5 4
Presentation laravel 5 4Presentation laravel 5 4
Presentation laravel 5 4
 
Really Simple Document Management with Alfresco
Really Simple Document Management with AlfrescoReally Simple Document Management with Alfresco
Really Simple Document Management with Alfresco
 
RDA y el proceso de catalogación
RDA y el proceso de catalogaciónRDA y el proceso de catalogación
RDA y el proceso de catalogación
 

Similar to Laravel and SOLR

Meet Solr For The Tirst Again
Meet Solr For The Tirst AgainMeet Solr For The Tirst Again
Meet Solr For The Tirst AgainVarun Thacker
 
Site reliability in the serverless age - Serverless Boston Meetup
Site reliability in the serverless age  - Serverless Boston MeetupSite reliability in the serverless age  - Serverless Boston Meetup
Site reliability in the serverless age - Serverless Boston MeetupErik Peterson
 
GraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'tsGraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'tsVáclav Šír
 
Ease of use in Apache Solr
Ease of use in Apache SolrEase of use in Apache Solr
Ease of use in Apache SolrAnshum Gupta
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudAnshum Gupta
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuningJohn McCaffrey
 
Which Freaking Database Should I Use?
Which Freaking Database Should I Use?Which Freaking Database Should I Use?
Which Freaking Database Should I Use?Great Wide Open
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersAmazon Web Services
 
How do Solr and Azure Search compare?
How do Solr and Azure Search compare?How do Solr and Azure Search compare?
How do Solr and Azure Search compare?SearchStax
 
Scaling Your Applications with Engine Yard Cloud
Scaling Your Applications with Engine Yard CloudScaling Your Applications with Engine Yard Cloud
Scaling Your Applications with Engine Yard CloudEngine Yard
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQLKonstantin Gredeskoul
 
Adding GraphQL to your existing architecture
Adding GraphQL to your existing architectureAdding GraphQL to your existing architecture
Adding GraphQL to your existing architectureSashko Stubailo
 
Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...
Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...
Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...Caserta
 
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Editionecobold
 
Is Serverless The New Swiss Cheese? - AWS Seattle User Group
Is Serverless The New Swiss Cheese? - AWS Seattle User GroupIs Serverless The New Swiss Cheese? - AWS Seattle User Group
Is Serverless The New Swiss Cheese? - AWS Seattle User GroupChase Douglas
 
SolrCloud-Best Practices for Sitecore. Design, build, and devops considerations
SolrCloud-Best Practices for Sitecore. Design, build, and devops considerationsSolrCloud-Best Practices for Sitecore. Design, build, and devops considerations
SolrCloud-Best Practices for Sitecore. Design, build, and devops considerationsSameer Maggon
 

Similar to Laravel and SOLR (20)

Meet Solr For The Tirst Again
Meet Solr For The Tirst AgainMeet Solr For The Tirst Again
Meet Solr For The Tirst Again
 
Site reliability in the serverless age - Serverless Boston Meetup
Site reliability in the serverless age  - Serverless Boston MeetupSite reliability in the serverless age  - Serverless Boston Meetup
Site reliability in the serverless age - Serverless Boston Meetup
 
GraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'tsGraphQL-PHP: Dos and don'ts
GraphQL-PHP: Dos and don'ts
 
Ease of use in Apache Solr
Ease of use in Apache SolrEase of use in Apache Solr
Ease of use in Apache Solr
 
Beyond The Rails Way
Beyond The Rails WayBeyond The Rails Way
Beyond The Rails Way
 
Solr @ eBay Kleinanzeigen
Solr @ eBay KleinanzeigenSolr @ eBay Kleinanzeigen
Solr @ eBay Kleinanzeigen
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloud
 
EnterpriseSearch
EnterpriseSearchEnterpriseSearch
EnterpriseSearch
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
Which Freaking Database Should I Use?
Which Freaking Database Should I Use?Which Freaking Database Should I Use?
Which Freaking Database Should I Use?
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
 
How do Solr and Azure Search compare?
How do Solr and Azure Search compare?How do Solr and Azure Search compare?
How do Solr and Azure Search compare?
 
Scaling Your Applications with Engine Yard Cloud
Scaling Your Applications with Engine Yard CloudScaling Your Applications with Engine Yard Cloud
Scaling Your Applications with Engine Yard Cloud
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
Rails tools
Rails toolsRails tools
Rails tools
 
Adding GraphQL to your existing architecture
Adding GraphQL to your existing architectureAdding GraphQL to your existing architecture
Adding GraphQL to your existing architecture
 
Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...
Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...
Big Data Warehousing Meetup: Developing a super-charged NoSQL data mart using...
 
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
 
Is Serverless The New Swiss Cheese? - AWS Seattle User Group
Is Serverless The New Swiss Cheese? - AWS Seattle User GroupIs Serverless The New Swiss Cheese? - AWS Seattle User Group
Is Serverless The New Swiss Cheese? - AWS Seattle User Group
 
SolrCloud-Best Practices for Sitecore. Design, build, and devops considerations
SolrCloud-Best Practices for Sitecore. Design, build, and devops considerationsSolrCloud-Best Practices for Sitecore. Design, build, and devops considerations
SolrCloud-Best Practices for Sitecore. Design, build, and devops considerations
 

Recently uploaded

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 

Recently uploaded (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

Laravel and SOLR

  • 1. Laravel and SOLR How to build a powerful search combination - Peter Steenbergen
  • 3. What I am about to cover • The meaning of the term powerful • MySQL Drawbacks • Why SOLR • Usage of tools • Setting up / starting with SOLR Server • Starting with SOLR • Integrate SOLR with Laravel • Laravel and SOLR Searching
  • 4. What I do NOT cover • Front-End implementation • No Angular, VueJS or React integration (recommend VueJS though) • Authentication • Internals of SOLR / Elasticsearch • Talk of Elze Kool in the summer https://bitbucket.org/elzekool/talk-solr-elasticsearch-internals/src
  • 5. What do I mean by “powerful search”? • Fast Search in milliseconds, not in seconds. • Relevant If you search for a Hotel in California, don’t return Hotels in Groningen. Or a black Audi, you don’t want to see a white Peugeot 107. • Scalable If your data grows, then you need more resources. It could mean by vertical scaling or (better) horizontal scaling of capacity.
  • 6. MySQL Drawbacks for searching through text • LIKE %% • Fast? No, try searching for millions of records with multiple joins to combine all the information needed. • Relevant? No, Try search for “PHP programmeur” or “PHP developer”, or “Audi A8 zwart” or “zwarte Audi A8“. • Scalable? Could be, but with much hassle in configurations in production and backing up. • Counts – How many Audi’s? How many black cars? Takes multiple query’s for the calculation of those counts. NB: FULL TEXT not noted here, gave a bit better result but not great.
  • 7. Why I started with SOLR • Providers send vehicle updates daily between 06:00 and 22:00 more than 25.000 vehicles are changed throughout the day. • Encountered MySQL limitations • Speed – With JOINS for additional data. • Table LOCK during write actions. • Relevancy was not great. • A temporary solution was creating a flat table, that contains all the data to be shown at the searchoverview pages.
  • 8. Why I started with SOLR
  • 9. Thats why I started with SOLR After changing the search from MySQL to SOLR • Search time decreased from seconds to milliseconds. • Relevancy went up since the search internals work differently. • Costs went down, less resources needed. • Organic traffic went up since the improved loading times. • Visitors viewed more paged since better performance. Statistics: 17.k daily visitors, 160k vehicles, 25k-30k changes
  • 10. Next up: coverage of the following tools • MySQL (for main storage) • SOLR • Docker (Optionaly) • Laravel
  • 11. Let the fun stuff begin!
  • 12. Setting up / Starting MySQL on OSX • Default credentials User: root Password: <empty> Port: 3301
  • 13. Setting up / starting SOLR on OSX https://github.com/petericebear/solr-configsets http://brew.sh
  • 14. Setting up / starting SOLR with docker https://github.com/petericebear/solr-configsets
  • 15. Where to begin with SOLR - schema.xml • Fields 1. Type What kind of field is it? 2. Indexed Do you want to search in it? 3. Stored Return the data in results? 4. Multivalued Can it contain more than 1 value? • Fieldtypes • String • Integer • Float • Boolean • Date • Location (Latitude/Longitude) • ..
  • 16. Where to begin with SOLR - additional Copy contents of a field to another field Add analyzer to a fieldtype – remove stop words “de, het, een, op, in, naar” etc.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Installing laravel • We use composer for the installation • If you don’t have it, get it from here: https://getcomposer.org Run the following in your terminal:
  • 22. Communicating with SOLR • https://github.com/solariumphp/solarium • Over 1.2million downloads Run the following in your terminal:
  • 23. Adding a configuration • config/solarium.php
  • 24. Add ServiceProvider When the application needs the SolariumClient class, it will inject the created configuration to its Client. This way you will never have to touch the code when something changes to the server or core setting. Notice the $defer setting. When true this ServiceProvider only will autoload when the Client is needed and NOT with evry request.
  • 25. Activate ServiceProvider To make use of the new ServiceProvider in your application you must add it in config/app.php and add it to the list of providers.
  • 27.
  • 28. Adding contents to SOLR Can contain single or multiple documents. Basic object for setting the data.
  • 29. Removing a document from SOLR
  • 31. Facets query inStock possible values True [200] False [100]
  • 32. Combine for API endpoint
  • 33. More examples • https://github.com/solariumphp/solarium/tree/master/examples • Well documented examples • http://petericebear.github.io/ • Personal blog with more SOLR integrations
  • 34. Questions? Twitter / Github: @petericebear Email: psteenbergen@gmail.com COUPONCODE: SOLRMEETING 50% OFF - FIRST MONTH info@virtio.nl

Editor's Notes

  1. Inleiding - Wat ga ik behandelen in deze presentatie. Globale overview..
  2. Inleiding - Wat ga ik behandelen in deze presentatie. Globale overview..
  3. Dit zorgde voor een grote wachtrij – net als bij BlackFriday voor de winkels probeerden vele bezoekers op piek momenten door 1 deur te gaan. En dan krijg je het volgende effect.
  4. Build a docker instance with additional config sets. PR’s welcome docker-machine start eval $(docker-machine env)
  5. Verschil uitleggen bij HourGroup en HourText
  6. Next slide is about