Changes for page Release Notes for XWiki 6.0 Milestone 1
Last modified by Thomas Mortagne on 2017/03/24
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -95,6 +95,45 @@ 95 95 96 96 See the [[Solr common query parameters>>http://wiki.apache.org/solr/CommonQueryParameters]] and the [[Extended DisMax query parser parameters>>http://wiki.apache.org/solr/ExtendedDisMax#Parameters]] documentation for details on what parameters you can pass to the search engine. 97 97 98 +== Solr Search UI Configuration == 99 + 100 +We extracted the configuration parameters from the Solr Search UI code in a separate wiki page, ##Main.SolrSearchConfig##. This simplifies the process of customizing the search UI and more importantly allows application developers to easily create a dedicated search page for their application data. As an example, we updated the FAQ application to use the new configuration parameters: 101 + 102 +{{code language="none"}} 103 +{{include reference="XWiki.SearchCode"/}} 104 + 105 +{{velocity}} 106 +## 107 +## Customize the Solr Search UI. 108 +## 109 +#if ($searchEngine == 'solr') 110 + ## Create the configuration object. 111 + {{include reference="Main.SolrSearchConfig"/}} 112 +#end 113 +{{/velocity}} 114 +{{velocity output="false"}} 115 +#if ($solrConfig) 116 + ## Overwrite some configuration parameters. 117 + ## We don't use the Result Type facet because the result type is specified in the filter query below so we set the 118 + ## query and sort fields for all result types. 119 + #set ($discard = $solrConfig.queryFields.put($NULL, 'title^3 property.FAQCode.FAQClass.answer')) 120 + #set ($discard = $solrConfig.sortFields.put($NULL, $solrConfig.sortFields.DOCUMENT)) 121 + #set ($solrConfig.filterQuery = [ 122 + 'type:DOCUMENT', 123 + "wiki:$xcontext.database", 124 + "space_exact:$doc.space", 125 + 'class:FAQCode.FAQClass' 126 + ]) 127 + #set ($solrConfig.facetFields = ['creator', 'creationdate', 'author', 'date', 'mimetype', 'attauthor', 'attdate', 'attsize']) 128 + #set ($solrConfig.facetQuery = {}) 129 +#end 130 +{{/velocity}} 131 + 132 +{{velocity}} 133 +{{include reference="$searchPage"/}} 134 +{{/velocity}} 135 +{{/code}} 136 + 98 98 == Action API == 99 99 100 100 This [[Action API module>>extensions:Extension.Action API]] is the entry point for all UIs and in charge of calling the correct backend code to display what the user has asked for (it's the Controller in MVC terminology).