simonmichael / hledger_site

The repo for hledger.org, the hledger project's website.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

search results annoyingly return one match for each hledger release

lestephane opened this issue · comments

When I search the docs, i only care about a specific version. I don't know how to select the version i'm interested in (hint: there should be an obvious one), so I just type something in the search field of hledger.org (say, cookbook), and here is what I see

image

the list is polluted with matches from previous versions

Even if one decided to keep matches from all versions, the matches have no indication of the version they relate to, this is really annoying.

Good catch, thanks. There may be something we can do in https://github.com/simonmichael/hledger_site/blob/master/conf.py.

Now that there is a 'selected version' in the upper right corner, it brings us closer to constraining the search to that version.

My understanding is that, since all versions available for selection in the upper right corner are present in sub-directories of master, and because the search engine searches master, one gets matches in all previously released versions that are still visible in master.

So it's not like the search engine searches a different git tag based on the selected version.

I don't know what the sphynx best practice is for this. Is this search capability a built-in feature of Sphynx, or are you using an extension?

I'm using sphinx's default search. Perhaps there's a way to configure it to ignore certain directories ? There's also some more complicated better-performing search extension available.

On readthedocs, the entire doc set is versioned and switching versions means switching between git tags. Since hledger.org is a mix of versioned and unversioned docs, I have copies of all versions (of the reference manuals) in master. This creates hassles like this (also, slower build times), but is the simplest solution I could find.

So excluding the non-relevant directories from search seems the path of least resistance.

Is sphynx using a full text index, or the equivalent of "grep -r"?

I may be able to look at it at the beginning of next month, when i do my bookkeeping chores again

Fixed by #28.