SlideShare a Scribd company logo
1 of 21
A Presentation by
Content :
   What Is Query Builder?
   Example usages
   Why Query Builder?
   Query Builder Debugger
   Anatomy of a query
   Predicate resolution & execution
   Standard predicates
   Ordering
   Grouping of predicates
   Facets
   Sample Queries
   Javadoc Links
   Query Builder Demo
   References

                                   A Presentation by
What is QueryBuilder
 QueryBuilder    is a service for building Queries searching
  the Java Content Repository and which are easily
  extensible
 A Query represents a JCR repository query that can be
  created programmatically, with a list of so-called
  Predicates
 A Predicate is a single constraint for a Query. It is a pure
  data model object, consisting of a parameter map based
  on key-value string pairs.
 This service allows to create queries with several
  convenience methods
 In addition, it allows to store queries in the repository
  and load them again.

                                   A Presentation by
Example usages




                 A Presentation by
Why Query Builder?
 Because  QueryBuilder is...
   an API to build queries for a query engine (JCR XPath
    underneath)
   especially via URL query parameters (GET & POSTs)
   compatible with HTML forms
   allowing to add/remove conditions (“predicates”)
    individually
   allowing copy/paste of queries
   easily extensible
   providing some goodies (e.g. facets)




                                A Presentation by
Query Builder Debugger




                         A Presentation by
Anatomy of a query




                     A Presentation by
Predicate resolution & execution
 Internally,
            a predicate evaluator is resolved
 Based on the type
 OSGi component (using factories)
 Handles:
     mapping to xpath (required)
     filtering of results
     custom ordering mechanism
     facet extraction
 Multiple   predicates of the same type(define an order)




                                       A Presentation by
Standard predicates
 path                           range
     supports multiple paths    daterange
     but beware: can be slow    similar
 property                           rep:similar
     JCR property               tagid& tag
     different operations       language
 type                               page languages
     node type                  event
 fulltext                           calendar
     full text search               example for shortening




                                   A Presentation by
Ordering
   Use (special) orderby predicate
       sort ascending by default, use orderby.desc=true for descending
   (1) Order by JCR properties
       orderby=@cq:tags
       orderby=@jcr:content/cq:tags
   (2) Reference predicate by name
       orderby=1_property
       predicate evaluator must provide ordering
       simply a list of properties (=> used in xpath query)
       or a custom Comparator (=> run after filtering)
   Multiple orderings
       1_orderby=@cq:tags
       2_orderby=@cq:lastModified
       3_orderby=nodename


                                              A Presentation by
Grouping of predicates




                         A Presentation by
Facets
  Extract set of possible values found in current result
  Options for a more specific query
  Facet = set of buckets
      Facet = tag
      Buckets = product, business, marketing
  Buckets    can also be custom ranges
      Facet = daterange
      Buckets = yesterday, last week, last year...




                                       A Presentation by
Sample Queries




                 A Presentation by
Sample Queries




                 A Presentation by
Sample Queries




                 A Presentation by
Sample Queries




                 A Presentation by
Javadoc Links

Javadoc                               Description
com.day.cq.search                     Basic QueryBuilder and Query API


com.day.cq.search.result              Result API
com.day.cq.search.facets              Facets
com.day.cq.search.facets.buckets      Buckets (contained within facets)


com.day.cq.search.eval                Predicate Evaluators
com.day.cq.search.facets.extractors   Facet Extractors (for evaluators)


com.day.cq.search.writer              JSON Result Hit Writer for Querybuilder
                                      servlet (/bin/querybuilder.json)




                                               A Presentation by
Query Builder Demo

  Create a getimages component
  Include that component on content
   page




                          A Presentation by
Query Builder Demo
  getimages.jsp   contains QueryBuilder API




                             A Presentation by
Query Builder Demo
 This
     component is used to get images from
  dam:Asset/jcr:content/image/jpeg tag




                          A Presentation by
References

 http://dev.day.com/docs/en/cq/current/da
  m/customizing_and_extendingcq5dam/quer
  y_builder.html
 http://dev.day.com/docs/en/cq/current/jav
  adoc/com/day/cq/search/QueryBuilder.html
 www.pro-
  vision.de/adaptto/downloads/2011_querybuil
  der.pdf
 http://dev.day.com/docs/en/cq/current/jav
  adoc/com/day/cq/search/Query.html



                          A Presentation by

More Related Content

What's hot (20)

Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
 
Jsf
JsfJsf
Jsf
 
