Package trac :: Package search :: Module api :: Class ISearchSource

Class ISearchSource

source code

    object --+    
             |    
core.Interface --+
                 |
                ISearchSource

Extension point interface for adding search sources to the search system.
Instance Methods
 
get_search_filters(req)
Return a list of filters that this search source supports.
source code
 
get_search_results(req, terms, filters)
Return a list of search results matching each search term in terms.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

get_search_filters(req)

source code 

Return a list of filters that this search source supports.

Each filter must be a (name, label[, default]) tuple, where name is the internal name, label is a human-readable name for display and default is an optional boolean for determining whether this filter is searchable by default.

get_search_results(req, terms, filters)

source code 

Return a list of search results matching each search term in terms.

The filters parameters is a list of the enabled filters, each item being the name of the tuples returned by get_search_events.

The events returned by this function must be tuples of the form (href, title, date, author, excerpt).