File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ def client_from_config(settings):
4949
5050
5151def 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
Original file line number Diff line number Diff line change 1010from c2corg_api .models .waypoint import WAYPOINT_TYPE
1111from c2corg_api .search import search , SEARCH_LIMIT_DEFAULT , SEARCH_LIMIT_MAX
1212from c2corg_api .views import cors_policy
13- from c2corg_api .security .acl import ACLDefault
1413from c2corg_api .views .area import area_documents_config
1514from c2corg_api .views .article import article_documents_config
1615from c2corg_api .views .book import book_documents_config
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
You can’t perform that action at this time.
0 commit comments