\DocumentationSearch
Documentation Search powered by Lucene. You will need Zend_Lucene installed on your path.
To rebuild the indexes run the task. You may
wish to setup a cron job to remake the indexes on a regular basis.
This class has the ability to generate an OpenSearch RSS formatted feeds
simply by using the URL:
<code>
yoursite.com/search/?q=Foo&format=rss. // Format can either be specified as rss or left off.
</code>
To get a specific amount of results you can also use the modifiers start and
limit:
<code>
yoursite.com/search/?q=Foo&start=10&limit=10
</code>
Synopsis
class DocumentationSearch
{
- // members
- private static bool $enabled = false;
- private static bool $advanced_search_enabled = true;
- private static array $meta_data = ;
- private static Array $boost_by_path = ;
- private ArrayList $results;
- private $totalResults;
- private $query;
- private Controller $outputController;
- private $modules;
- private static $index_location;
- // methods
- public void setModules()
- public void setVersions()
- public void setQuery()
- public string getQuery()
- public void setOutputController()
- public static string get_index_location()
- public void performSearch()
- public ArrayData getSearchResults()
- private string buildQueryUrl()
- public int getTotalResults()
- public void optimizeIndex()
- public String getTitle()
- public static void set_meta_data()
- public static array get_meta_data()
- public void renderResults()
Members
private
- $advanced_search_enabled — bool
- $boost_by_path — Array
- $enabled — bool
- $index_location
—
string
Folder name for indexes (in the temp folder). - $meta_data — string
- $modules
—
array
Optionally filter by module and version - $outputController — Controller
- $query — string
- $results — ArrayList
- $totalResults — int
Methods
private
- buildQueryUrl() — Build a nice query string for the results
public
- getQuery() — Returns the current search query
- getSearchResults()
- getTitle()
- getTotalResults()
- get_index_location()
- get_meta_data() — Returns the meta data needed by opensearch.
- optimizeIndex() — Optimizes the search indexes on the File System
- performSearch() — Perform a search query on the index
- renderResults() — Renders the search results into a template. Either the search results template or the Atom feed.
- setModules()
- setOutputController() — Sets the {@link DocumentationViewer} or {@link DocumentationSearch} instance which this search is rendering on based on whether it is the results display or RSS feed
- setQuery() — Set the current search query
- setVersions()
- set_meta_data() — OpenSearch MetaData fields. For a list of fields consult {@link self::get_meta_data()}