01230: Wild card characters don't work in the PmWiki search box

Summary: Wild card characters don't work in the PmWiki search box
Created: 2010-10-24 15:54
Status: Open
Category: Bug
From: Neil
Priority: 443
Version: Latest
OS: Linux/Apache/PHP: 5.2.6

Description: In my own iteration of PmWiki and also the main pmwiki.org website I find that if I enter a search word terminated with an asterisk I get zero results. For example if I search on the word search* I get nothing, but if I use the word searching I get many pages .... I understand the * character to represent zero or more characters - so this seems to be an error.

I hope I haven't missed something obvious, but the wilcard characters don't seem to be recognised ...

Advice welcomed

Right now, you don't need to use wildcards, the word "search" will find pages containing "search", "searching", "searched" and "researcher". --Petko March 17, 2011, at 01:28 PM

But if I want "searching" and "searches" and "searched" but NOT "research" I don't have any way to do that... Moving to an implicit anchor-at-word-boundary with wildcards would be more intuitive. (I know I've tried searching using wildcards on multiple occasions and then belated remembered to just use the substring.) Peter Bowers March 17, 2011, at 04:03 PM

You do have any way to do that, use search -research for example. While I didn't design this function, I suppose Pm considered a fulltext search as exact text strings that need to be found -- this is how it is implemented since the beginning. It searches for the exact thing that the user entered. It's not perfect - a search for Mini in the cookbook returns more than 400 pages that are unrelated to the Mini recipe but contain the words "administration" or "minimal" - but as it has been around for a long time, I'm not sure how to change it without potentially break existing wikis/pagelists. And, if we consider wildcard searches, then how do we search for the exact characters, for example ".*?" or "* list item". --Petko March 30, 2011, at 06:23 AM

I notice an inconsistency here.
If I search for "foobar" I don't need wild cards, but if I search for "name=*foobar*" I do need wild cards

Simon March 30, 2011, at 01:56 AM

Just a note to say thank you for the responses, it has cleared up what was bothering me - I am used to complex search syntax and hadn't caught on to the way it worked. Now I know what to tell people when they ask. Much appreciated. Neil April 20, 2011