HTL(Sightly) - All you need to know
HTL(Sightly) - All you need to knowHTL(Sightly) - All you need to know
HTL(Sightly) - All you need to know
 
Java collections concept
Java collections conceptJava collections concept
Java collections concept
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
Spring Core
Spring CoreSpring Core
Spring Core
 
ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and Skinning
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
React workshop
React workshopReact workshop
React workshop
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
class diagram
class diagramclass diagram
class diagram
 
Spring jdbc
Spring jdbcSpring jdbc
Spring jdbc
 
Mysql creating stored function
Mysql  creating stored function Mysql  creating stored function
Mysql creating stored function
 
Collections Api - Java
Collections Api - JavaCollections Api - Java
Collections Api - Java
 
Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introduction
 
Design patterns
Design patternsDesign patterns
Design patterns
 
System.data.sqlclient
System.data.sqlclientSystem.data.sqlclient
System.data.sqlclient
 
Programación Orientada a Objetos
Programación Orientada a ObjetosProgramación Orientada a Objetos
Programación Orientada a Objetos
 
Uml diagrama clase objeto
Uml diagrama clase objetoUml diagrama clase objeto
Uml diagrama clase objeto
 

Viewers also liked

CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011Alexander Klimetschek
 
Apache SOLR in AEM 6
Apache SOLR in AEM 6Apache SOLR in AEM 6
Apache SOLR in AEM 6Yash Mody
 
Query Analyser , SQL Server Groups, Transact –SQL
Query Analyser , SQL Server Groups, Transact –SQLQuery Analyser , SQL Server Groups, Transact –SQL
Query Analyser , SQL Server Groups, Transact –SQLKomal Batra
 
SentricWorkforce Query Builder
SentricWorkforce Query BuilderSentricWorkforce Query Builder
SentricWorkforce Query BuilderSentricTraining
 
Addmi 10-query builder
Addmi 10-query  builderAddmi 10-query  builder
Addmi 10-query builderodanyboy
 
Addmi 09.5-analysis ui-host-grouping
Addmi 09.5-analysis ui-host-groupingAddmi 09.5-analysis ui-host-grouping
Addmi 09.5-analysis ui-host-groupingodanyboy
 
Do you need an external search platform for Adobe Experience Manager?
Do you need an external search platform for Adobe Experience Manager?Do you need an external search platform for Adobe Experience Manager?
Do you need an external search platform for Adobe Experience Manager?therealgaston
 
Omnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the ThingsOmnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the ThingsJustin Edelson
 
Implementing Site Search in CQ5 / AEM
Implementing Site Search in CQ5 / AEMImplementing Site Search in CQ5 / AEM
Implementing Site Search in CQ5 / AEMrtpaem
 
Graphical Password Authentication
Graphical Password AuthenticationGraphical Password Authentication
Graphical Password AuthenticationDhvani Shah
 
AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013Andrew Khoury
 
Graphical Password authentication using Hmac
Graphical Password authentication using HmacGraphical Password authentication using Hmac
Graphical Password authentication using HmacArpana shree
 
Introduction to Sightly and Sling Models
Introduction to Sightly and Sling ModelsIntroduction to Sightly and Sling Models
Introduction to Sightly and Sling ModelsStefano Celentano
 
Image Based Password Authentication for Illiterate using Touch screen by Deep...
Image Based Password Authentication for Illiterate using Touch screen by Deep...Image Based Password Authentication for Illiterate using Touch screen by Deep...
Image Based Password Authentication for Illiterate using Touch screen by Deep...Deepak Yadav
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAshokkumar T A
 
Graphical password authentication system ppts
Graphical password authentication system pptsGraphical password authentication system ppts
Graphical password authentication system pptsNimisha_Goel
 

Viewers also liked (20)

CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011
 
Apache SOLR in AEM 6
Apache SOLR in AEM 6Apache SOLR in AEM 6
Apache SOLR in AEM 6
 
Virus and antivirus
Virus and antivirusVirus and antivirus
Virus and antivirus
 
Query Analyser , SQL Server Groups, Transact –SQL
Query Analyser , SQL Server Groups, Transact –SQLQuery Analyser , SQL Server Groups, Transact –SQL
Query Analyser , SQL Server Groups, Transact –SQL
 
SAP R3 SQL Query Builder
SAP R3 SQL Query BuilderSAP R3 SQL Query Builder
SAP R3 SQL Query Builder
 
SentricWorkforce Query Builder
SentricWorkforce Query BuilderSentricWorkforce Query Builder
SentricWorkforce Query Builder
 
