Reference/Search

From Dreamwidth Notes
Revision as of 07:24, 25 February 2013 by Afuna (Talk | contribs)

Jump to: navigation, search

There are two forms of search on Dreamwidth installations: both are optional and require further setup.

User search searches for users matching certain characteristics. Text search searches through entries and comments. This page will focus on text search.


User Search

Not heavily documented, instructions for setup can be found in Set_up_UserSearch.

Text Search

Dreamwidth uses Sphinx, an open-source search package, to implement text search. Search is available on the search page. There are two modes of search: site search, and per-journal search.

Site search only shows public content. Journal search may contain locked content, following the regular behavior for whether you can see the locked content or not. That is, if you can see it on the journal, then you can find it with search. If you can't see it on the journal, then you won't see it in the search results. There's also an option to search by comments. Only comments made on paid users' journals are indexed for technical reasons (site load).

Software Installation

You'll need to install the Sphinx package and a couple of Perl modules that will let us use Sphinx with our code.

Installing the Sphinx package

You will need to download the Sphinx package:

   wget http://sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz

And then install it:

   tar -zxvf sphinx-0.9.9.tar.gz
   cd sphinx-0.9.9/
   ./configure
   make
   make install    # as root

Installing File::SearchPath and Sphinx::Search

These are available via Ubuntu's package system, so:

   apt-get install libfile-searchpath-perl libsphinx-search-perl

It is important that you match up the versions of the Perl packages and the Sphinx package; otherwise, your searches will silently fail due to incompatibilities in the APi. Assuming that all works, you should have everything installed that you need to get the search system setup. Moving on!