SlideShare a Scribd company logo
1 of 27
Download to read offline
Apache Solr
Solr is an open source enterprise search platform, written in Java, from the Apache Lucene
project. Its major features include full-text search, hit highlighting, faceted search, real-time
indexing, dynamic clustering, database integration, NoSQL features and rich document (e.g., Word,
PDF) handling.
Providing distributed search and index replication, Solr is designed for scalability and Fault
tolerance.
Solr is the second-most popular enterprise search engine after Elasticsearch.
Major search features in solr:
● Full text.
● Phrases.
● Boosting.
● Scoping.
● Disjunctions and conjunctions.
● Pagination.
● Faceting.
○ Field facets.
○ Query facets.
○ Range facets.
● Ordering.
○ Order by function.
● Grouping.
● Geospatial.
● Highlighting.
● Stats.
● Dynamic fields.
Agenda
➢ Text fields will be full-text
searchable. Other fields (e.g.,
integer and string) can be used
to scope queries.
Setting Up Objects
Searching Objects
Search In Depth
● Full text
➢ phrase searches are
represented as a double
quoted group of words.
➢ query_phrase_slop sets
the number of words that
may appear between the
words in a phrase.
Search In Depth - cont.
● Phrases
Search In Depth - cont.
● Phrase boosts
➢ Fields not defined as text (e.g., integer, boolean,
time, etc...) can be used to scope (restrict) queries
before full-text matching is performed.
Search In Depth - cont.
● Scoping (Scalar Fields)
Search In Depth - cont.
● Disjunctions and Conjunctions
➢ The results array that is
returned has methods mixed in
that allow it to operate
seamlessly with common
pagination libraries like
will_paginate and kaminari.
➢ By default, Sunspot requests
the first 30 results from Solr
Search In Depth - cont.
● Pagination
Faceting
➢ Faceting is a feature of Solr that determines the number of documents that match a given
search and an additional criterion. This allows you to build powerful drill-down interfaces for
search.
➢ Each facet returns zero or more rows, each of which represents a particular criterion
conjoined with the actual query being performed. For field facets, each row represents a
particular value for a given field. For query facets, each row represents an arbitrary scope;
the facet itself is just a means of logically grouping the scopes.
➢ By default Sunspot will only return the first 100 facet values. You can increase this limit, or
force it to return all facets by setting limit to -1.
Faceting - cont.
● Field Facets
Faceting - cont.
● Query Facets
Faceting - cont.
● Range Facets
➢ By default Sunspot
orders results by
"score": the
Solr-determined
relevancy metric.
Sorting can be
customized with
the order_by
method.
Ordering
➢ Solr supports
sorting on
multiple fields
using custom
functions (Solr 3.1
and above).
Ordering by function
➢ Solr supports
grouping
documents,
similar to an SQL
GROUP BY.
➢ Grouping is only
supported on
string fields that
are not
multivalued. To
group on a field
of a different
type (e.g.,
integer), add a
denormalized
string type.
Grouping
Geospatial
➢ Filter By Radius.
➢ Sort By Distance.
➢ Highlighting allows you to
display snippets of the part of
the document that matched the
query.
Highlighting
Highlighting
● Solr can return some statistics on indexed numeric fields. Fetching statistics for
average_rating.
○ Stats on multiple fields.
○ Faceting on stats.
Stats
Dynamic Fields
Dynamic fields allow Solr to index fields that you did not explicitly define in
your schema. This is useful if you discover you have forgotten to define one
or more fields. Dynamic fields can make your application less brittle by
providing some flexibility in the documents you can add to Solr.
Note: you can’t define a dynamic_text field. Hence, it is not possible to do a
fulltext search on dynamic fields.
class MyClass
searchable do
dynamic_integer :custom_category_ids, :multiple => true do
custom_categories.inject(Hash.new { |h, k| h[k] = [] }) do |map, custom_category|
map[custom_category.name] << custom_category_values_for(custom_category)
map
end
end
end
end
search = MyClass.search do
dynamic(:custom_categories) do
facet(some_custom_category.id)
end
end
facet = search.facet(:custom_categories, some_custom_category.name)
Dynamic Fields
References
● https://github.com/sunspot/sunspot
● https://github.com/sunspot/sunspot/wiki/Dynamic-fields
● https://en.wikipedia.org/wiki/Apache_Solr
● https://wiki.apache.org/solr

More Related Content

Viewers also liked

