diff options
author | neodarz <neodarz@neodarz.net> | 2019-01-20 22:51:15 +0100 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-01-20 22:51:17 +0100 |
commit | c8a1999fc0cddfceb321f9d52e5b73e01c8c6488 (patch) | |
tree | ebc26cd22672a195bb1fb62a47bb5086800f97dd /src | |
parent | e958a08e54b1be0360507be800570c870994466e (diff) | |
download | ryzomcore_searx-c8a1999fc0cddfceb321f9d52e5b73e01c8c6488.tar.xz ryzomcore_searx-c8a1999fc0cddfceb321f9d52e5b73e01c8c6488.zip |
Remove neodarznet search engine
Who was under the name khanindexer
Diffstat (limited to 'src')
-rw-r--r-- | src/khanindexer.py | 60 | ||||
-rw-r--r-- | src/settings.yml | 4 |
2 files changed, 0 insertions, 64 deletions
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 |