{"id":43,"date":"2012-12-05T15:47:47","date_gmt":"2012-12-05T14:47:47","guid":{"rendered":"http:\/\/www.francelabs.com\/blog\/?p=43"},"modified":"2013-03-15T12:17:06","modified_gmt":"2013-03-15T11:17:06","slug":"constellio-1-3-architecture-part-3","status":"publish","type":"post","link":"https:\/\/www.francelabs.com\/blog\/constellio-1-3-architecture-part-3\/","title":{"rendered":"Constellio 1.3 architecture part 3"},"content":{"rendered":"<p>Waiting for the 2.0 version of Constellio, we have decided to draw and explain the system architecture of Constellio 1.3<br \/>\nWe thought it could help better understanding the way things work. This entry does not cover how these components are mapped to java classes, servlets, files and databases, but it gives a good overview of how it works.<\/p>\n<p>This is the third and last entry of a series, as it would take too much time and space to explain all the components in one entry.<!--more--><\/p>\n<p>Before we explain the components, let us remember that search engines have 3 layers: the data retrieval layer (aka connectors), the indexing layer, and the searching layer. Wherever applicable, I\u2019ll use this terminology to detail the components.<\/p>\n<p>This <a title=\"Constellio 1.3 system architecture part 1\" href=\"https:\/\/www.francelabs.com\/blog\/constellio-1-3-architecture-part-1\/\">first entry already explains the data retrieval part<\/a>, while the <a title=\"Constellio 1.3 system architecture part 2\" href=\"https:\/\/www.francelabs.com\/blog\/constellio-1-3-architecture-part-2\/\"> second entry already explains the indexing part<\/a>.<br \/>\nIn this last entry, we focus on the querying and searching mechanisms.<\/p>\n<div id=\"attachment_8\" style=\"width: 1133px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.francelabs.com\/blog\/wp-content\/uploads\/2012\/10\/Constellio_Architecture_1.3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8\" class=\"size-full wp-image-8\" title=\"Constellio 1.3 system Architecture\" src=\"https:\/\/www.francelabs.com\/blog\/wp-content\/uploads\/2012\/10\/Constellio_Architecture_1.3.png\" alt=\"\" width=\"1123\" height=\"794\" \/><\/a><p id=\"caption-attachment-8\" class=\"wp-caption-text\">Constellio 1.3 Architecture<\/p><\/div>\n<p>It does not appear clearly in the architecture drawing, but Constellio leverages the java wicket framework for the UI aspects. Be it for the administration interface as well as the search user interface. We have also released in 2012 another type of UI, heavily relying on jquery and ajax, called <a title=\"AjaxFranceLabs\" href=\"http:\/\/www.francelabs.com\/fr\/AjaxFranceLabs\" target=\"_blank\">AjaxFranceLabs<\/a>. If you use AjaxFranceLabs, you end up calling the servlet named SolrServletPage.<br \/>\nIf you use the standard Constellio, leveraging the wickets, you don&#8217;t go through this serlvet. You&#8217;ll see that we directly call Solr in Constellio through an embedded Solr.<\/p>\n<p>Let&#8217;s take an example for this situation:<br \/>\nJeanjean is connected and authentified as a Constellio user. He sends the following request: [I want bread with my frog legs].<\/p>\n<p>Upon reception of the query, Constellio first stores the user name from the current session id which has been set up at the login phase. This may be leveraged by Constellio for the documents security aspects (you can have a look at <a title=\"Early binding in Constellio\" href=\"https:\/\/www.francelabs.com\/blog\/activating-early-binding-in-constellio-1-3\/\" target=\"_blank\">our entry on late\/early binding in Constellio<\/a> for that).<br \/>\nConstellio uses an embedded Solr which is used through the package com.doculibre.constellio.services (in particular anything that starts with facetServicesImpl, searchServicesImpl).<br \/>\nIf we make the assumption that there are facets in your configuration, Constellio will use facetServicesImpl. Constellio transforms the received query and sends it to Solr. Constellio receives the QueryResponse object. Note that regarding highlighting, Constellio overrides the org.apache.solr.highlight.defaultSolrHighlighter class, which is called by Solr. So the highlighting in 1.3 does not use the standard Solr highlight, but the modified class of Constellio, which uses a mix between the Lucene index and the constellio internal DB. <\/p>\n<p>The QueryResponse is then handed over to the wicketframework (through com.doculibre.constellio.wicket.panels.results.defaultSearchResultPanel).<br \/>\nThe page embedding all the other wickets is com.doculibre.constellio.wicket.pages.baseSearchPage, it&#8217;s the one which is triggered when calling the response page.<br \/>\nThis baseSearchPage calls all the wickets to be displayed, including for instance the defaultSearchResultPanel with the results, but also com.doculibre.constellio.wicket.panels.facets.facetsPanel which takes care of the facets.<\/p>\n<p>And there you are, you have a nice query displayed on the user screen.<\/p>\n<p>Don&#8217;t hesitate to share your thoughts with us.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Waiting for the 2.0 version of Constellio, we have decided to draw and explain the system architecture of Constellio 1.3 We thought it could help better understanding the way things work. This entry does not cover how these components are &hellip; <a href=\"https:\/\/www.francelabs.com\/blog\/constellio-1-3-architecture-part-3\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,1],"tags":[5,4,10,11],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-constellio","category-search","tag-architecture","tag-constellio-2","tag-query","tag-search-2"],"_links":{"self":[{"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":8,"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":133,"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/posts\/43\/revisions\/133"}],"wp:attachment":[{"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.francelabs.com\/blog\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}