JuliaDocs / Documenter.jl

A documentation generator for Julia.
https://documenter.juliadocs.org
MIT License
812 stars 479 forks source link

Search results: link directly to page rather than top-level section name (aka the page title) #632

Open waldyrious opened 6 years ago

waldyrious commented 6 years ago

Initially reported as part of #629. In the example there, a search for "markdown" (http://docs.julialang.org/en/latest/search/?q=markdown) produced the following entries among the results:

The second link above is redundant with the first one, and the third should have been simply https://docs.julialang.org/en/latest/manual/documentation/# (I'd remove the # as well, but that's a minor issue).

odow commented 11 months ago

Closing because this seems to have been fixed. I can't reproduce with https://docs.julialang.org/en/v1/search/?q=Markdown.

waldyrious commented 11 months ago

The second link above is redundant with the first one

This still happens with the updated link you provided.

odow commented 11 months ago

Perhaps I misunderstand then. Why exactly is that a problem?

mortenpi commented 11 months ago

FWIW, I think the same sections are still present with the new front-end / minisearch as well:

image

odow commented 11 months ago

I don't really understand the problem though. One is a page name, one is a section header?

mortenpi commented 11 months ago

I think the fundamental problem here is that we have both pages, and each heading individually as part of the index separately. So the search engine has no idea that those are kinda the same thing. As in, most of the time, the first h1 heading is the same as the page title.

cc @Hetarth02 just as an FYI, if you happen to have any thoughts.

Hetarth02 commented 11 months ago

Yeah, we could do a url parse and add something like an accordian to group up the same urls under one.

For example,

test.com/markdown

mortenpi commented 11 months ago

I don't think we need a UI solution this. We just shouldn't show the results, either by removing them from the JSON index, or ignoring on the minisearch level somehow.

Hetarth02 commented 11 months ago

As I said earlier, we could group results under same page and make an accordian/dropdown with a visual hint. Will work on some mockups for the same(might take a little bit). Open to other ideas as well.

waldyrious commented 11 months ago

I don't really understand the problem though. One is a page name, one is a section header?

In my previous comments I described having both the page title and the top-level section as independent entries in the search as being "redundant", but @mortenpi put it more clearly: those are essentially the same thing, and thus duplicates. The reason this is bad is that each additional entry in a search results listing introduces additional noise and makes it harder to locate the actual content one may be looking for (even if it the content being search for is one of those, because it forces the reader to understand that they both refer to the same thing).

I also agree with him that the solution shouldn't be folding the extra results (which I see as "sweeping the dirt under the rug", if you'll pardon the expression). The correct solution is indeed, as @mortenpi said, to not include the redundant entries in the search results in the first place.