Inocencio meléndez julio. contratacion y gestion. análisis del sistema mone...
Inocencio meléndez julio. contratacion y gestion. análisis del sistema mone...Inocencio meléndez julio. contratacion y gestion. análisis del sistema mone...
Inocencio meléndez julio. contratacion y gestion. análisis del sistema mone...INOCENCIO MELÉNDEZ JULIO
 
Inocencio melendez julio análisis financiero de la empresa cadenalco s.a, ...
 Inocencio melendez julio análisis financiero de la empresa cadenalco s.a,  ... Inocencio melendez julio análisis financiero de la empresa cadenalco s.a,  ...
Inocencio melendez julio análisis financiero de la empresa cadenalco s.a, ...INOCENCIO MELÉNDEZ JULIO
 
Inocencio melendez julio. cuenta, balnce general y estado de resultados
Inocencio melendez julio. cuenta, balnce general y estado de resultadosInocencio melendez julio. cuenta, balnce general y estado de resultados
Inocencio melendez julio. cuenta, balnce general y estado de resultadosINOCENCIO MELÉNDEZ JULIO
 
Caso thypoon computers
Caso thypoon computers Caso thypoon computers
Caso thypoon computers Perci Lunarejo
 
Konzepterläuterung.
Konzepterläuterung.Konzepterläuterung.
Konzepterläuterung.urmle
 
Nación. la planeación, organización y dirección. inocencio meléndez julio.
Nación. la planeación, organización y dirección. inocencio meléndez julio.Nación. la planeación, organización y dirección. inocencio meléndez julio.
Nación. la planeación, organización y dirección. inocencio meléndez julio.INOCENCIO MELÉNDEZ JULIO
 
Territorio Noroeste Norte
Territorio Noroeste NorteTerritorio Noroeste Norte
Territorio Noroeste NorteIDMECAR
 
Inocencio meléndez julio. preacuerdo empresarial. proyecto académico peda...
Inocencio meléndez julio. preacuerdo empresarial. proyecto  académico  peda...Inocencio meléndez julio. preacuerdo empresarial. proyecto  académico  peda...
Inocencio meléndez julio. preacuerdo empresarial. proyecto académico peda...INOCENCIO MELÉNDEZ JULIO
 
Academia y administración. como encontrarle sentido a la vida. inocencio m...
Academia y administración.  como encontrarle sentido  a la vida. inocencio m...Academia y administración.  como encontrarle sentido  a la vida. inocencio m...
Academia y administración. como encontrarle sentido a la vida. inocencio m...INOCENCIO MELÉNDEZ JULIO
 
Antonhy sebastian moreno
Antonhy sebastian morenoAntonhy sebastian moreno
Antonhy sebastian morenomorenos11
 

Viewers also liked (12)

Organización del alumnado
Organización del alumnadoOrganización del alumnado
Organización del alumnado
 
Inocencio meléndez julio. contratacion y gestion. análisis del sistema mone...
Inocencio meléndez julio. contratacion y gestion. análisis del sistema mone...Inocencio meléndez julio. contratacion y gestion. análisis del sistema mone...
Inocencio meléndez julio. contratacion y gestion. análisis del sistema mone...
 
Inocencio melendez julio análisis financiero de la empresa cadenalco s.a, ...
 Inocencio melendez julio análisis financiero de la empresa cadenalco s.a,  ... Inocencio melendez julio análisis financiero de la empresa cadenalco s.a,  ...
Inocencio melendez julio análisis financiero de la empresa cadenalco s.a, ...
 
Inocencio melendez julio. cuenta, balnce general y estado de resultados
Inocencio melendez julio. cuenta, balnce general y estado de resultadosInocencio melendez julio. cuenta, balnce general y estado de resultados
Inocencio melendez julio. cuenta, balnce general y estado de resultados
 
Caso thypoon computers
Caso thypoon computers Caso thypoon computers
Caso thypoon computers
 
Como crear un recovery para tu pc
Como crear un recovery para tu pcComo crear un recovery para tu pc
Como crear un recovery para tu pc
 
Konzepterläuterung.
Konzepterläuterung.Konzepterläuterung.
Konzepterläuterung.
 
Nación. la planeación, organización y dirección. inocencio meléndez julio.
Nación. la planeación, organización y dirección. inocencio meléndez julio.Nación. la planeación, organización y dirección. inocencio meléndez julio.
Nación. la planeación, organización y dirección. inocencio meléndez julio.
 
Territorio Noroeste Norte
Territorio Noroeste NorteTerritorio Noroeste Norte
Territorio Noroeste Norte
 
