I've been using the index to help with a tidy up, as part of that I've been grabbing stats detailing how many results are returned for a given search:
# Run the search
res = doSearch(srchterm, SEARCH_URL)
imgs = doSearch(srchterm, SEARCH_URL, searchtype="IMAGE")
doc_count = len(res['results']) if res else 0
img_count = len(imgs['results']) if imgs else 0
This is really quite inefficient - the service has to run the index, load each of the relevant storage files and return it, only for me to chuck the whole lot away once I've counted it. It also means that the process has been slow for certain searches.
What I'd like is for there to be an API endpoint (no need for the searchportal UI to expose it - it's only really of programmatic benefit) which runs the index checks but doesn't load the files unless there's a constraint which requires it.
Activity
10-Jan-24 19:50
assigned to @btasker
10-Jan-24 19:51
It might seem a bit odd to do that work for the sake of one task, but I think there's a reasonable possibility that I'll also use it to implement some monitoring, so it shouldn't turn out to be effort made for the sake of one task.
10-Jan-24 20:01
mentioned in commit 5a19b9f6bc7f763c81ee6feb37de5201c445e49a
Message
feat: implement ability to run count-only searches (utilities/file_location_listing#41)
10-Jan-24 20:01
Initial implementation: