.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.engines.opensemantic Namespace Reference

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
str base_url = 'http://localhost:8983/solr/opensemanticsearch/'
 
str search_string = 'query?q={query}'
 

Detailed Description

Open Semantic Search

Function Documentation

◆ request()

searx.engines.opensemantic.request ( query,
params )

Definition at line 24 of file opensemantic.py.

24def request(query, params):
25 search_path = search_string.format(
26 query=quote(query),
27 )
28 params['url'] = base_url + search_path
29 return params
30
31

◆ response()

searx.engines.opensemantic.response ( resp)

Definition at line 32 of file opensemantic.py.

32def response(resp):
33 results = []
34 data = loads(resp.text)
35 docs = data.get('response', {}).get('docs', [])
36
37 for current in docs:
38 item = {}
39 item['url'] = current['id']
40 item['title'] = current['title_txt_txt_en']
41 if current.get('content_txt'):
42 item['content'] = current['content_txt'][0]
43 item['publishedDate'] = parser.parse(current['file_modified_dt'])
44 results.append(item)
45
46 return results

Variable Documentation

◆ about

dict searx.engines.opensemantic.about
Initial value:
1= {
2 "website": 'https://www.opensemanticsearch.org/',
3 "wikidata_id": None,
4 "official_api_documentation": 'https://www.opensemanticsearch.org/dev',
5 "use_official_api": True,
6 "require_api_key": False,
7 "results": 'JSON',
8}

Definition at line 11 of file opensemantic.py.

◆ base_url

str searx.engines.opensemantic.base_url = 'http://localhost:8983/solr/opensemanticsearch/'

Definition at line 20 of file opensemantic.py.

◆ search_string

str searx.engines.opensemantic.search_string = 'query?q={query}'

Definition at line 21 of file opensemantic.py.