Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #13

Open
PythonLinks opened this issue Aug 6, 2022 · 2 comments
Open

Documentation #13

PythonLinks opened this issue Aug 6, 2022 · 2 comments

Comments

@PythonLinks
Copy link

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
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant