Difference between revisions of "Reference/Search"

From Dreamwidth Notes
Jump to: navigation, search
(initial draft)
 
m (Installing File::SearchPath and Sphinx::Search)
Line 32: Line 32:
 
==== Installing File::SearchPath and Sphinx::Search ====
 
==== Installing File::SearchPath and Sphinx::Search ====
  
They're available via Ubuntu's package system, so:
+
These are available via Ubuntu's package system, so:
  
 
     apt-get install libfile-searchpath-perl libsphinx-search-perl
 
     apt-get install libfile-searchpath-perl libsphinx-search-perl

Revision as of 07:24, 25 February 2013

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!