14 Commits
Author SHA1 Message Date
gitea 192aa74097 Add delete model method and test 2016-06-06 13:24:38 +08:00
clime 9dbabffc81 added whoosheer option for whooshee_search method 2016-05-10 18:44:27 +02:00
clime 698e159a56 order_by_relevance test update to describe interaction with sqlalchemy order_by statement 2016-04-21 11:25:09 +02:00
clime ac5ab6544b default value of order_by_relevance param set to 10, also fixed some typos in comments 2016-04-21 10:43:45 +02:00
clime 7563fec651 order_by_relevance param added to whooshee_search method together with a unittest for it
order_by_relevance=n means:
n < 0  : return everything ordered
n > 0  : return first n results ordered
n == 0 : return everything unordered

We introduced this parameter to be able to limit the resulting query size
because the order_by_relevance is implemented by potentially huge CASE
statement.

The alternative was to use ORDER BY FIELD(<fieldname>, 1, 5, ...)
directive but this is not currently implemented in netheir postgresql
or sqlite (it is in MySQL though).

Also e.g. sqlite puts limit on number of variables in a query (given by
SQLITE_LIMIT_VARIABLE_NUMBER being set to 999 by default). By limiting
the number of search results for which the order is ensured, we also
limit the number of the variables, which might make an invalid query valid.

This can (and perhaps should from the user perspective) also be achieved
by using the `limit` option of whooshee_search method so order_by_relevance
represents just an extra degree of freedom in the search configuration.
2016-04-20 12:48:02 +02:00
Miroslav Suchý 9a93b6ed23 implement reindex() 2015-10-05 15:46:34 +02:00
Slavek Kabrda c27e9de188 Use text('null') instead of plain 'null' to silence sqlalchemy warning. Fixes #9 2015-09-15 15:15:26 +02:00
Paul Cunningham 5a304de037 Added test for init_app method
Removed tests to base class. Added two test classes; 1) passing in app
via the Whoosh constructor and 2) using init_app method
2015-06-09 16:32:41 +01:00
Paul Cunningham 4cbbddc970 Set ignore errors flag to True
Tests were failing in Windows 7 64 bit - see

http://stackoverflow.com/a/21966211/2800058
2015-06-09 14:13:35 +01:00
Slavek Kabrda 94a5df4cb7 Fix tests on Python 2.6 2014-11-10 10:30:18 +01:00
Valentin Gologuzov 73594f7b47 slightly more complex test for search of larse sets 2014-10-30 19:43:44 +01:00
Valentin Gologuzov 5691b1a692 new test for bug: search returns at most 10 items 2014-10-30 18:40:02 +01:00
Bohuslav Kabrda c5ee625a29 More sane models for tests 2013-03-04 16:42:42 +01:00
Bohuslav Kabrda f9628002cc Initial tests 2013-03-04 16:08:33 +01:00