diff options
Diffstat (limited to '')
-rwxr-xr-x | install.sh | 1 | ||||
-rw-r--r-- | src/khanindexer.py | 60 | ||||
-rw-r--r-- | src/settings.yml | 4 |
3 files changed, 0 insertions, 65 deletions
@@ -9,7 +9,6 @@ ln -s ../../../src/khaganatWikhan.py searx/searx/engines/khaganatWikhan.py ln -s ../../../src/khaganatForum.py searx/searx/engines/khaganatForum.py ln -s ../../../src/forgeryzom.py searx/searx/engines/forgeryzom.py ln -s ../../../src/ryzomcoreConfluence.py searx/searx/engines/ryzomcoreConfluence.py -ln -s ../../../src/khanindexer.py searx/searx/engines/khanindexer.py ln -s ../../../src/khanindexer-nevrax.py searx/searx/engines/khanindexer-nevrax.py ln -s ../../src/settings.yml searx/searx/settings.yml virtualenv venv -p python2.7 diff --git a/src/khanindexer.py b/src/khanindexer.py deleted file mode 100644 index 36dd1ef..0000000 --- a/src/khanindexer.py +++ /dev/null @@ -1,60 +0,0 @@ -# khanindexer -# -# @website https://git.khaganat.net/neodarz/khanindexer -# -# @results JSON -# @stable yes -# @parse (general) url, title, content - -from urllib import urlencode -import json - -# engine dependent config -categories = ['general'] # TODO , 'images', 'music', 'videos', 'files' -paging = False -language_support = False -number_of_results = 5 - -# do search-request -def request(query, params): - - params['data'] = json.dumps({ - "index": "neodarznet", - "query": { "match": { "_all": query } }, - "highlight": - { - "fields": { - "content": {}, - "url": {}, - "title": {} - }, - "pre_tags": "_", - "post_tags": "_" - } - }) - - params['method'] = 'POST' - - params['url'] = 'http://127.0.0.1:8080/json/search' - - return params - - -# get response from search-request -def response(resp): - results = [] - - datas = json.loads(resp.text) - - if not 'error' in datas: - for el in datas['hits']['hits']: - results.append({ - 'title': el["_source"]["title"], - 'content': el["highlight"]["content"][0], - 'url': el["_source"]["url"] - }) - else: - print("ERROR:Search server: "+str(datas['error'])) - - # return results - return results diff --git a/src/settings.yml b/src/settings.yml index 0245ea1..243166d 100644 --- a/src/settings.yml +++ b/src/settings.yml @@ -65,10 +65,6 @@ engines: engine: khaganatForum shortcut: kf - - name: khanindexer - engine: khanindexer - shortcut: kh - - name: khanindexer-nevrax engine: khanindexer-nevrax shortcut: khn |