-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add catalog and search patches to limit results * remove unused import * remove unused patches * removed unused import * remove unused code * align querystring-search with new version in restapi and fix tests * zpretty * force min restapi version * leggibilità --------- Co-authored-by: Mauro Amico <[email protected]>
- Loading branch information
Showing
9 changed files
with
344 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
CUSTOM = { | ||
"allowedRolesAndUsers": 80, | ||
"effectiveRange": 100, | ||
} | ||
|
||
|
||
def rank_index(index, query): | ||
if ( | ||
index == "UID" | ||
and isinstance(query.get("UID"), dict) # noqa | ||
and query["UID"].get("not") # noqa | ||
): | ||
return 100 | ||
return CUSTOM.get(index, 0) | ||
|
||
|
||
def Catalog_sorted_search_indexes(self, query): | ||
return sorted( | ||
self._orig_sorted_search_indexes(query), key=lambda i: (rank_index(i, query), i) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.