Skip to content

Commit a8566af

Browse files
authored
fix linter and doc (#2203)
1 parent 4fbadad commit a8566af

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

c2corg_api/search/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def client_from_config(settings):
4949

5050

5151
def configure_es_from_config(settings):
52-
global elasticsearch_config
5352
client = client_from_config(settings)
5453
connections.add_connection('default', client)
5554
elasticsearch_config['client'] = client

c2corg_api/views/search.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from c2corg_api.models.waypoint import WAYPOINT_TYPE
1111
from c2corg_api.search import search, SEARCH_LIMIT_DEFAULT, SEARCH_LIMIT_MAX
1212
from c2corg_api.views import cors_policy
13-
from c2corg_api.security.acl import ACLDefault
1413
from c2corg_api.views.area import area_documents_config
1514
from c2corg_api.views.article import article_documents_config
1615
from c2corg_api.views.book import book_documents_config
@@ -27,22 +26,25 @@
2726

2827

2928
@resource(path='/search', cors_policy=cors_policy)
30-
class SearchRest(ACLDefault):
29+
class SearchRest(object):
30+
def __init__(self, request):
31+
self.request = request
3132

3233
@view(validators=[validate_pagination, validate_preferred_lang_param])
3334
def get(self):
3435
"""Search for a query word (simple search).
3536
3637
Request:
37-
`GET` `/search?q=...[&lang=...][&limit=...][&t=...]`
38+
`GET` `/search?q=...[&pl=...][&limit=...][&t=...]`
3839
3940
Parameters:
4041
`q=...`
4142
The search word.
4243
43-
`lang=...` (optional)
44-
When set only the given locale will be included (if available).
45-
Otherwise all locales will be returned.
44+
`pl=...` (optional)
45+
When set only the given locale will be included (if available),
46+
and the search is restricted to that locale's title fields.
47+
Otherwise all locales will be searched and returned.
4648
4749
`limit=...` (optional)
4850
How many results should be returned per document type

0 commit comments

Comments
 (0)