SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
Hibernate Search
           Googling your persistence domain model



        Emmanuel Bernard
        Doer
        JBoss, a division of Red Hat
                           Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Search: left over
                         of today’s applications

         Add search dimension to the domain model


           “Frankly, search sucks on this project”
                                              -- Anonymous’ boss

                 Why? How to fix that? For cheap?



                                                                2
                                Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Integrate full-text search and
                persistent domain

         SQL Search vs Full-text Search
         Object model / Full-text Search mismatches
             Demo
         Hibernate Search architecture
         Configuration and Mapping
         Full-text based object queries
         Some more features



                                                           3
                           Copyright Red Hat © 2007-2009


Monday, April 20, 2009
SQL search limits

         Wildcard / word search
             ‘%hibernate%’
         Approximation (or synonym)
             ‘hybernat’
         Proximity
             ‘Java’ close to ‘Persistence’
         Relevance or (result scoring)
         multi-”column” search

                                                                4
                                Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Full Text Search

         Search information
             by word
             inverted indices (word frequency, position)


         In RDBMS engines
             portability (proprietary add-on on top of SQL)
             flexibility
         Standalone engine
             Apache Lucene(tm) http://lucene.apache.org
                                                               5
                               Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Mismatches with a domain model

         Structural mismatch                                      Appl
                                                                  Fwk
             full text index are text only
             no reference/association between document                   Persistence


         Synchronization mismatch
             keeping index and database up to date
         Retrieval mismatch
                                                                             Domain
             the index does not store objects                                 Model
                                                                Search
             certainly not managed objects


                                                                         6
                                Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Demo
           Let’s google our application!




                                                          7
                          Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Hibernate Search

         Under the Hibernate platform
             LGPL
         Built on top of Hibernate Core
         Use Apache Lucene(tm) under the hood
             In top 10 downloaded at Apache                   JBoss Seam


             Very powerful but low level




                                                                                  e
                                                               Appl




                                                                                 nc
                                                                            te
                                                               Fwk




                                                                            is
             easy to use it the “wrong” way




                                                                           rs
                                                                       Pe
         Solve the mismatches                                          Domain
                                                              Search
                                                                        Model



                                                                                  8
                              Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Architecture

              Transparent indexing through event system (JPA)
                  PERSIST / UPDATE / DELETE
              Convert the object structure into Index structure
              Operation batching per transaction
                  better Lucene performance
                  “ACID”-ity
                  (pluggable scope)
              Backend
                  synchronous / asynchronous mode
                  Lucene, JMS                                   9
                                Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Architecture (Backend)

              Lucene Directory
                  standalone or symmetric cluster (limited scalability)
                  immediate visibility
                  can aect front end runtime

                             Hibernate
                                 +
                         Hibernate Search
                                            Search request
                                             Index update             Lucene
                                                                     Directory
                                                                                 Database
                                                                      (Index)
                                            Search request
                                             Index update
                             Hibernate
                                 +
                         Hibernate Search
                                                                                            10
                                             Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Architecture (Backend)

                JMS (Cluster)
                    Search processed locally / Change sent to master
                    asynchronous indexing (delay)
                    No front end extra cost / good scalability

                                                 Slave
                             Hibernate                                                             Database
                                                                      Lucene
                                 +                                    Directory
                                              Search request
                         Hibernate Search                              (Index)
                                                                        Copy



                                                                                            Copy
                            Index update order


                                                                                    Master
                                                                    Hibernate                        Lucene
                                                                        +                           Directory
                                                                                   Index update
                                                                Hibernate Search                     (Index)
                                                 Process
                                       JMS
                                                                                                     Master
                                      queue


                                                                                                                11
                                                   Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Configuration and Mapping

         Configuration
             event listener wiring
              transparent in Hibernate Annotations
             Backend configuration


         Mapping: annotation based
             @Indexed
             @Field(store, index)
             @IndexedEmbedded
             @FieldBridge
                                                                12
                                Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Query

         Retrieve objects, not documents
             no boilerplate conversion code!
         Objects from the Persistence Context
             same semantic as a JPA-QL or Criteria query
         Use org.hibernate.Query/javax.persistence.Query
             common API for all your queries
         Query on correlated objects
             “JOIN”-like query quot;author.address.city:Atlantaquot;



                                                               13
                               Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Query possibilities

         bring the “best” document first
         recover from typos
         recover from faulty orthography
         find from words with the same meaning
         find words from the same family
         find an exact phrase
         find similar documents



                                                              14
                              Copyright Red Hat © 2007-2009


