Skip to content
Adds Xapian support to Radiant pages
Find file
Pull request Compare This branch is 17 commits ahead, 50 commits behind digitalpulp:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Xapian Search Extension for Radiant

Adds Xapit support to Radiant.


First, you'll need to install Xapian.

Next - from the root of your Radiant app - install the Xapit Plugin:

git submodule add git:// vendor/plugins/xapit
mkdir config/initializers
cp vendor/plugins/xapit/rails_generators/xapit/templates/setup_xapit.rb config/initializers

Finally, install the extension:

git submodule add git:// vendor/extensions/xapian_search

And run the migration:

rake radiant:extensions:xapian_search:migrate


Now you can call the search method on the Page class:"Yak Shaving")

It has built-in pagination. For more details and options, see the Xapit Readme.

The extension adds a "Searchable" checkbox to the Page admin form so you can define whether a page gets added to the index or not. Please note that the index is not being updated automatically! You'll have to call

rake xapit:index

from a cron job regularly or use something like Xapit-Sync.

Page Type and Tags

This extension should work as a drop-in replacement for the Radiant Search Extension. So the instructions below and 99% of the search_page.rb code come from that extension. Thank you, guys!


This extension works by creating a new page type called "Search". After you install it and re-start your web server, you should have a new type of page available.

  1. Download and install according to the instructions above.
  2. Create a new page called "Search" (or whatever you want)
  3. Set the Page Type to "Search" and the Status to "Published"
  4. Take the sample code below and paste it into the body of the new page.
  5. Visit http://localhost:3000/search and enter a search term.
  6. Bask in the glow of a job well done. :)


Place everything in the block below in the body of the "Search" page. This will provide a very basic Search page, but it should show you everything you need to know to make your own page better.

<r:search:form submit="Search"/>

  <strong>Enter a phrase above to search this website.</strong>

  <strong>I couldn't find anything named "<r:search:query/>".</strong>

  Found the following pages that contain "<r:search:query/>".


Inspired by the sphinx_search_extension by Digital Pulp.

In 2009 by Johannes Fahrenkrug, Springenwerk

Something went wrong with that request. Please try again.