Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Private Member Functions
MoinMoin.search.builtin.MoinSearch Class Reference
Inheritance diagram for MoinMoin.search.builtin.MoinSearch:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.search.builtin.MoinSearch:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def run

Public Attributes

 pages
 filtered
 request
 query
 sort
 mtime
 historysearch
 fs_rootpage

Private Member Functions

def _search
def _getPageList

Detailed Description

Definition at line 363 of file builtin.py.


Constructor & Destructor Documentation

def MoinMoin.search.builtin.MoinSearch.__init__ (   self,
  request,
  query,
  sort = 'weight',
  mtime = None,
  historysearch = 0,
  pages = None 
)

Definition at line 365 of file builtin.py.

00365 
00366     def __init__(self, request, query, sort='weight', mtime=None, historysearch=0, pages=None):
00367         super(MoinSearch, self).__init__(request, query, sort, mtime, historysearch)
00368 
00369         self.pages = pages


Member Function Documentation

Get list of pages to search in

If the query has a page filter, use it to filter pages before
searching. If not, get a unfiltered page list. The filtering
will happen later on the hits, which is faster with current
slow storage.

Definition at line 390 of file builtin.py.

00390 
00391     def _getPageList(self):
00392         """ Get list of pages to search in
00393 
00394         If the query has a page filter, use it to filter pages before
00395         searching. If not, get a unfiltered page list. The filtering
00396         will happen later on the hits, which is faster with current
00397         slow storage.
00398         """
00399         filter_ = self.query.pageFilter()
00400         if filter_:
00401             # There is no need to filter the results again.
00402             self.filtered = True
00403             return self.request.rootpage.getPageList(filter=filter_)
00404         else:
00405             return self.request.rootpage.getPageList(user='', exists=0)
00406 

Here is the caller graph for this function:

Search pages using moin's built-in full text search

The list may contain deleted pages or pages the user may not
read.

if self.pages is not None, searches in that pages.

Reimplemented from MoinMoin.search.builtin.BaseSearch.

Definition at line 370 of file builtin.py.

00370 
00371     def _search(self):
00372         """
00373         Search pages using moin's built-in full text search
00374 
00375         The list may contain deleted pages or pages the user may not
00376         read.
00377 
00378         if self.pages is not None, searches in that pages.
00379         """
00380         self.request.clock.start('_moinSearch')
00381 
00382         # if self.pages is none, we make a full pagelist, but don't
00383         # search attachments (thus attachment name = '')
00384         pages = self.pages or [{'pagename': p, 'attachment': '', 'wikiname': 'Self', } for p in self._getPageList()]
00385 
00386         hits = self._getHits(pages)
00387         self.request.clock.stop('_moinSearch')
00388 
00389         return hits, None

Here is the call graph for this function:

def MoinMoin.search.builtin.BaseSearch.run (   self) [inherited]
Perform search and return results object 

Definition at line 258 of file builtin.py.

00258 
00259     def run(self):
00260         """ Perform search and return results object """
00261 
00262         start = time.time()
00263         hits, estimated_hits = self._search()
00264 
00265         # important - filter deleted pages or pages the user may not read!
00266         if not self.filtered:
00267             hits = self._filter(hits)
00268             logging.debug("after filtering: %d hits" % len(hits))
00269 
00270         return self._get_search_results(hits, start, estimated_hits)

Here is the call graph for this function:


Member Data Documentation

Reimplemented from MoinMoin.search.builtin.BaseSearch.

Definition at line 401 of file builtin.py.

Definition at line 256 of file builtin.py.

Definition at line 254 of file builtin.py.

Definition at line 253 of file builtin.py.

Definition at line 368 of file builtin.py.

Definition at line 251 of file builtin.py.

Definition at line 250 of file builtin.py.

Definition at line 252 of file builtin.py.


The documentation for this class was generated from the following file: