class documentation

class SearchSelection(PageSelection): (source)

View In Hierarchy

This class wraps a set of Page or ResultPath objects which result from processing a search query. The attribute 'scores' gives a dict with an arbitrary integer for each path in this set to rank how well they match the query.
Method __init__ Undocumented
Method search Populate this SearchSelection with results for a query. This method flushes any previous results in this set.
Instance Variable cancelled Undocumented
Instance Variable notebook Undocumented
Instance Variable query Undocumented
Instance Variable scores Undocumented
Static Method _and_operator Undocumented
Static Method _or_operator Undocumented
Method _content_regex Undocumented
Method _count_score Undocumented
Method _name_regex Undocumented
Method _namespace_regex Undocumented
Method _process_content Undocumented
Method _process_from_index Undocumented
Method _process_group Undocumented
def __init__(self, notebook): (source)

Undocumented

def search(self, query, selection=None, callback=None): (source)
Populate this SearchSelection with results for a query. This method flushes any previous results in this set.
Parameters
querya Query object
selectiona prior selection to search within, will result in a sub-set
callback

a function to call in between steps in the search. It is called as:

        callback(selection, path)

Where:

  • selection is a SearchSelection with partial results (if any)
  • path is the Path for the last searched path or None

If the callback returns False the search is cancelled.

cancelled: bool = (source)

Undocumented

notebook = (source)

Undocumented

query = (source)

Undocumented

scores: dict = (source)

Undocumented

@staticmethod
def _and_operator(results, scope, newresults): (source)

Undocumented

@staticmethod
def _or_operator(results, scope, newresults): (source)

Undocumented

def _content_regex(self, string, case=False): (source)

Undocumented

def _count_score(self, path, score): (source)

Undocumented

def _name_regex(self, string, case=False): (source)

Undocumented

def _namespace_regex(self, string, case=False): (source)

Undocumented

def _process_content(self, terms, results, scope, operator, callback=None): (source)

Undocumented

def _process_from_index(self, term, scope, scoring=1): (source)

Undocumented

def _process_group(self, group, scope=None, callback=None): (source)

Undocumented