Changes for page Solr Search Query API

Last modified by Admin on 2024/03/25 16:54

<
From version < 6.18 >
edited by Admin
on 2015/07/16 14:19
To version < 7.1 >
edited by Marius Dumitru Florea
on 2015/07/27 18:13
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.Admin
1 +xwiki:XWiki.mflorea
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -7,6 +7,9 @@
7 7  #set ($discard = $query.bindValue('sort', "score desc"))
8 8  #set ($discard = $query.bindValue('fq', '{!q.op=AND} type:DOCUMENT locales:(en OR fr) hidden:false'))
9 9  #set ($searchResponse = $query.execute()[0])
10 +#foreach ($searchResult in $searchResponse.results)
11 + #displaySearchResult($searchResult)
12 +#end
10 10  {{/code}}
11 11  
12 12  In the example above ##$searchResponse## is an instance of [[QueryResponse>>http://lucene.apache.org/solr/4_0_0/solr-solrj/org/apache/solr/client/solrj/response/QueryResponse.html]]. You should read the [[Solr schema design>>design:Design.SolrSchema]] to understand what you can search for using this API.

Get Connected