Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVilem Duha <vilem.duha@gmail.com>2019-07-09 02:25:43 +0300
committerVilem Duha <vilem.duha@gmail.com>2019-07-09 02:25:43 +0300
commit464e4a6b2289a7d9e6fada555c4bae75f20a8f4e (patch)
tree41ea8a45a78cf588c4017201cfc83fd76ab4abc9
parentf61167449726ddea370315d2b0e2ed7e5c8ca7a7 (diff)
BlenderKit: fix ordering in search.
This now works much better than previously, using score for categories and relevance for keyword search.
-rw-r--r--blenderkit/search.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/blenderkit/search.py b/blenderkit/search.py
index b7239e38..6c1cc955 100644
--- a/blenderkit/search.py
+++ b/blenderkit/search.py
@@ -714,6 +714,13 @@ class Searcher(threading.Thread):
if i < len(query) - 1:
requeststring += '+'
+ # result ordering: _score - relevance, score - BlenderKit score
+ if query.get('category_subtree') is not None:
+ requeststring += '+order:_score,-score'
+ else:
+ requeststring += '+order:-score'
+
+
requeststring += '&addon_version=%s' % params['addon_version']
if params.get('scene_uuid') is not None:
requeststring += '&scene_uuid=%s' % params['scene_uuid']