Logo Search packages:      
Sourcecode: calibre version File versions  Download package

calibre::utils::search_query_parser::SearchQueryParser Class Reference

Inheritance diagram for calibre::utils::search_query_parser::SearchQueryParser:


List of all members.

Detailed Description

Parses a search query. 

A search query consists of tokens. The tokens can be combined using
the `or`, `and` and `not` operators as well as grouped using parentheses. 
When no operator is specified between two tokens, `and` is assumed.

Each token is a string of the form `location:query`. `location` is a string
from :member:`LOCATIONS`. It is optional. If it is omitted, it is assumed to 
be `all`. `query` is an arbitrary string that must not contain parentheses. 
If it contains whitespace, it should be quoted by enclosing it in `"` marks.

  * `Asimov` [search for the string "Asimov" in location `all`]
  * `comments:"This is a good book"` [search for "This is a good book" in `comments`]
  * `author:Asimov tag:unread` [search for books by Asimov that have been tagged as unread]
  * `author:Asimov or author:Hardy` [search for books by Asimov or Hardy]
  * `(author:Asimov or author:Hardy) and not tag:read` [search for unread books by Asimov or Hardy] 

Definition at line 25 of file search_query_parser.py.

Public Member Functions

def __init__
def evaluate
def evaluate_and
def evaluate_not
def evaluate_or
def evaluate_parenthesis
def evaluate_token
def get_matches
def method
def parse
def run_tests
def universal_set

Static Public Attributes


Private Attributes


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

Generated by  Doxygen 1.6.0   Back to index