Monday, April 20, 2009
More query features

         Fine grained fetching strategy
         Sort by property rather than relevance
         Projection (both field and metadata)
             metadata: SCORE, ID, BOOST etc
             no DB / Persistence Context access
         Filters
             security / temporal data / category
         Total number of results

                                                              15
                              Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Some more features

              Automatic index optimization
              Index sharding
              Manual indexing and purging
                  non event-based system
              Shared Lucene resources
              Native Lucene access




                                                               16
                               Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Full-Text search without the
                       hassle

         Transparent index synchronization
         Automatic Structural conversion through Mapping
         No paradigm shift when retrieving data


         Clustering capability out of the box


         Easier / transparent optimized Lucene use



                                                           17
                           Copyright Red Hat © 2007-2009


Monday, April 20, 2009
Road Map

         Programmatic Mapping API Perf
         Multi threaded mass index
         Clustering
         Query
              Dictionary and spellchecker
              Easier query building
              MoreLikeThis?
         Statistics
                                            18



Monday, April 20, 2009
QA



                                                         19
                         Copyright Red Hat © 2007-2009


Monday, April 20, 2009
For More Information

              Hibernate Search
                  http://search.hibernate.org
                  Hibernate Search in Action
              Apache Lucene
                  http://lucene.apache.org
                  Lucene In Action
              http://in.relation.to
              http://blog.emmanuelbernard.com


                                                                20
                                Copyright Red Hat © 2007-2009


Monday, April 20, 2009

Contenu connexe

En vedette

Ethics For Emerging Generations Sample
Ethics For Emerging Generations  SampleEthics For Emerging Generations  Sample
Ethics For Emerging Generations SampleAl Serino
 
June Presentation Overview
June Presentation OverviewJune Presentation Overview
June Presentation OverviewAl Serino
 
FormValidator::Assets
FormValidator::AssetsFormValidator::Assets
FormValidator::Assetstypester
 
5 Strategies Day One Handout Teen Leadership May 22
5 Strategies Day One Handout  Teen Leadership  May 225 Strategies Day One Handout  Teen Leadership  May 22
5 Strategies Day One Handout Teen Leadership May 22Al Serino
 
Leadership in the 21st Century
Leadership in the 21st CenturyLeadership in the 21st Century
Leadership in the 21st CenturyAl Serino
 
MongoDB for storing humongous music database
MongoDB for storing humongous music databaseMongoDB for storing humongous music database
MongoDB for storing humongous music databasePrasoon Kumar
 
Christian leadership
Christian leadershipChristian leadership
Christian leadershipDon_Pranxter
 
Lead Humbly: The Path of Servant Leadership
Lead Humbly: The Path of Servant Leadership Lead Humbly: The Path of Servant Leadership
Lead Humbly: The Path of Servant Leadership Lindy Ryan
 

En vedette (9)

Ethics For Emerging Generations Sample
Ethics For Emerging Generations  SampleEthics For Emerging Generations  Sample
Ethics For Emerging Generations Sample
 
June Presentation Overview
June Presentation OverviewJune Presentation Overview
June Presentation Overview
 
Node js
Node jsNode js
Node js
 
FormValidator::Assets
FormValidator::AssetsFormValidator::Assets
FormValidator::Assets
 
5 Strategies Day One Handout Teen Leadership May 22
5 Strategies Day One Handout  Teen Leadership  May 225 Strategies Day One Handout  Teen Leadership  May 22
5 Strategies Day One Handout Teen Leadership May 22
 
Leadership in the 21st Century
Leadership in the 21st CenturyLeadership in the 21st Century
Leadership in the 21st Century
 
MongoDB for storing humongous music database
MongoDB for storing humongous music databaseMongoDB for storing humongous music database
MongoDB for storing humongous music database
 
Christian leadership
Christian leadershipChristian leadership
Christian leadership
 
Lead Humbly: The Path of Servant Leadership
Lead Humbly: The Path of Servant Leadership Lead Humbly: The Path of Servant Leadership
Lead Humbly: The Path of Servant Leadership
 

Similaire à Hibernate Search Seam 1.5

04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment Workshop04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment WorkshopChuong Nguyen
 
CRX Best practices
CRX Best practicesCRX Best practices
CRX Best practiceslisui0807
 
Web Queries: From a Web of Data to a Semantic Web
Web Queries: From a Web of Data to a Semantic WebWeb Queries: From a Web of Data to a Semantic Web
Web Queries: From a Web of Data to a Semantic WebTim Furche
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiCédric Hüsler
 
Gemfire Sqlfire - La Marmite NoSql
Gemfire Sqlfire - La Marmite NoSqlGemfire Sqlfire - La Marmite NoSql
Gemfire Sqlfire - La Marmite NoSqlDuchess France
 
