Boldwire Search data field question

29 views
Skip to first unread message

Kevin

unread,
Oct 27, 2012, 12:38:21 AM10/27/12
to BoltWire
Pretty sure that I can do this, just not sure what the syntax would be.

In a FAQ section of the website, I want to add a data field to articles called keyword.  I want to then use a set number of predefined keywords like.

OS
APPS
MISC
HWD

I thought I could do something like below looking for just HWD entries...:

[(search field(keyword)="HWD") group={p} fmt="* [[{+p}|+]]")]

but I am not getting the results that I want.  I want it to list only the articles in the current group that match a data field in them called keyword that has HWD.  I've tried a couple combinations without any success.

Hope this makes sense.

DrunkenMonk

unread,
Oct 27, 2012, 3:34:44 AM10/27/12
to bolt...@googlegroups.com
I would probably store the keywords in the data field as a csv list, and then search with

[(search group={p} if="inlist KEYWORD {+:DATA_FIELD}" fmt=...)]

or something. I forget the best way to target the list in question, but something like that should work. BW has pretty good methods of edit data fields as lists too, if you don't know your keywords at creation time.

The Editor

unread,
Nov 2, 2012, 1:44:52 PM11/2/12
to BoltWire
I actually added some pretty robust data searching features to
BoltWire in one of its later iterations, but the syntax is not
intuitive.

To work, your site must be properly indexed.

Try this

[(search group=whatever "field(=)value")]

Obviously you can use any field or value. The equal sign can be
replaced with any of the following:

= equals
< less than
> greater than
& 1|10 (between)
, in csv list
+ anywhere in the string
- not in the string
? if set
! if not equal to
0 equals 0 (not sure about these last two)
1 equal 1

It's also very fast because it strictly uses the indexed data and
doesn't have to look up any actual pages.

Took me a bit to reconstruct this info from the code. Suppose it
should get documented somewhere... :)

Blessings,
Dan

P.S. Of course DrunkenMonks solution no doubt works as well--if
performance is not an issue.
> --
> You received this message because you are subscribed to the Google Groups
> "BoltWire" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/boltwire/-/QylhlVrThz8J.
>
> To post to this group, send email to bolt...@googlegroups.com.
> To unsubscribe from this group, send email to
> boltwire+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/boltwire?hl=en.

Kevin

unread,
Nov 2, 2012, 11:58:23 PM11/2/12
to BoltWire
Thanks...

I used this in a FAQ section where I added keywords to provide what types of FAQs  Then set the keyword to include PROC HWD APPS MISC... like:

!!! Procedure FAQs
[(search group={p} "keyword(=)PROC" ) fmt="* [[{+p}|+]]")]

!!! Hardware FAQs
[(search group={p} "keyword(=)HWD" ) fmt="* [[{+p}|+]]")]

!!! Application FAQs
[(search group={p} "keyword(=)APPS" ) fmt="* [[{+p}|+]]")]

!!! Misc FAQs
[(search group={p} "keyword(=)MISC" ) fmt="* [[{+p}|+]]")]


Is there a way to say if there is no keyword data field?

The Editor

unread,
Nov 3, 2012, 7:49:47 AM11/3/12
to BoltWire
How about "keyword(=)". Just tried it, Seems to work...

Dan

Kevin

unread,
Nov 3, 2012, 8:54:53 AM11/3/12
to BoltWire
Thanks for the response Dan... Just tried that... Doesn't seem to work..   I had also tried "keyword(?)"

!! Uncategorized
[(search group={p} "keyword(=)" ) fmt="* [[{+p}|+]]")]

Example Page:
http://rpi.tnet.com/project/faqs

All of the FAQs are child pages of the main.  each has a keyword data element.  If I create a new FAQ and have not yet added a keyword, wanted it to show up under Uncategorized section.

Bottom two sections are in markup.  There is a page that has no keyword data element created.

The Editor

unread,
Dec 13, 2012, 11:01:00 AM12/13/12
to BoltWire
Sorry for the slow delay in the response Kevin. I have been a bit overwhelmed with projects. Very frustrating...

Anyway, I'm surprized--but we don't have this capability in the current code. If you look in engine.php around lines 1694 - 1717 you can see all the options currently available. In BoltWire 4.0 (not yet released) I added this code:

case '^': return ($data != '');

You could either add it and then use keyword(^) or you could use the following with existing code: keyword(,)PROC,HWD,APPS,MISC

As far as BoltWire 4.0, I have a site or two up and running on it and have most of the bugs worked out. Very nice features. If I can find some time over the holidays  to work on it, I have only a couple more of the scripts to comb through and may be able to get something out by new years. 

Thanks for everyone's patience.
Dan

Kevin

unread,
Dec 13, 2012, 11:35:30 AM12/13/12
to bolt...@googlegroups.com

Can totally relate to lack of time....  For me... Last day at work is today until after the New Year...  Fun time starts at 5pm...

The Editor

unread,
Dec 13, 2012, 12:38:05 PM12/13/12
to BoltWire
Have a great break Kevin!

Dan
Reply all
Reply to author
Forward
0 new messages