The following (rough) implementation allows efficient searching by content type by switching between index types
srchterm = arg[1]
search_type = "ALL"
if len(arg) > 2:
search_type = arg[2]
for e in storage.INDEXES[search_type]:
if srchterm in e['u']:
# Found a match
# Get info for the match
info = storage.getStoredItem(e['u'])
print(f"{e['u']} : {info['title']} : {info['last-mod']}")
Valid index types are
ALL
IMAGE
DOC
Anything that's not an image is considered a doc.
Further down the line, may add support for searching by content-type but isn't currently required.
Activity
28-Dec-23 16:39
assigned to @btasker
28-Dec-23 16:45
mentioned in commit 04cbfe623f3934e78d2be8cf2a0a42ffec860911
Message
Implement (very) basic search client (utilities/file_location_listing#3)
28-Dec-23 16:46
The following (rough) implementation allows efficient searching by content type by switching between index types
Valid index types are
ALL
IMAGE
DOC
Anything that's not an image is considered a doc.
Further down the line, may add support for searching by content-type but isn't currently required.
28-Dec-23 16:46
I think it'd probably be prudent to allow searching by title (where available) too
28-Dec-23 16:52
mentioned in commit 254059149f9a3a249b7a4715f3326e1fdccfc994
Message
Allow searching of titles where available (utilities/file_location_listing#3)