Inocencio meléndez julio. preacuerdo empresarial. proyecto académico peda...
Inocencio meléndez julio. preacuerdo empresarial. proyecto  académico  peda...Inocencio meléndez julio. preacuerdo empresarial. proyecto  académico  peda...
Inocencio meléndez julio. preacuerdo empresarial. proyecto académico peda...
 
Academia y administración. como encontrarle sentido a la vida. inocencio m...
Academia y administración.  como encontrarle sentido  a la vida. inocencio m...Academia y administración.  como encontrarle sentido  a la vida. inocencio m...
Academia y administración. como encontrarle sentido a la vida. inocencio m...
 
Antonhy sebastian moreno
Antonhy sebastian morenoAntonhy sebastian moreno
Antonhy sebastian moreno
 

Similar to Sunspot - The Ruby Way into Solr

Find it, possibly also near you!
Find it, possibly also near you!Find it, possibly also near you!
Find it, possibly also near you!Paul Borgermans
 
Retrieving Information From Solr
Retrieving Information From SolrRetrieving Information From Solr
Retrieving Information From SolrRamzi Alqrainy
 
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)Kai Chan
 
Lucene And Solr Document Classification
Lucene And Solr Document ClassificationLucene And Solr Document Classification
Lucene And Solr Document ClassificationAlessandro Benedetti
 
Apache Lucene/Solr Document Classification
Apache Lucene/Solr Document ClassificationApache Lucene/Solr Document Classification
Apache Lucene/Solr Document ClassificationSease
 
Get the most out of Solr search with PHP
Get the most out of Solr search with PHPGet the most out of Solr search with PHP
Get the most out of Solr search with PHPPaul Borgermans
 
Elasticsearch selected topics
Elasticsearch selected topicsElasticsearch selected topics
Elasticsearch selected topicsCube Solutions
 
