mirror of https://github.com/searxng/searxng.git
Fix search_url building.
This commit is contained in:
parent
acf3f109b2
commit
f195d98bfb
|
@ -49,7 +49,7 @@ base_url = 'http://localhost:9200'
|
||||||
username = ''
|
username = ''
|
||||||
password = ''
|
password = ''
|
||||||
index = ''
|
index = ''
|
||||||
search_url = base_url + '/' + index + '/_search'
|
search_url = '{base_url}/{index}/_search'
|
||||||
query_type = 'match'
|
query_type = 'match'
|
||||||
custom_query_json = {}
|
custom_query_json = {}
|
||||||
show_metadata = False
|
show_metadata = False
|
||||||
|
@ -71,7 +71,7 @@ def request(query, params):
|
||||||
if username and password:
|
if username and password:
|
||||||
params['auth'] = (username, password)
|
params['auth'] = (username, password)
|
||||||
|
|
||||||
params['url'] = search_url
|
params['url'] = search_url.format(base_url=base_url, index=index)
|
||||||
params['method'] = 'GET'
|
params['method'] = 'GET'
|
||||||
params['data'] = dumps(_available_query_types[query_type](query))
|
params['data'] = dumps(_available_query_types[query_type](query))
|
||||||
params['headers']['Content-Type'] = 'application/json'
|
params['headers']['Content-Type'] = 'application/json'
|
||||||
|
|
Loading…
Reference in New Issue