oscar-system / Oscar.jl

A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
https://www.oscar-system.org
Other
337 stars 120 forks source link

Improving search #3816

Open aaruni96 opened 3 months ago

aaruni96 commented 3 months ago

It is a known issue that search in our documentation leaves something to be desired for. I have been able to change search results, whether or not that is an improvement is not always clear.

This issue is to collect opinions and use cases for search, and also for figuring out the best way to make these changes permanent. Please add all the ways search misbehaves (provides different results than you expected / wished for), so that I can experiment with how to get those use cases working, and hopefully fix other unreported problems as a byproduct.

How search works

Here's a short overview of how search works, based on what I have been able to understand this past week:

Search is provided to us by Documenter.jl, using the Minisearch javascript search engine. It is an in memory search engine, which reads a pre-created index. So, the only two ways to change its behaviour are :

Based on config options while constructing the minisearch instance in documenter.js, it takes in the query string as input, and applies it to search_index.js. The results are then filtered using a filter function in documenter.js

Changes I've tried already

Making the changes permanent

Once we have decided what changes we actually want in the search engine, we should also decide how to make the changes persist. Things which benefits the search engine in general (like the first change) can be upstreamed to Documenter. But things like the second change (or hopefully, a more useful variant of the this), which are useless outside the context of Oscar, but still need to be reflected in assets/documenter.js cannot be upstreamed, and maybe we need a patch file to make changes at build time ?

lgoettgens commented 3 months ago

Disable results from Hecke/Nemo/AbstractAlgebra showing up in results

Can you maybe just disable all results from files that are not contained in the doc.main file, i.e. the list of files reachable via the menu?

aaruni96 commented 3 months ago

The search index is a javascript file which assigns the entire index to a variable. Instead, it could just be the index in a JSON file, and it could be assigned to a variable from within documenter.js. Then we could write a simple script which deletes any entry in the index which is not also in doc.main.

I've opened an issue in Documenter.jl for this.