DrupalTour. Lviv — Apache solr. Advanced use cases (Artem Sylchuk, InternetDe...
DrupalTour. Lviv — Apache solr. Advanced use cases (Artem Sylchuk, InternetDe...DrupalTour. Lviv — Apache solr. Advanced use cases (Artem Sylchuk, InternetDe...
DrupalTour. Lviv — Apache solr. Advanced use cases (Artem Sylchuk, InternetDe...Drupaltour
 
Basics of Solr and Solr Integration with AEM6
Basics of Solr and Solr Integration with AEM6Basics of Solr and Solr Integration with AEM6
Basics of Solr and Solr Integration with AEM6DEEPAK KHETAWAT
 
Introduction to Apache solr
Introduction to Apache solrIntroduction to Apache solr
Introduction to Apache solrKnoldus Inc.
 
Enterprise Search Using Apache Solr
Enterprise Search Using Apache SolrEnterprise Search Using Apache Solr
Enterprise Search Using Apache Solrsagar chaturvedi
 
Solr/Elasticsearch for CF Developers (and others)
Solr/Elasticsearch for CF Developers (and others)Solr/Elasticsearch for CF Developers (and others)
Solr/Elasticsearch for CF Developers (and others)Mary Jo Sminkey
 
Solr Query Parsing
Solr Query ParsingSolr Query Parsing
Solr Query ParsingErik Hatcher
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)Michael Rys
 
Assamese search engine using SOLR by Moinuddin Ahmed ( moin )
Assamese search engine using SOLR by Moinuddin Ahmed ( moin )Assamese search engine using SOLR by Moinuddin Ahmed ( moin )
Assamese search engine using SOLR by Moinuddin Ahmed ( moin )'Moinuddin Ahmed
 

Similar to Sunspot - The Ruby Way into Solr (20)

Find it, possibly also near you!
Find it, possibly also near you!Find it, possibly also near you!
Find it, possibly also near you!
 
Retrieving Information From Solr
Retrieving Information From SolrRetrieving Information From Solr
Retrieving Information From Solr
 
Solr5
Solr5Solr5
Solr5
 
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)
 
Apache solr
Apache solrApache solr
Apache solr
 
Lucene And Solr Document Classification
Lucene And Solr Document ClassificationLucene And Solr Document Classification
Lucene And Solr Document Classification
 
Apache Lucene/Solr Document Classification
Apache Lucene/Solr Document ClassificationApache Lucene/Solr Document Classification
Apache Lucene/Solr Document Classification
 
Get the most out of Solr search with PHP
Get the most out of Solr search with PHPGet the most out of Solr search with PHP
Get the most out of Solr search with PHP
 
Elasticsearch selected topics
Elasticsearch selected topicsElasticsearch selected topics
Elasticsearch selected topics
 
DrupalTour. Lviv — Apache solr. Advanced use cases (Artem Sylchuk, InternetDe...
DrupalTour. Lviv — Apache solr. Advanced use cases (Artem Sylchuk, InternetDe...DrupalTour. Lviv — Apache solr. Advanced use cases (Artem Sylchuk, InternetDe...
DrupalTour. Lviv — Apache solr. Advanced use cases (Artem Sylchuk, InternetDe...
 
Apache solr
Apache solrApache solr
Apache solr
 
Hands on-solr
Hands on-solrHands on-solr
Hands on-solr
 
Basics of Solr and Solr Integration with AEM6
Basics of Solr and Solr Integration with AEM6Basics of Solr and Solr Integration with AEM6
Basics of Solr and Solr Integration with AEM6
 
Introduction to Apache solr
Introduction to Apache solrIntroduction to Apache solr
Introduction to Apache solr
 
Enterprise Search Using Apache Solr
Enterprise Search Using Apache SolrEnterprise Search Using Apache Solr
Enterprise Search Using Apache Solr
 
Solr/Elasticsearch for CF Developers (and others)
Solr/Elasticsearch for CF Developers (and others)Solr/Elasticsearch for CF Developers (and others)
Solr/Elasticsearch for CF Developers (and others)
 
Solr Query Parsing
Solr Query ParsingSolr Query Parsing
Solr Query Parsing
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
 
Solr 8 interview
Solr 8 interview Solr 8 interview
Solr 8 interview
 
Assamese search engine using SOLR by Moinuddin Ahmed ( moin )
Assamese search engine using SOLR by Moinuddin Ahmed ( moin )Assamese search engine using SOLR by Moinuddin Ahmed ( moin )
Assamese search engine using SOLR by Moinuddin Ahmed ( moin )
 

More from BADR

Vue.js
Vue.jsVue.js
Vue.jsBADR
 
There and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming LanguagesThere and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming LanguagesBADR
 
Take Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven DevelopmentTake Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven DevelopmentBADR
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility PrincipleBADR
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL DatabasesBADR
 
Explicit Semantic Analysis
Explicit Semantic AnalysisExplicit Semantic Analysis
Explicit Semantic AnalysisBADR
 
Getting some Git
Getting some GitGetting some Git
Getting some GitBADR
 
ReactiveX
ReactiveXReactiveX
ReactiveXBADR
 
Algorithms - A Sneak Peek
Algorithms - A Sneak PeekAlgorithms - A Sneak Peek
Algorithms - A Sneak PeekBADR
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to ZBADR
 
Apache Hadoop - Big Data Engineering
Apache Hadoop - Big Data EngineeringApache Hadoop - Big Data Engineering
Apache Hadoop - Big Data EngineeringBADR
 
MySQL Indexing
MySQL IndexingMySQL Indexing
MySQL IndexingBADR
 
Duckville - The Strategy Design Pattern
Duckville - The Strategy Design PatternDuckville - The Strategy Design Pattern
Duckville - The Strategy Design PatternBADR
 
The Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design PatternThe Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design PatternBADR
 

More from BADR (14)

Vue.js
Vue.jsVue.js
Vue.js
 
There and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming LanguagesThere and Back Again - A Tale of Programming Languages
There and Back Again - A Tale of Programming Languages
 
Take Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven DevelopmentTake Pride in Your Code - Test-Driven Development
Take Pride in Your Code - Test-Driven Development
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility Principle
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
 
Explicit Semantic Analysis
Explicit Semantic AnalysisExplicit Semantic Analysis
Explicit Semantic Analysis
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
 
ReactiveX
ReactiveXReactiveX
ReactiveX
 
Algorithms - A Sneak Peek
Algorithms - A Sneak PeekAlgorithms - A Sneak Peek
Algorithms - A Sneak Peek
 
Android from A to Z
Android from A to ZAndroid from A to Z
Android from A to Z
 
Apache Hadoop - Big Data Engineering
Apache Hadoop - Big Data EngineeringApache Hadoop - Big Data Engineering
Apache Hadoop - Big Data Engineering
 
MySQL Indexing
MySQL IndexingMySQL Indexing
MySQL Indexing
 
Duckville - The Strategy Design Pattern
Duckville - The Strategy Design PatternDuckville - The Strategy Design Pattern
Duckville - The Strategy Design Pattern
 
The Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design PatternThe Perks and Perils of the Singleton Design Pattern
The Perks and Perils of the Singleton Design Pattern
 

Recently uploaded

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
(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
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 

Recently uploaded (20)

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
(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...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 

Sunspot - The Ruby Way into Solr

  • 1.
  • 2.
  • 3. Apache Solr Solr is an open source enterprise search platform, written in Java, from the Apache Lucene project. Its major features include full-text search, hit highlighting, faceted search, real-time indexing, dynamic clustering, database integration, NoSQL features and rich document (e.g., Word, PDF) handling. Providing distributed search and index replication, Solr is designed for scalability and Fault tolerance. Solr is the second-most popular enterprise search engine after Elasticsearch.
  • 4. Major search features in solr: ● Full text. ● Phrases. ● Boosting. ● Scoping. ● Disjunctions and conjunctions. ● Pagination. ● Faceting. ○ Field facets. ○ Query facets. ○ Range facets. ● Ordering. ○ Order by function. ● Grouping. ● Geospatial. ● Highlighting. ● Stats. ● Dynamic fields. Agenda
  • 5. ➢ Text fields will be full-text searchable. Other fields (e.g., integer and string) can be used to scope queries. Setting Up Objects
  • 8. ➢ phrase searches are represented as a double quoted group of words. ➢ query_phrase_slop sets the number of words that may appear between the words in a phrase. Search In Depth - cont. ● Phrases
  • 9. Search In Depth - cont. ● Phrase boosts
  • 10. ➢ Fields not defined as text (e.g., integer, boolean, time, etc...) can be used to scope (restrict) queries before full-text matching is performed. Search In Depth - cont. ● Scoping (Scalar Fields)
  • 11. Search In Depth - cont. ● Disjunctions and Conjunctions
  • 12. ➢ The results array that is returned has methods mixed in that allow it to operate seamlessly with common pagination libraries like will_paginate and kaminari. ➢ By default, Sunspot requests the first 30 results from Solr Search In Depth - cont. ● Pagination
  • 13. Faceting ➢ Faceting is a feature of Solr that determines the number of documents that match a given search and an additional criterion. This allows you to build powerful drill-down interfaces for search. ➢ Each facet returns zero or more rows, each of which represents a particular criterion conjoined with the actual query being performed. For field facets, each row represents a particular value for a given field. For query facets, each row represents an arbitrary scope; the facet itself is just a means of logically grouping the scopes. ➢ By default Sunspot will only return the first 100 facet values. You can increase this limit, or force it to return all facets by setting limit to -1.
  • 14. Faceting - cont. ● Field Facets
  • 15. Faceting - cont. ● Query Facets
  • 16. Faceting - cont. ● Range Facets
  • 17. ➢ By default Sunspot orders results by "score": the Solr-determined relevancy metric. Sorting can be customized with the order_by method. Ordering
  • 18. ➢ Solr supports sorting on multiple fields using custom functions (Solr 3.1 and above). Ordering by function
  • 19. ➢ Solr supports grouping documents, similar to an SQL GROUP BY. ➢ Grouping is only supported on string fields that are not multivalued. To group on a field of a different type (e.g., integer), add a denormalized string type. Grouping
  • 21. ➢ Filter By Radius. ➢ Sort By Distance.
  • 22. ➢ Highlighting allows you to display snippets of the part of the document that matched the query. Highlighting
  • 24. ● Solr can return some statistics on indexed numeric fields. Fetching statistics for average_rating. ○ Stats on multiple fields. ○ Faceting on stats. Stats
  • 25. Dynamic Fields Dynamic fields allow Solr to index fields that you did not explicitly define in your schema. This is useful if you discover you have forgotten to define one or more fields. Dynamic fields can make your application less brittle by providing some flexibility in the documents you can add to Solr. Note: you can’t define a dynamic_text field. Hence, it is not possible to do a fulltext search on dynamic fields.
  • 26. class MyClass searchable do dynamic_integer :custom_category_ids, :multiple => true do custom_categories.inject(Hash.new { |h, k| h[k] = [] }) do |map, custom_category| map[custom_category.name] << custom_category_values_for(custom_category) map end end end end search = MyClass.search do dynamic(:custom_categories) do facet(some_custom_category.id) end end facet = search.facet(:custom_categories, some_custom_category.name) Dynamic Fields
  • 27. References ● https://github.com/sunspot/sunspot ● https://github.com/sunspot/sunspot/wiki/Dynamic-fields ● https://en.wikipedia.org/wiki/Apache_Solr ● https://wiki.apache.org/solr