-
-
Save jorgebastida/2375464 to your computer and use it in GitHub Desktop.
search like a real hacker
This file contains hidden or 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
#index is like this | |
index = [ | |
('content indexed', object_id), | |
('test string', 1), | |
... | |
] | |
def _search(q): | |
if q: | |
q = q.lower() | |
return [x[1] for x in index if q in x[0]] | |
return [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment