trac.search.api
¶
-
class
trac.search.api.
ISearchSource
¶ Bases:
trac.core.Interface
Extension point interface for adding search sources to the search system.
-
get_search_filters
(req)¶ Return a list of filters that this search source supports.
Each filter must be a
(name, label[, default])
tuple, wherename
is the internal name,label
is a human-readable name for display anddefault
is an optional boolean for determining whether this filter is searchable by default.
-
get_search_results
(req, terms, filters)¶ 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 byget_search_events
.The events returned by this function must be tuples of the form
(href, title, date, author, excerpt).
-
-
trac.search.api.
search_to_regexps
(terms)¶ Convert search query terms into regular expressions.
-
trac.search.api.
search_to_sql
(db, columns, terms)¶ Convert a search query into an SQL WHERE clause and corresponding parameters.
The result is returned as an
(sql, params)
tuple.