hypatia icon indicating copy to clipboard operation
hypatia copied to clipboard

Documentation

Open PythonLinks opened this issue 3 years ago • 3 comments

Thank you for writing this software. Right now I am trying to figure out how to use it. It is a bit difficult to figure it out.

I did find the documentation for repoze.catalog. It appears to be quite close. I am still trying to figure out the differences. It would be good if there were a link to the repoze docs, or better yet if they were updated to match hypatia, and included in this repository.

PythonLinks avatar Aug 06 '22 06:08 PythonLinks

Okay, here is another documentation issue.

Hypatia search has an option to limit the number of values returned. So I set it to maximum 1000. The problem is then I do not know how many results there are in total. It is not clear to me if limiting the search to 1000, really limits the cpu time, of if only using the first 1000 generated values would have the same effect, but let me know how many results there were. I am using a sort field. Does it first find all the values and then sort them, or does it go by sort field to find the values. At some point I will dig into the code and find the answer, but it would be nice to have a simple mental model of how this software works. In fact a high level mental model of the sort algorithm would be very helpful before reading the code.

Either way the software is working great, and is a huge improvement on my web site.

Eventually I will have to figure out how to replace it with a multi-core search solution.

PythonLinks avatar Feb 28 '23 21:02 PythonLinks

Okay, so digging into the code https://github.com/repoze/repoze.catalog/blob/19b2f69ae3f669ec242ed2c5e14e0569ab8f114d/repoze/catalog/catalog.py#L130

It is clear that first it finds all of the results, and then it sorts them. So if I limit the number to be sorted, then anything worse than the first n results, does not need to be further sorted, and can be discarded.

I could create a different version of that function, that tells me how many results there all together, and then sorts for the first n results.

PythonLinks avatar Mar 01 '23 11:03 PythonLinks