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".

AdministerWikiMenu.png

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

SearchAdministrationPage.png

Set the Default Search Engine

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

SearchConfiguration.png

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

SolrActions.png

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

SelectActionOnWiki.png

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.

SolrHQLQuery.png

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

SolrConfirmationMessage.png

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.

SolrQueueSize.png

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
/xwiki/bin/view/Main/SolrSearch?f_type=DOCUMENT&text=activity&f_locale=en&f_locale=&r=1&debug=true
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

SolrSearchDebug.png

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

Search this space

 

Most popular tags

Failed to execute the [groovy] macro
  1. access rights
  2. activity stream
  3. annotation
  4. attachment
  5. comment
  6. Document Tree Macro
  7. export
  8. Extension Manager
  9. Flamingo skin
  10. global user
  11. Groovy event listener
  12. group
  13. nested page
  14. search
  15. skin
  16. syntax
  17. user
  18. user profile
  19. velocity macros
  20. wiki
  21. wysiwyg
  22. XWiki Applications
  23. xwikiattachment_archive table
  24. xwikiattachment table
  25. xwikiattrecyclebin table
  26. xwikiproperties table

[Display all tags from this space]