Item10527: broken: negated regex/match queries
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
This query:
%SEARCH{
"parent.name='WC' AND NOT form.name~'*TermForm'"
type="query"
web="TaxonProfile/Definitions"
}%
Seems to be hoisted into an invalid mongo query:
Wed Mar 23 17:16:53 [conn16] assertion 13454 invalid regular expression operator ns:foswiki.current query:{ orderby: { _topic: 1 }, query: { FORM.name: { $ne: /^.*TermForm$/ }, _web: "TaxonProfile/Definitions", TOPICPARENT.name: "WC" } }
(the error seems to imply that
$ne
can't be a regex?)
--
PaulHarvey - 23 Mar 2011
Why did I make this enhancement? Also broken:
VarSEARCH's
excludetopic
parameter
%SEARCH{... excludetopic="*Template"...}%
assertion 13454 invalid regular expression operator ns:foswiki.current query:{ orderby: { TOPICINFO.date: -1 }, query: { _web: "_TrinBlogCommon", FIELD.Feature.value: "true", _topic: { $ne: /.*Template/ } } }
actual search:
%SEARCH{"Category~'*'" web="%thebaseweb%" type="query" nonoise="on" nofinalnewline="on" excludetopic="*Template,%FEATUREPOST%" order="created" reverse="on" limit="%hlimit%" format=" * <small>[[%thebaseweb%.%BASETOPIC%#Headline$ntopics][$formfield(Title)]]</small>"}%
--
PaulHarvey - 28 Mar 2011
looks like it doesn't error in 1.6, but does in 1.8 - however, the 1.6 result wasn't correct either. I've recoded the hoister to emit $not as it should..
(fixed i think)
--
SvenDowideit - 28 Mar 2011
Looks like it's working
--
PaulHarvey - 03 Apr 2011