Last modified by Thomas Mortagne on 2017/03/24

<
From version < 48.2 >
edited by Marius Dumitru Florea
on 2014/02/25
To version < 50.1 >
edited by Marius Dumitru Florea
on 2014/02/25
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -93,8 +93,47 @@
93 93  qf=title^2 name
94 94  {{/code}}
95 95  
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.
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).

Get Connected