Addmi 10-query builder
Addmi 10-query  builderAddmi 10-query  builder
Addmi 10-query builder
 
Addmi 09.5-analysis ui-host-grouping
Addmi 09.5-analysis ui-host-groupingAddmi 09.5-analysis ui-host-grouping
Addmi 09.5-analysis ui-host-grouping
 
Do you need an external search platform for Adobe Experience Manager?
Do you need an external search platform for Adobe Experience Manager?Do you need an external search platform for Adobe Experience Manager?
Do you need an external search platform for Adobe Experience Manager?
 
Omnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the ThingsOmnisearch in AEM 6.2 - Search All the Things
Omnisearch in AEM 6.2 - Search All the Things
 
Implementing Site Search in CQ5 / AEM
Implementing Site Search in CQ5 / AEMImplementing Site Search in CQ5 / AEM
Implementing Site Search in CQ5 / AEM
 
11aman
11aman11aman
11aman
 
Graphical Password Authentication
Graphical Password AuthenticationGraphical Password Authentication
Graphical Password Authentication
 
AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013
 
Graphical Password authentication using Hmac
Graphical Password authentication using HmacGraphical Password authentication using Hmac
Graphical Password authentication using Hmac
 
Image based authentication
Image based authenticationImage based authentication
Image based authentication
 
Introduction to Sightly and Sling Models
Introduction to Sightly and Sling ModelsIntroduction to Sightly and Sling Models
Introduction to Sightly and Sling Models
 
Image Based Password Authentication for Illiterate using Touch screen by Deep...
Image Based Password Authentication for Illiterate using Touch screen by Deep...Image Based Password Authentication for Illiterate using Touch screen by Deep...
Image Based Password Authentication for Illiterate using Touch screen by Deep...
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricks
 
Graphical password authentication system ppts
Graphical password authentication system pptsGraphical password authentication system ppts
Graphical password authentication system ppts
 

Similar to Quiery builder

Curriculum outline
Curriculum outlineCurriculum outline
Curriculum outlineDipin Sharma
 
Java se 8 fundamentals
Java se 8 fundamentalsJava se 8 fundamentals
Java se 8 fundamentalsmegharajk
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Michał Orman
 
ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)Lucas Jellema
 
Javascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsJavascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsSalesforce Developers
 
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...Julian Hyde
 
Spring db-access mod03
Spring db-access mod03Spring db-access mod03
Spring db-access mod03Guo Albert
 
3 rad extensibility-srilakshmi_s_rajesh_k
3 rad extensibility-srilakshmi_s_rajesh_k3 rad extensibility-srilakshmi_s_rajesh_k
3 rad extensibility-srilakshmi_s_rajesh_kIBM
 
Rad Extensibility - Srilakshmi S Rajesh K
Rad Extensibility - Srilakshmi S Rajesh KRad Extensibility - Srilakshmi S Rajesh K
Rad Extensibility - Srilakshmi S Rajesh KRoopa Nadkarni
 
Qtp training in hyderabad
Qtp training in hyderabadQtp training in hyderabad
Qtp training in hyderabadG.C Reddy
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New EvolutionAllan Huang
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3Oracle
 
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...Edureka!
 

Similar to Quiery builder (20)

Curriculum outline
Curriculum outlineCurriculum outline
Curriculum outline
 
Java se 8 fundamentals
Java se 8 fundamentalsJava se 8 fundamentals
Java se 8 fundamentals
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
 
ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
 
Javascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsJavascript-heavy Salesforce Applications
Javascript-heavy Salesforce Applications
 
Java SE 8 & EE 7 Launch
Java SE 8 & EE 7 LaunchJava SE 8 & EE 7 Launch
Java SE 8 & EE 7 Launch
 
Lift Framework
Lift FrameworkLift Framework
Lift Framework
 
Java scriptforjavadev part2a
Java scriptforjavadev part2aJava scriptforjavadev part2a
Java scriptforjavadev part2a
 
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
 
Spring db-access mod03
Spring db-access mod03Spring db-access mod03
Spring db-access mod03
 
3 rad extensibility-srilakshmi_s_rajesh_k
3 rad extensibility-srilakshmi_s_rajesh_k3 rad extensibility-srilakshmi_s_rajesh_k
3 rad extensibility-srilakshmi_s_rajesh_k
 
Rad Extensibility - Srilakshmi S Rajesh K
Rad Extensibility - Srilakshmi S Rajesh KRad Extensibility - Srilakshmi S Rajesh K
Rad Extensibility - Srilakshmi S Rajesh K
 
