diff --git a/doc/requirements.txt b/doc/requirements.txt index 7cefa46d..aea0a6e9 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -sphinx>=1.1.2 +sphinx<2.0.0 sphinxcontrib-pecanwsme>=0.5 openstackdocstheme diff --git a/storyboard/api/v1/search/sqlalchemy_impl.py b/storyboard/api/v1/search/sqlalchemy_impl.py index 0b54fc2a..48abee76 100644 --- a/storyboard/api/v1/search/sqlalchemy_impl.py +++ b/storyboard/api/v1/search/sqlalchemy_impl.py @@ -29,7 +29,12 @@ class SqlAlchemySearchImpl(search_engine.SearchEngine): def _build_fulltext_search(self, model_cls, query, q, mode=FullTextMode.BOOLEAN): - return query.filter(FullTextSearch(q, model_cls, mode=mode)) + boolean_search_operators = ['+', '-', '~', '<', '>'] + if(q[0] in boolean_search_operators or (q[0] == '"' and q[-1] == '"') + or q[-1] == '*'): + return query.filter(FullTextSearch(q, model_cls, mode=mode)) + + return query.filter(FullTextSearch(q + '*', model_cls, mode=mode)) def _apply_pagination(self, model_cls, query, marker=None, offset=None, limit=None, sort_field='id',