Developer's Most Frequent Hadoop Headaches & How to Address Them__HadoopSumm...
Developer's Most Frequent Hadoop Headaches &  How to Address Them__HadoopSumm...Developer's Most Frequent Hadoop Headaches &  How to Address Them__HadoopSumm...
Developer's Most Frequent Hadoop Headaches & How to Address Them__HadoopSumm...Yahoo Developer Network
 
Virtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireVirtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireCarter Shanklin
 
Introduction To J Boss Seam
Introduction To J Boss SeamIntroduction To J Boss Seam
Introduction To J Boss Seamashishkulkarni
 
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the CloudJavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the CloudAaron Walker
 
Cloudcamp Athens 2011 Presenting Heroku
Cloudcamp Athens 2011 Presenting HerokuCloudcamp Athens 2011 Presenting Heroku
Cloudcamp Athens 2011 Presenting HerokuSavvas Georgiou
 
Mark Logic Information Analysis Trends Webinar
Mark Logic Information Analysis Trends WebinarMark Logic Information Analysis Trends Webinar
Mark Logic Information Analysis Trends WebinarDave Kellogg
 
Cloud foundry elastic architecture and deploy based on openstack
Cloud foundry elastic architecture and deploy based on openstackCloud foundry elastic architecture and deploy based on openstack
Cloud foundry elastic architecture and deploy based on openstackOpenCity Community
 
RESTful SOA and the Spring Framework (EMCWorld 2011)
RESTful SOA and the Spring Framework (EMCWorld 2011)RESTful SOA and the Spring Framework (EMCWorld 2011)
RESTful SOA and the Spring Framework (EMCWorld 2011)EMC
 
VMware, Storage & Kitchen appliances
VMware, Storage & Kitchen appliancesVMware, Storage & Kitchen appliances
VMware, Storage & Kitchen appliancessubtitle
 
Cloumon enterprise
Cloumon enterpriseCloumon enterprise
Cloumon enterpriseGruter
 

Similaire à Hibernate Search Seam 1.5 (20)

04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment Workshop04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment Workshop
 
CRX Best practices
CRX Best practicesCRX Best practices
CRX Best practices
 
Search Computing Overview
Search Computing OverviewSearch Computing Overview
Search Computing Overview
 
Web Queries: From a Web of Data to a Semantic Web
Web Queries: From a Web of Data to a Semantic WebWeb Queries: From a Web of Data to a Semantic Web
Web Queries: From a Web of Data to a Semantic Web
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGi
 
Otago vre-overview
Otago vre-overviewOtago vre-overview
Otago vre-overview
 
Gemfire Sqlfire - La Marmite NoSql
Gemfire Sqlfire - La Marmite NoSqlGemfire Sqlfire - La Marmite NoSql
Gemfire Sqlfire - La Marmite NoSql
 
Developer's Most Frequent Hadoop Headaches & How to Address Them__HadoopSumm...
Developer's Most Frequent Hadoop Headaches &  How to Address Them__HadoopSumm...Developer's Most Frequent Hadoop Headaches &  How to Address Them__HadoopSumm...
Developer's Most Frequent Hadoop Headaches & How to Address Them__HadoopSumm...
 
Virtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireVirtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFire
 
Introduction To J Boss Seam
Introduction To J Boss SeamIntroduction To J Boss Seam
Introduction To J Boss Seam
 
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the CloudJavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
 
Cloudcamp Athens 2011 Presenting Heroku
Cloudcamp Athens 2011 Presenting HerokuCloudcamp Athens 2011 Presenting Heroku
Cloudcamp Athens 2011 Presenting Heroku
 
Os Pittaro
Os PittaroOs Pittaro
Os Pittaro
 
Mark Logic Information Analysis Trends Webinar
Mark Logic Information Analysis Trends WebinarMark Logic Information Analysis Trends Webinar
Mark Logic Information Analysis Trends Webinar
 
Cloud foundry elastic architecture and deploy based on openstack
Cloud foundry elastic architecture and deploy based on openstackCloud foundry elastic architecture and deploy based on openstack
Cloud foundry elastic architecture and deploy based on openstack
 
Bca1931 final
Bca1931 finalBca1931 final
Bca1931 final
 
RESTful SOA and the Spring Framework (EMCWorld 2011)
RESTful SOA and the Spring Framework (EMCWorld 2011)RESTful SOA and the Spring Framework (EMCWorld 2011)
RESTful SOA and the Spring Framework (EMCWorld 2011)
 
VMware, Storage & Kitchen appliances
VMware, Storage & Kitchen appliancesVMware, Storage & Kitchen appliances
VMware, Storage & Kitchen appliances
 
