SearchGrid
Performs a Solr search and displays results in a grid with facets on top |
Type | XAR |
Category | Macro |
Developed by | slauriere |
Active Installs | 2 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
SearchGrid perfoms a Solr search based on an XClass, a set of facets, a Solr filter and a sort parameter. The results are then laid out either as a grid or as a table, as illustrated below. The extension also comprises macro SearchGridTabs which displays SearchGrids in tabs.
Macro parameters
Name | Description | Mandatory | Default value |
---|---|---|---|
class | Name of the XClass whose instances are to be searched for | no | |
facets | List of facets to be displayed on top of the grid, declared as class properties. Properties which do not contain a dot are considered properties of the declared class. Properties with a dot refer to other classes and can be declared as follows: facets="databaseList1,staticList1,XWiki.Country.Countries.list" | no | |
filter | Filter used when performing the initial search. Example: f_property.Help.Applications.Movies.Code.MoviesClass.staticList1_string=drama | no | |
sort | Field to be used for ordering the results | no | title:asc |
limit | Number of results to be displayed per page | 10 | |
showHidden | Whether the hidden pages should be included in the results | no | false |
Examples
Grid layout
The display of the cells within the grid can be customized by creating an UIX for the UIXP org.xwiki.contrib.searchgrid.cell. An example is given in page MovieSearchGridCell for displaying Movies in a custom way, the result can be seen on page MovieSearchGrid.
Table layout
facets="databaseList1,staticList1"
columns="title,longText1,databaseList1,staticList1,date" limit="30"/}}
Search Grid Tabs Macro
This macro displays several SearchGrids in tabs (the facets are about to be added).
[
{
"label": "Movies",
"class": "Help.Applications.Movies.Code.MoviesClass",
"facets": ["databaseList1", "staticList1"]
},
{
"label": "Drama",
"class": "Help.Applications.Movies.Code.MoviesClass",
"filter": "f_property.Help.Applications.Movies.Code.MoviesClass.staticList1_string=drama",
"facets": ["databaseList1", "staticList1"]
}
]
{{/searchGridTabs}}
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Release Notes
v1.1
v1.0
Initial release