SeSQL can be queried in two modes : short queries and full queries.
Short queries are designed to retrieve a small amount (like 50) recent (according to any date field indexed by SeSQL) content matching the given criteria in an extra-fast manner.
It's typical used for a portlet, infobox or similar widget.
It has several limitations :
Full queries (sometimes called long queries in the code or documentation) are a more common search. They are a bit slower than short queries, especially if there is a lot of content matching, but propose additional features :
Making queries with SeSQL is made by calling the shortquery or longquery function with a Django Q object.
All the general rules of Q objects still work : using ~ to make a negation, | to make OR queries, & to make AND queries.
The kind of supported queries depend of the index types.
SeSQL needs the sort order to perform various optimization. It must be known early in the process of deciding which heuristics to use.
The sort order must be given as a second, optional, 'order' argument of the methods. For example
shortquery(Q(classname__in = ('Article', 'PaperPage')) & Q(fulltext__containswords = 'python postgresql'), order = ( '-publication_date', 'page' ))
The order argument must be a list of field names, on which sorting makes sense (you can't sort of full text indexes for example). If a field is prefixed by "-" it'll use a descending order (defaut is ascending order).
SeSQL support special ordering modes, prefixed by sesql_. Only one is implemented in this version :
The default search order is taken from the DEFAULT_ORDER varibale in config.py.