Wiki Search not working as expected
erpnext 14.44.1
frappe 14.52.1
wiki 2.0.0
Wiki pages are published, but not guest accessible.
- All Wiki page routes are in the form of
wiki/page1 - All Wiki pages are added to a Wiki Space with route
wiki - In Wiki Settings, the default space is the
wikispace
When navigating to a Wiki page, i.e. example.com/wiki/page1, I have the Search Bar present. I can click it and execute a search, but generally I get no results.
- If I search for
Troubleshooting, which I know that there are several pages with withTroubleshootingboth in the title and the content of the page, I get no results. (see example 1) - If I search for
wiki, I get a random assortment of Wiki Page results that I can click on and navigate to, but the results are literally just the route of the page - the title and content are not present in the search results. (see example 2)
Expected Behavior
I expect the search function to show relevant search results for terms that I know are present in the Wiki.
Example 1:
Example 2:
Other info
I noticed that Wiki Page was not in the Global Search Settings list, so I added it, but nothing changed.
As far as I can tell, the search path once submitted to the server goes as such:
- The HTTP Query contains parameter
cmdofwiki.wiki.doctype.wiki_page.search.searchwhich translates to thesearchfunction located inwiki/wiki/doctype/wiki_page/search.py - Since I don't have redis enabled in Wiki Settings, it defaults to the Frappe web search. This function calls
web_searchwhich isfrom frappe.search import web_search - This function is defined in the
frappe/frappeGit Repository here - This instantiates a new
WebsiteSearchobject withindex_name="web_routes"as its sole parameter, then calls itssearchfunction.WebsiteSearchis a wrapper on top ofFullTextSearchclass, which is where thesearchfunction is defined. - This calls a
Whooshsearcher to do the actual search. I haven't traced any further than this.
Can you try enabling redis from Wiki Settings and try again? Or try running bench --site <sitename> rebuild-search-index and see if the pages are shown.
- Does the search index need to be built/rebuilt after every new wiki page is added?
No, the the index for a new wiki page is built whenever it is created. Not sure what exactly is impeding from rebuilding the index.
I tried redis already, no change.
What did you face when redisearch was enabled?
Hi, in my case any of this command works for mi. I have a wiki in docker with the last changes.