doxygen icon indicating copy to clipboard operation
doxygen copied to clipboard

Replacing index with tag for main pages improves search results

Open AlexFinch opened this issue 9 months ago • 3 comments
trafficstars

Describe the bug

When search encompasses multiple packages each with their own main page I wanted to emphasize index.html pages and give them the name of the tag, not "index" so I added

std::string m_data;
std::string lastTagSeen;
FieldNames m_curFieldName;

.
.
.
 case TagField
            lastTagSeen=m_data;
            break;
.
.
.
case UrlField:
            /*
             If the Url is the index page then the name should be the tag name
            */
            if(m_data=="index.html")
            {
              m_doc.remove_value(NameField);
              m_doc.add_value(NameField,lastTagSeen);
              addWords(lastTagSeen,m_doc,200);
            }

Version 1.9.1 on AlmaLinux release 9.5

AlexFinch avatar Feb 12 '25 10:02 AlexFinch

  • The doxygen version 1.9.1 is already a bit older (January 8, 2021)), the current version is 1.13,2, what happens with this version?
  • from the description is unclear what you did and where, so
    • Can you please attach a, small, self contained example (source+configuration file in a, compressed, tar or zip file!) that allows us to reproduce the problem? Please don't add external links as they might not be persistent (also references to GitHub repositories are considered non persistent).
    • Please also specify the full doxygen version used (doxygen -v).

albert-github avatar Feb 12 '25 11:02 albert-github

I checked and doxyindexer on master branch hasn't changed in this respect.

doxygen -v 1.9.1 as I said in the original post

Here is an example for illustration

doxygenExample.tar.gz

Procedure is cd build doxygen ../DoxyfileForExternalSearchAndNoHistory cd ../cgi-bin doxyindexer find .. -name searchdata.xml

Then try searching. With normal doxygen the mainpage.dox is listed as "index", whereas with my modification it is listed as "example" (the name of the package). In particular with multiple packages this is much more useful. See attached screenshots

Image

Image

AlexFinch avatar Feb 13 '25 14:02 AlexFinch

As such it look like reasonable, though wouldn't this be valid for other files etc as well, so that it would be better to add, when multiple files are searched and the EXTERNAL_SEARCH_ID is set, from which EXTERNAL_SEARCH_ID the information is retrieved?

Note

  • when I remember well that when using tag files only one index.html is honored and similar also for variables etc.
  • the doxyindexer is shipped as an example (see e.g. https://www.doxygen.nl/manual/searching.html.
  • as a side node the cut off of the separation bar is due to the used header.html /footer.html, they should be adjusted to the used doxygen version (looks like they are based on doxygen 1.8.15)

Regarding the version request, this was part of a standard copy paste and in the case not required as you had already given (and I already commented about the age of it). Thanks for checking also the current master.

albert-github avatar Feb 13 '25 18:02 albert-github