Solr Search Application
Solr Search Application
Description
The main objective of this application is to exploit the Apache SOLR search engine as indexing and search engine for XWiki. XWiki is using Lucene as a core component for Wiki Search. Lucene is little hard to configure and doesn't support features like facet search, hit highlighting, customizing search relevancy using boost index out of the box. Solr stands out in its minimal configuration to implement the search engine.Few libraries and a couple of XML configuration files are sufficient to implement a well to do engine. Configuring multiple languages is easy in SOLR compared to Lucene. Using SOLR, one can customize the indexing process by using required analyzers with selected tokenizers and set of filters on the dataset to generate highly customizable relevancy index. Through the front end, the user can select or configure the fields to be searched for and their weight which contributes to the document score.
Features
The solr search module uses embedded solr server for indexing, analysis and retrieval of data. The features of the search module are as follows:
- Simple text search
- Advanced search using document fields like title, name, comments, space, language etc..
- Objects and Properties
- Search attachments and text inside the readable attachments.
- Multilingual Support.
- Debug Mode
- Search Filters based on space, type, language and boost values
- Sorting based on Relevancy, Date, Author
- Quick search
- Admin module to index wiki as a whole or a selected space.
- Indexing status details.
Set Up
- Get the latest XWiki 4.2-SNAPSHOT +.
- XWiki 4.2-SNAPSHOT has lucene 3.5 libraries.Delete lucene-analyzer, lucene-core, lucene-queryparser of version 3.5.0 , xwiki-platform-search-lucene-4.2-milestone-2.jar from xwiki-enterprise-jetty-hsqldb-4.2-SNAPSHOT/webapps/xwiki/WEB-INF/lib.
- Download Solr from http://www.apache.org/dyn/closer.cgi/lucene/solr/4.0.0-ALPHA . Add the below jar files to XE/webapps/xwiki/WEB-INF/lib.
Untill the Solr search is added to xwiki-platform, for convienience the files are hosted in dropbox site here. Solr Lib- apache-solr-core-4.0.0- ALPHA.jar
- apache-solr-solrj-4.0.0-ALPHA.jar
- apache-solr-velocity-4.0.0-ALPHA.jar
- apache-solr-langid-4.0.0- ALPHA.jar
- apache-solr-analysis-extras-4.0.0- ALPHA.jar
- apache-solr-dataimporthandler-4.0.0-ALPHA.jar
- apache-solr-cell-4.0.0-ALPHA.jar
- apache-solr-dataimporthandler-extras-4.0.0-ALPHA.jar
- apache-solr-uima-4.0.0-ALPHA.jar
- apache-solr-clustering-4.0.0-ALPHA.jar
- Download Lucene from .Add the below jar files to XE/webapps/xwiki/WEB-INF/lib.
Untill the Solr search is added to xwiki-platform, for convienience the files are hosted in dropbox site here. Lucene Lib- lucene-analyzers-4.0.0-ALPHA.jar
- lucene-icu-4.0.0-ALPHA.jar
- lucene-phonetic-4.0.0-ALPHA.jar
- lucene-spellchecker-4.0.0-ALPHA.jar
- lucene-core-4.0.0-ALPHA.jar
- lucene-join-4.0.0-ALPHA.jar
- lucene-queries-4.0.0-ALPHA.jar
- lucene-stempel-4.0.0-ALPHA.jar
- lucene-facet-4.0.0-ALPHA.jar
- lucene-kuromoji-4.0.0-ALPHA.jar
- lucene-queryparser-4.0.0-ALPHA.jar
- lucene-grouping-4.0.0-ALPHA.jar
- lucene-memory-4.0.0-ALPHA.jar
- lucene-remote-4.0.0-ALPHA.jar
- lucene-highlighter-4.0.0-ALPHA.jar
- lucene-misc-4.0.0-ALPHA.jar
- lucene-spatial-4.0.0-ALPHA.jar
- Add google gson library to the XE/webapps/xwiki/WEB-INF/lib. Indexing uses json communication to update the progress bar. Download from http://code.google.com/p/google-gson/downloads/list
- Add spatial4j library file to XE/webapps/xwiki/WEB-INF/lib. Download from http://repo1.maven.org/maven2/com/spatial4j/spatial4j/0.2/spatial4j-0.2.jar
- Add configuration to xwiki.properties.
Search backend to be used by wiki search for indexing and search query retrieval.
search.backend=solrj
search.solr.home='/path/to/solr/home/' - Build the code and copy xwiki-platform-search-api-4.2-SNAPSHOT.jar and xwiki-platform-search-solrj-4.2-SNAPSHOT.jar to the XWiki Eneterprise lib directory.
- Start the Server using start_xwiki.sh or start_xwiki.bat
- Save and View the SearchPage at http://localhost:8080/xwiki/bin/view/Main/AdvancedSearch, Start searching.
Search Actions
Simple Search
Search for simple text : water
This returns the result with text highlighting. Facet search is enabled based on Space, lang, object, date, creation date, author, creator .
Advanced Search
- Search for text in space health
- Search for text in comments comment:ipsum
- FilteredSearch
The filtered search allows users to search based on Spaces, language, Type, File Type, Query Boost
Multilingual Search
The Multi Lingual search supports 5 languages currently. English, French, Spanish, Cesky, Deutsch(en,fr,es,cs,de).
- Search for a french word Atmosph*
- Search for a english word when french is active. Water lang:en
- Search for a Spanish word Agua lang:es
Debug Search Queries
Advanced search displays the debug information of search queries and the results. It give an insight on query parser, physical query and fieldboosts used for the search. For each result information regarding the score calculation is displayed.
- Debug Query

- Debug Search result.

Administration
The following links to the Admin module is present in wiki administration.
Solr Search : It contains information about Solr, Lucene, Solr server core container, configuration files, Update Handlers, Query Handlers, Cache and Highlighting.
Indexing : It allows the admin to Index based on the available spaces and wikis. It gives information about the indexing status.
Schema.xml : It gives the view of Schema.xml file
SolrConfig.xml : It gives the view of SolrConfig.xml
The credentials to log into the instance running is given below.
http://savitha.hoplahup.net/xwiki/bin/admin/XWiki/XWikiPreferences
Login ID: Admin
Password:admin