New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wiki search fails if restricted to a namespace whose ID contains '-' or '.' #1659
Comments
This query matches: (This works fine, but is not your issue... This finds a lot of pages in this namespace: https://www.dokuwiki.org/start?do=search&id=RSS+%40zh-tw Query with part of namespace fails as well: |
The query parser is |
Only exact namespace will work. Eg. The search for the zh-tw namespace shows that the feature is generally working. @jscheiber could there be something else interfering with your search results? Can you reproduce the problem at dokuwiki.org? Does the problem only occur when searching from the searchform plugin or from the "normal" search field in the dokuwiki template as well? |
Zh-tw example is wrong, because it is not searching for page name. |
1. Reproduction at dokuwiki.orgOnly partial reproduction so far:
Full search works fine with: It fails for a page name search: but page name search works if started in parent namespace: The results are a bit different from our setup, since ours also fails for page titles, but this could be due to configuration settings. 2. SearchformThe issue appears identically with searchform and the core Dokuwiki search field 3. InterferenceSome of our configuration settings that affect search obviously differ from the dokuwiki.org settings. |
Added 2 more examples at Dokuwiki.org playground:
Namespace Example with a dot - Issue reproduced
Searches:
Namespace Example with only underscore delimiter - everthing OK
Searches:
All searches work, if namespace does not contain '.' or '-'. |
The root cause is that the responsible regex does not account for This could easily be fixed by adjusting the regex. However, I'm wondering why we are fiddeling with regexes, when we have a query parser? Or would using the query parser drain too much performance? |
The regex for the pagename lookup didn't account for `-` and `.` being valid characters for namespaces, which lead to wrong results in the quicksearch and pagename lookup. The full search, which already used the queryParser, showed the correct results. This fixes #1659
Applies to: "Detritus" and "Elenor of Tsort"
Modules: Wiki core search and searchform plugin
Description
Namespaces containing the special the characters '-' or '.' like
dev:releases:release_2016-04-02
or
cal:2015:date.20150801
are valid according to Wiki documentation, but when restricting search to such namespace with special characters, Wiki search and related plugins (searchform) do not show quicksearch and full search results e.g.:
changelog @dev:releases:release_2016-04-02
fails to show the "changelog" page in this namespace, whereas a search starting in the parent namespace
changelog @dev:releases
shows all changelogs in all sub-spaces including "release_2016-04-02"
Why is this issue important?
Beside the general confusion of not finding things in certain areas, this bug currently prevents us from using DokuWiki as lightweight CRM, since many namespaces for e.g. actions, dates, projects, contacts, offers, etc need a unique naming convention
e.g.:
c.contactname ... for contacts
dt.YYYY-MM-DD_datename ... for dates, meetings
a.YYYY-MM-DD_actionname, prj.projectname, wp.workpackagename, ... etc.
Most of these namespaces get automatically a sidebar that allows search within this contact / project / ... (plugin searchform).
Since the underscore is frequently used for all sort of pages, its easy to discriminate between automated CRM-pages and normal user pages, if the prefix delimiter is a "." and users are requested not to use dots in their page names.
The text was updated successfully, but these errors were encountered: