[Pmwiki-users] Search sometimes complains loudly

John Rankin john.rankin at affinity.co.nz
Mon May 5 15:58:29 CDT 2003


Yes, that's logically consistent. I might add a 'traps for young players' =
note to the Search page -- just to explain what happens in the various =
circumstances set out below. Otherwise, I can see "now why did that happen?=
" questions.
'
I have also reformatted the 'Searching for' line in the results page to =
reassemble $incl, $excl and $group into an explanatory phrase -- will send =
the code (it's about a 5 line function).

(apple pancake recipe available on request -- great on a crisp early =
winter morning)
--=20
John Rankin
Affinity Limited
T 64 4 495 3737
F 64 4 473 7991
021 RANKIN
john.rankin at affinity.co.nz
www.affinity.co.nz

On Monday, 5 May 2003 6:18 PM, Patrick R. Michaud <pmichaud at sci.tamucc.edu>=
 wrote:
I think that changing line 35 from

    preg_match('/^([-+]?)([\'"]?)(.*?)\\2$/',$t,$match);

to=20

    preg_match('/^([-+]?)([\'"]?)(.+?)\\2$/',$t,$match);

ought to be a reasonable fix.  This forces the search term itself
to have at least one character, stealing it from the [-+] if necessary.
Thus

	apple -pancakes		"apple" but not "pancakes"
	apple - pancakes	"apple", "-", and "pancakes"
	apple + pancakes	"apple", "+", and "pancakes"

I have it this way on pmichaud.com at the moment, and if you concur
with the fix then it'll be in the next release.

Pm


On Mon, May 05, 2003 at 09:06:05AM +1200, John Rankin wrote:
> If one enters apple - pancakes instead of apple -pancakes then pmwiki =
gives a most robust response.
>=20
> I patched HandleSearch to preg_replace '[-+]\s*' with '[-+]' but that =
has the side effect of changing phrase searches such as "world + dog" to "=
world +dog" so it probably needs a proper fix.
>=20
> Otherwise search is working well.
> --=20
> John Rankin
>=20
>=20
>=20
>=20
>=20
> _______________________________________________
> Pmwiki-users mailing list
> Pmwiki-users at pmichaud.com
> http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
>=20







More information about the pmwiki-users mailing list