You are here: Foswiki>Tasks Web>Item2445 (10 Aug 2011, PaulHarvey)Edit Attach

Item2445: Webless FORM and TOPICPARENT make searching very clumsy

pencil
Priority: Normal
Current State: Duplicate
Released In: n/a
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: ArthurClemens
Waiting For:
Last Change By: PaulHarvey
This bug report describes the failure of finding topics with a data form attached, where the form definition is located in a subweb. Query search fails, regex search does find results.

UPDATE: the problem occurs as soon as a topic refers to the form definition topic as Web.FormDefinitionTopic, and the meta data gets:
META:FORM{name="Sandbox.QuickReferenceForm"}
META:FIELD{name="Title" attributes="M" title="Title" value="My title"}
END UPDATE

Assume:
  • a subweb SDO in Sandbox
  • a form definition QuickReferenceForm in subweb Sandbox/SDO, for instance:
    | *Name*  | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |
    | Title | text | 80 | | title | M |
    
  • the form is listed in Sandbox/SDO.WebPreferences
  • you create a new topic QuickRefDataTest, and add the form, and fill in some values, and save
  • the topic metadata now says:
    META:FORM{name="Sandbox/SDO.QuickReferenceForm"}
    META:FIELD{name="Title" attributes="M" title="Title" value="My title"}
    
(percentages removed here to be able to save topic)

Now create a search:
%SEARCH{
type="query"
"QuickReferenceForm"
format="   * [[$web.$topic][$topic]]"
web="all"
}%

This does not find anything.

Compare this to regex search:
%SEARCH{
type="regex"
"[Q]uickReferenceForm"
format="   * [[$web.$topic][$topic]]"
web="all"
}%

This finds the one topic.

-- ArthurClemens - 02 Dec 2009

Isn't the problem that Query search does not search in Meta?

And is that a bug?

There is a syntax for query search for the form name.

Crawford am I interpreting the query search spec right.? I.e. a simple "Textstring" as search string in query search only searches the text = text without meta.

Arthur does it work if you change the query search to use the syntax for finding a form name? I.e. use this instead

%SEARCH{
type="query"
"form.name ~ '*.QuickReferenceForm'"
format="   * [[$web.$topic][$topic]]"
web="all"
}%

The that I used wildcards for the form name so it can find the form both with and without a prefixed web name.

-- KennethLavrsen - 04 Dec 2009

Yes, it does work using form.name.

-- ArthurClemens - 05 Dec 2009

I hate to have to say this, but that's not a bug in query search. The definition of %META:FORM allows for either Web.Topic or Topic alone. In the case it's Topic alone, the "current" web is implied - whatever the "current" web may mean. Query search just does a string match - it has no semantic information about form.name, so cannot extend a "simple" topic with a web name.

The only solution to this is to drop the name="Topic" form of the meta-data. And I never figured a way to do that cleanly.

Note that the same problem exists with the TOPICPARENT meta-datum.

The workaround is to use the 'like' operator e.g. form.name~'*QuickReferenceForm' - which may pick up unintended forms, but if the best I can offer.

I changed the headline (it was "Query search does not find a topic if its form definition reference is Web.FormDefinitionTopic") and reduced priority to Normal. This is not a release blocker (been there since before QuerySearch was invented)

-- CrawfordCurrie - 05 Dec 2009

We also have got the match operator as well. Best for now is to use form.name =~ '\bQuickReferenceForm\b' This matches a word inside the form name spec. This pattern is also used very often to search for items in a coma-separated lists stored in formfields. More user-friendly would be a contains operator.

-- MichaelDaum - 03 Jan 2010

Duplicate of Item10813 which is closed as a doc fix, see also Item10484

-- PaulHarvey - 10 Aug 2011

ItemTemplate edit

Summary Webless FORM and TOPICPARENT make searching very clumsy
ReportedBy ArthurClemens
Codebase 1.0.8, trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Duplicate
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
Topic revision: r7 - 10 Aug 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