odoc
odoc copied to clipboard
Support generating ranked search indices
It would be great to generate ranked search indices of the docs.
James Somers at Jane Street wrote a patch that we used to generate a search index for an elastic search instance. The code is here but it was written against the old version of odoc so would need rebasing.
The reason we did not pursue the idea further at the time was that we found that the results were pretty useless without a good mechanism for ranking the results. The most natural approach would be to base the ranking on how often values and types are used in the code base. However, odoc does not currently ever examine OCaml implementations -- it only looks at interfaces -- and it is the uses in the implementations that we would wish to count.
If the patch discussed in #566 is finished then we can use the lists of used paths mentioned in that PR description as the basis for the ranking.
Discussing this over IRC, we mentioned possible client-side solutions (which would work on github hosted doc, unlike elastic search):
- https://stork-search.net/
- https://endler.dev/2019/tinysearch/
(both are in rust compiled to wasm)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. The main purpose of this is to keep the issue tracker focused to what is actively being worked on, so that the amount and variety of open yet inactive issues does not overwhelm contributors.
An issue closed as stale is not rejected — further discussion is welcome in its closed state, and it can be resurrected at any time. odoc maintainers regularly check issues that were closed as stale in the past, to see if the time is right to reopen and work on them again. PRs addressing issues closed as stale are as welcome as PRs for open issues. They will be given the same review attention, and any other help.