Prospectus presentation
Prospectus presentation Prospectus presentation
Prospectus presentation
 
Cloumon enterprise
Cloumon enterpriseCloumon enterprise
Cloumon enterprise
 

Dernier

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Dernier (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Hibernate Search Seam 1.5

  • 1. Hibernate Search Googling your persistence domain model Emmanuel Bernard Doer JBoss, a division of Red Hat Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 2. Search: left over of today’s applications Add search dimension to the domain model “Frankly, search sucks on this project” -- Anonymous’ boss Why? How to fix that? For cheap? 2 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 3. Integrate full-text search and persistent domain SQL Search vs Full-text Search Object model / Full-text Search mismatches Demo Hibernate Search architecture Configuration and Mapping Full-text based object queries Some more features 3 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 4. SQL search limits Wildcard / word search ‘%hibernate%’ Approximation (or synonym) ‘hybernat’ Proximity ‘Java’ close to ‘Persistence’ Relevance or (result scoring) multi-”column” search 4 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 5. Full Text Search Search information by word inverted indices (word frequency, position) In RDBMS engines portability (proprietary add-on on top of SQL) flexibility Standalone engine Apache Lucene(tm) http://lucene.apache.org 5 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 6. Mismatches with a domain model Structural mismatch Appl Fwk full text index are text only no reference/association between document Persistence Synchronization mismatch keeping index and database up to date Retrieval mismatch Domain the index does not store objects Model Search certainly not managed objects 6 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 7. Demo Let’s google our application! 7 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 8. Hibernate Search Under the Hibernate platform LGPL Built on top of Hibernate Core Use Apache Lucene(tm) under the hood In top 10 downloaded at Apache JBoss Seam Very powerful but low level e Appl nc te Fwk is easy to use it the “wrong” way rs Pe Solve the mismatches Domain Search Model 8 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 9. Architecture Transparent indexing through event system (JPA) PERSIST / UPDATE / DELETE Convert the object structure into Index structure Operation batching per transaction better Lucene performance “ACID”-ity (pluggable scope) Backend synchronous / asynchronous mode Lucene, JMS 9 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 10. Architecture (Backend) Lucene Directory standalone or symmetric cluster (limited scalability) immediate visibility can aect front end runtime Hibernate + Hibernate Search Search request Index update Lucene Directory Database (Index) Search request Index update Hibernate + Hibernate Search 10 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 11. Architecture (Backend) JMS (Cluster) Search processed locally / Change sent to master asynchronous indexing (delay) No front end extra cost / good scalability Slave Hibernate Database Lucene + Directory Search request Hibernate Search (Index) Copy Copy Index update order Master Hibernate Lucene + Directory Index update Hibernate Search (Index) Process JMS Master queue 11 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 12. Configuration and Mapping Configuration event listener wiring transparent in Hibernate Annotations Backend configuration Mapping: annotation based @Indexed @Field(store, index) @IndexedEmbedded @FieldBridge 12 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 13. Query Retrieve objects, not documents no boilerplate conversion code! Objects from the Persistence Context same semantic as a JPA-QL or Criteria query Use org.hibernate.Query/javax.persistence.Query common API for all your queries Query on correlated objects “JOIN”-like query quot;author.address.city:Atlantaquot; 13 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 14. Query possibilities bring the “best” document first recover from typos recover from faulty orthography find from words with the same meaning find words from the same family find an exact phrase find similar documents 14 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 15. More query features Fine grained fetching strategy Sort by property rather than relevance Projection (both field and metadata) metadata: SCORE, ID, BOOST etc no DB / Persistence Context access Filters security / temporal data / category Total number of results 15 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 16. Some more features Automatic index optimization Index sharding Manual indexing and purging non event-based system Shared Lucene resources Native Lucene access 16 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 17. Full-Text search without the hassle Transparent index synchronization Automatic Structural conversion through Mapping No paradigm shift when retrieving data Clustering capability out of the box Easier / transparent optimized Lucene use 17 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 18. Road Map Programmatic Mapping API Perf Multi threaded mass index Clustering Query Dictionary and spellchecker Easier query building MoreLikeThis? Statistics 18 Monday, April 20, 2009
  • 19. QA 19 Copyright Red Hat © 2007-2009 Monday, April 20, 2009
  • 20. For More Information Hibernate Search http://search.hibernate.org Hibernate Search in Action Apache Lucene http://lucene.apache.org Lucene In Action http://in.relation.to http://blog.emmanuelbernard.com 20 Copyright Red Hat © 2007-2009 Monday, April 20, 2009