Commit Graph
59 Commits
Author SHA1 Message Date
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
clime 45007d2164 only order first few (currently 10) returned rows by the search results
Otherwise two tests were failing with 'too many SQL variables' error on the generated query
2016-04-12 22:28:19 +02:00
clime 1c04175468 returned query rows now follow the order of whoosh search results 2016-04-12 22:09:42 +02:00
Slavek Kabrda 2f262cb9c0 Remove deprecated '--use-mirrors' pip option 2015-10-06 15:26:24 +02:00
Slavek Kabrda 6759a5b649 Add Python 3.5 to testing targets 2015-10-06 15:20:21 +02:00
Slavek Kabrda 88d1a6993a Bump to version 0.0.9 v0.0.9 2015-10-06 15:17:51 +02:00
Slavek Kabrda 45c6af6b4c Merge pull request #5 from xsuchy/reindex2
implement reindex()
2015-10-06 15:15:34 +02:00
Miroslav Suchý 9a93b6ed23 implement reindex() 2015-10-05 15:46:34 +02:00
Slavek Kabrda 9e72c8efbd Bump to version 0.0.8 v0.0.8 2015-09-15 15:17:07 +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
Slavek Kabrda d4aed6bcda Bump to version 0.0.7 v0.0.7 2015-06-10 13:41:51 +02:00
Slavek Kabrda e5170ea666 Merge pull request #8 from pjcunningham/master
Need to be able to use flask-whooshee using Flask init_app protocol
2015-06-10 13:37:20 +02:00
Paul Cunningham bf4c447772 limit parameter needs to be passed into search method 2015-06-09 23:15:47 +01: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
Paul Cunningham bac14c4403 Added init_app 2015-06-09 13:45:27 +01:00
Paul Cunningham 2308624c12 Ignore PyCharm .idea 2015-06-09 13:43:04 +01:00
Slavek Kabrda 94a5df4cb7 Fix tests on Python 2.6 2014-11-10 10:30:18 +01:00
Slavek Kabrda a07a06bdac It's 'nose', not 'nosetests' 2014-11-10 10:24:55 +01:00
Slavek Kabrda 5293626ab1 Split requirements into requirements.txt, introduce .travis.yml 2014-11-10 10:19:48 +01:00
Slavek Kabrda f4efdec8ae Merge pull request #7 from evilkost/master
bugfix: flask-whooshee invoked whoosh searcher without `limit`, so whoosh  used defalt limit value == 10
2014-10-31 07:50:27 +01:00
Valentin Gologuzov 73594f7b47 slightly more complex test for search of larse sets 2014-10-30 19:43:44 +01:00
Valentin Gologuzov 82c4dd4e16 Pass limit parameter to a searcher. 2014-10-30 19:28:34 +01:00
Valentin Gologuzov 5691b1a692 new test for bug: search returns at most 10 items 2014-10-30 18:40:02 +01:00
Slavek Kabrda a94cea7b20 Merge pull request #6 from colin4124/patch-1
typo: missing enclose with
2014-10-16 08:39:08 +02:00
Leway Colin 6374ff4e13 typo: missing enclose with 2014-10-15 23:57:40 +08:00
Slavek Kabrda 0cfdf0e717 Bump to version 0.0.6 v0.0.6 2013-12-18 12:04:35 +01:00
Slavek Kabrda 05395bef2e Add some docstrings to make the thing more readable 2013-12-18 11:57:30 +01:00
Slavek Kabrda 538c212a89 Pass timeout to whoosh writer, allow setting it in app.config 2013-12-18 11:24:43 +01:00
Bohuslav Kabrda b1b3021a48 Merge pull request #1 from rkuska/master
Fixes to make code work under python3
2013-10-15 01:33:57 -07:00
Bohuslav Kabrda fe7c34a161 Merge pull request #2 from jordanfung/master
use customized analyzer in register_model() method
2013-10-15 01:33:42 -07:00
jordanfung ae3bed1f8b Update flask_whooshee.py 2013-10-14 18:44:10 +08:00
jordanfung 6478b0de31 Update flask_whooshee.py
add 'analyzer' param in register_model
2013-10-14 18:39:46 +08:00
Robert Kuska e5ce41cc02 Fixes to make code work under python3 2013-09-25 15:47:36 +02:00
Bohuslav Kabrda 18fc18cd08 Bump to 0.0.5 v0.0.5 2013-04-10 14:42:24 +02:00
Bohuslav Kabrda 9995c158d3 Make whooshee work with sqlalchemy < 0.8.0 2013-04-10 14:41:30 +02:00
Bohuslav Kabrda 9fc8fa6e2e Bump to 0.0.4 v0.0.4 2013-03-21 09:02:58 +01:00
Bohuslav Kabrda 61b800cd0b I should really run tests before releasing new version 2013-03-21 09:02:38 +01:00
Bohuslav Kabrda bf76ade963 Add test.py to archive, bump to 0.0.3 v0.0.3 2013-03-21 08:38:31 +01:00
Bohuslav Kabrda 5073748a1e Bump version to 0.0.2 v0.0.2 2013-03-21 08:35:24 +01:00
Bohuslav Kabrda ba3f573b3a A little TODO 2013-03-21 08:35:00 +01:00
Bohuslav Kabrda c5ee625a29 More sane models for tests 2013-03-04 16:42:42 +01:00
Bohuslav Kabrda 03bc50e5e5 Some readme fixes 2013-03-04 16:40:06 +01:00
Bohuslav Kabrda 2bf3290743 some basic info 2013-03-04 16:38:27 +01:00
Bohuslav Kabrda 9e9e50d5cb Add setup.py and manifest 2013-03-04 16:09:15 +01:00
Bohuslav Kabrda f9628002cc Initial tests 2013-03-04 16:08:33 +01:00
Bohuslav Kabrda 62908834ef Custom whoosheers don't have _is_model_whoosheer attribute 2013-03-04 15:50:40 +01:00
Bohuslav Kabrda 297feb98eb Fix whooshee_search for model whoosheers 2013-03-04 15:38:29 +01:00
Bohuslav Kabrda 9e9d01e4e4 Basic querying support 2013-03-04 14:18:46 +01:00