Qtp syllabus
Qtp syllabus Qtp syllabus
Qtp syllabus
 
Qtp training in hyderabad
Qtp training in hyderabadQtp training in hyderabad
Qtp training in hyderabad
 
Azure cosmosdb
Azure cosmosdbAzure cosmosdb
Azure cosmosdb
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Recently uploaded (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

Quiery builder

  • 2. Content :  What Is Query Builder?  Example usages  Why Query Builder?  Query Builder Debugger  Anatomy of a query  Predicate resolution & execution  Standard predicates  Ordering  Grouping of predicates  Facets  Sample Queries  Javadoc Links  Query Builder Demo  References A Presentation by
  • 3. What is QueryBuilder  QueryBuilder is a service for building Queries searching the Java Content Repository and which are easily extensible  A Query represents a JCR repository query that can be created programmatically, with a list of so-called Predicates  A Predicate is a single constraint for a Query. It is a pure data model object, consisting of a parameter map based on key-value string pairs.  This service allows to create queries with several convenience methods  In addition, it allows to store queries in the repository and load them again. A Presentation by
  • 4. Example usages A Presentation by
  • 5. Why Query Builder?  Because QueryBuilder is...  an API to build queries for a query engine (JCR XPath underneath)  especially via URL query parameters (GET & POSTs)  compatible with HTML forms  allowing to add/remove conditions (“predicates”) individually  allowing copy/paste of queries  easily extensible  providing some goodies (e.g. facets) A Presentation by
  • 6. Query Builder Debugger A Presentation by
  • 7. Anatomy of a query A Presentation by
  • 8. Predicate resolution & execution  Internally, a predicate evaluator is resolved  Based on the type  OSGi component (using factories)  Handles:  mapping to xpath (required)  filtering of results  custom ordering mechanism  facet extraction  Multiple predicates of the same type(define an order) A Presentation by
  • 9. Standard predicates  path  range  supports multiple paths  daterange  but beware: can be slow  similar  property  rep:similar  JCR property  tagid& tag  different operations  language  type  page languages  node type  event  fulltext  calendar  full text search  example for shortening A Presentation by
  • 10. Ordering  Use (special) orderby predicate  sort ascending by default, use orderby.desc=true for descending  (1) Order by JCR properties  orderby=@cq:tags  orderby=@jcr:content/cq:tags  (2) Reference predicate by name  orderby=1_property  predicate evaluator must provide ordering  simply a list of properties (=> used in xpath query)  or a custom Comparator (=> run after filtering)  Multiple orderings  1_orderby=@cq:tags  2_orderby=@cq:lastModified  3_orderby=nodename A Presentation by
  • 11. Grouping of predicates A Presentation by
  • 12. Facets  Extract set of possible values found in current result  Options for a more specific query  Facet = set of buckets  Facet = tag  Buckets = product, business, marketing  Buckets can also be custom ranges  Facet = daterange  Buckets = yesterday, last week, last year... A Presentation by
  • 13. Sample Queries A Presentation by
  • 14. Sample Queries A Presentation by
  • 15. Sample Queries A Presentation by
  • 16. Sample Queries A Presentation by
  • 17. Javadoc Links Javadoc Description com.day.cq.search Basic QueryBuilder and Query API com.day.cq.search.result Result API com.day.cq.search.facets Facets com.day.cq.search.facets.buckets Buckets (contained within facets) com.day.cq.search.eval Predicate Evaluators com.day.cq.search.facets.extractors Facet Extractors (for evaluators) com.day.cq.search.writer JSON Result Hit Writer for Querybuilder servlet (/bin/querybuilder.json) A Presentation by
  • 18. Query Builder Demo  Create a getimages component  Include that component on content page A Presentation by
  • 19. Query Builder Demo  getimages.jsp contains QueryBuilder API A Presentation by
  • 20. Query Builder Demo  This component is used to get images from dam:Asset/jcr:content/image/jpeg tag A Presentation by
  • 21. References  http://dev.day.com/docs/en/cq/current/da m/customizing_and_extendingcq5dam/quer y_builder.html  http://dev.day.com/docs/en/cq/current/jav adoc/com/day/cq/search/QueryBuilder.html  www.pro- vision.de/adaptto/downloads/2011_querybuil der.pdf  http://dev.day.com/docs/en/cq/current/jav adoc/com/day/cq/search/Query.html A Presentation by