Item10527: broken: negated regex/match queries

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: MongoDBPlugin
Branches:
Reported By: PaulHarvey
Waiting For:
Last Change By: PaulHarvey
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 smile

-- PaulHarvey - 03 Apr 2011
 

ItemTemplate edit

Summary broken: negated regex/match queries
ReportedBy PaulHarvey
Codebase trunk
SVN Range
AppliesTo Extension
Component MongoDBPlugin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins MongoDBPlugin:95456c53343f
TargetRelease n/a
ReleasedIn n/a
Topic revision: r6 - 03 Apr 2011, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy