Thread: [Doxygen-users] Make server side search work
Brought to you by:
dimitri
From: Fabian C. <Cen...@in...> - 2018-05-09 07:49:07
|
Hi We put the doxygen generated documentation on a server and used the client side search previously. However some words could not be found as the client side search is not a full text search. That's why we now wanted to switch to server side search to get better results. The server is a linux with Apache with php, we also have e.g. MantisBT (bugtracker) and DocuWiki running on the same server, so php (7) is running fine. The documentation is generated on a different computer and then the whole html directory (output from doxygen) is copied to the live server. But when I try to search for something no results are returned, just like in this question: https://stackoverflow.com/questions/48440476/doxygen-server-side-searching-does-not-work These are the options from my Doxyfile: SEARCHENGINE = YES SERVER_BASED_SEARCH = YES EXTERNAL_SEARCH = NO SEARCHENGINE_URL = SEARCHDATA_FILE = searchdata.xml In the html/search directory is a search.idx file with all the text strings. I don't see errors in the logfiles in /var/log/. Is something else needed? Is there some debugging I can enable? Thanks bye Fabi |
From: Fabian C. <Cen...@in...> - 2018-05-14 08:22:27
|
At 09:47 09.05.2018, you wrote: >Hi > >We put the doxygen generated documentation on a server and used >the client side search previously. However some words could not be >found as the client side search is not a full text search. That's why >we now wanted to switch to server side search to get better results. > >The server is a linux with Apache with php, we also have e.g. MantisBT >(bugtracker) and DocuWiki running on the same server, so php (7) is >running fine. The documentation is generated on a different computer >and then the whole html directory (output from doxygen) is copied >to the live server. > >But when I try to search for something no results are returned, just >like in this question: > >https://stackoverflow.com/questions/48440476/doxygen-server-side-searching-does-not-work > >These are the options from my Doxyfile: > >SEARCHENGINE = YES >SERVER_BASED_SEARCH = YES >EXTERNAL_SEARCH = NO >SEARCHENGINE_URL = >SEARCHDATA_FILE = searchdata.xml > >In the html/search directory is a search.idx file with all the text strings. >I don't see errors in the logfiles in /var/log/. > >Is something else needed? Is there some debugging I can enable? Still trying to make this work. Has anybody used this? Should this work with PHP7? Thanks bye Fabi |
From: Fabian C. <Cen...@in...> - 2018-05-15 11:15:16
|
At 10:22 14.05.2018, you wrote: >At 09:47 09.05.2018, you wrote: >>Hi >> >>We put the doxygen generated documentation on a server and used >>the client side search previously. However some words could not be >>found as the client side search is not a full text search. That's why >>we now wanted to switch to server side search to get better results. >> >>The server is a linux with Apache with php, we also have e.g. MantisBT >>(bugtracker) and DocuWiki running on the same server, so php (7) is >>running fine. The documentation is generated on a different computer >>and then the whole html directory (output from doxygen) is copied >>to the live server. >> >>But when I try to search for something no results are returned, just >>like in this question: >> >>https://stackoverflow.com/questions/48440476/doxygen-server-side-searching-does-not-work >> >>These are the options from my Doxyfile: >> >>SEARCHENGINE = YES >>SERVER_BASED_SEARCH = YES >>EXTERNAL_SEARCH = NO >>SEARCHENGINE_URL = >>SEARCHDATA_FILE = searchdata.xml >> >>In the html/search directory is a search.idx file with all the text strings. >>I don't see errors in the logfiles in /var/log/. >> >>Is something else needed? Is there some debugging I can enable? > >Still trying to make this work. Has anybody used this? >Should this work with PHP7? To be sure to not have something else interfering I now created a new machine with Ubuntu 18.04, Apache2, Php7.2, Doxygen 1.8.13 and all needed dependencies. The internal search didn't work, same as before. After searching no results are displayed and the layout is messed up. Then I tried the external search with the doxyindexer/doxysearch.cgi. I created the database and setup the search as described here: https://www.stack.nl/~dimitri/doxygen/manual/extsearch.html Testing worked with "Test failed: cannot find search index doxysearch.db" and also "Test successful". However the searching for a real string didn't work either. The layout is conserved but still no results are returned. The direct search call does return a result like http://127.0.0.1/bin/doxysearch.cgi?q=clj ({ "hits":1, "first":0, "count":1, "page":0, "pages":1, "query": "clj", "items":[ {"type": "page", "name": "index::mcrobot", "tag": "", "url": "mcrobot.html", "fragments":[ ] } ] }) But searching from the search box is just empty http://127.0.0.1/search.html?query=clj Is the server based search already usable or work in progress? So far I think I need to go back to the client based search which is still better than having no results at all. Thanks bye Fabi |
From: Fabian C. <Cen...@in...> - 2018-05-18 06:56:31
|
>To be sure to not have something else interfering I now created a new >machine with Ubuntu 18.04, Apache2, Php7.2, Doxygen 1.8.13 and >all needed dependencies. The internal search didn't work, same as >before. After searching no results are displayed and the layout is >messed up. > >Then I tried the external search with the doxyindexer/doxysearch.cgi. >I created the database and setup the search as described here: >https://www.stack.nl/~dimitri/doxygen/manual/extsearch.html > >Testing worked with "Test failed: cannot find search index doxysearch.db" >and also "Test successful". However the searching for a real string >didn't work either. The layout is conserved but still no results are >returned. > >The direct search call does return a result like > >http://127.0.0.1/bin/doxysearch.cgi?q=clj > >({ > "hits":1, > "first":0, > "count":1, > "page":0, > "pages":1, > "query": "clj", > "items":[ > {"type": "page", > "name": "index::mcrobot", > "tag": "", > "url": "mcrobot.html", > "fragments":[ > ] > } > ] >}) > >But searching from the search box is just empty > >http://127.0.0.1/search.html?query=clj I debugged it down to search.js: function searchFor(query,page,count) { $.getJSON(serverUrl+"?cb=?", { n:count, p:page, q:query }, function(data) { It seems like the getJSON call is never successful and the success function is never called, even tough the same call directly executed does return a result. I finally got the external search to work. The problem was the search URL. Initially I had only the server string without protocol. Seems like the getJSON function doesn't like this. It only worked after I added http:// (or https://) to the search URL. It would be nice if there was some error message stating that the call itself failed and that the search URL is probably wrong. That would have saved me some time as I never knew where the problem was. And I still don't know what the problem with the internal search is. But I'm now going with the external search as this is recommended. Thanks bye Fabi |