XWiki Standard 9.8.1 Documentation » Customization Overview » Customize the Search Feature

Customize the Search Feature

The Search Administration UI

To access the Search administration UI, click the DrawerMenuIcon.png button in order to open the drawer menu, then click on "Administer Wiki".


In the wiki preferences page, click on "Search" -> "Search" in the accordion menu to the left.


Set the Default Search Engine

The default XWiki search engine is Solr, but you may also pick "Database".


The Solr Index

Solr is the default XWiki Standard search engine based on Apache Solr which has its own index. The default folder that stores the Solr index is <permanent folder>/solr but you can change it by adding the property search.solr.home to the file "WEB-INF/xwiki.properties".

The SOLR search module automatically indexes the changes made on the wiki and at each startup a background job checks if the Solr index and the database are synchronized. If not, the job only applies the updates. Also, entities are now indexed with the list of supported locales, which means that if your current locale is "fr_FR" you will find all entities that you would have seen when the current locale is "fr_FR". 

The manual indexing is still available because it is more stable so, in order to perform it, go to the "Solr search administration" section, choose the action you wish to perform:

  • add pages to the Solr index
  • remove pages from the Solr index
  • re-index a wiki


The selected action will apply on the entire farm or on a sub-wiki of your choice.


In case you wish to limit the pages that will be affected by the selected action, you can use a custom HQL or XWQL query.


After clicking on "Apply" to trigger the index, you will see a confirmation message.


The actual reading of wiki pages and their indexing is done in a safe background thread and in the "Queue Size" section you can see the number of entities that are left to be indexed, re-indexed or deleted from the index.


Solr Search Debug Mode

You can now debug the Solr search query string by adding &debug=true to the "Main.SolrSearch" URL query string. For instance, we are looking for the word "activity" in all the wiki pages. The search URL will then be like
and will display:

  • the used query parser: ExtendedDismaxQParser
  • the parsed query in order to see which index fields are used and what is their priority:
    +((objcontent_en:activ | objcontent__:activity)^0.4 | creator_display:activity^0.08 |
    (title_en:activ | title__:activity)^10.0 | (doccontent_en:activ |doccontent__:activity)^2.0 |
    attauthor_display:activity^0.016 | author_display:activity^0.08 | name:activity^10.0 |
    filename:activity^0.4 | (attcontent_en:activ | attcontent__:activity)^0.4 |
    space:activity^0.016 | (comment__:activity | comment_en:activ)^0.016 |
    (doccontentraw__:activity | doccontentraw_en:activ)^0.4)
  • the filter queries in order to know the facets that were applied and their values: {!tag=type}type:("DOCUMENT")
    {!tag=locale}locale:("en" OR "")
  • the processing time
  • the score for each search result and the way it was computed


Restrict the List of Wikis that are Searchable by Default

You can now restrict the list of wikis that are searchable by default from the main wiki by defining the following Velocity variable in a page that includes "Main.SolrSearch":

#set ($wikisSearchableFromMainWiki = ["wiki1", "wiki2", "wiki3"])


Related Pages

Trying to decide between Cloud and On Premise? See the comparison on the XWiki Help Center.

Search this space