BoltWire

Innovative Ideas :: Radical Results!

INFORMATION

DOCUMENTATION

SOLUTIONS

Search

Documentation > Concepts > Search

BoltWire has sophisticated search capabilities, plus a powerful templating engine for output. There are a few things you should know in order to maximize its capabilities.

Indexing

Before your search will work, the pages need to be indexed. This includes indexes of text, data values, and links. And it's all done by simply putting the [(index)] markup on a page. This markup however only indexes a few pages at a time, to keep it from slowing down your site, so it should be called frequently to keep your indexes current. There are several ways to do this:

  1. Put it directly in your skin, or in a markup zone.
  2. Put it in a page visited frequently, like your home page.
  3. Use Cron Jobs to call this page periodically, in the background (the preferred method).

The number of pages checked each time it is called is configurable using the indexBatch variable in site.config, by default set to 25 pages (for text, data, and links). Set it to a smaller number if you are putting it in your skin or a bigger number if you have an active site. You can also set it higher temporarily, when initially indexing your site.

Note: the index function is also called each time you call the search engine, to incorporate recent changes to your site
Tip: it should only be 25 or 50 until the site is fully indexed. You can then change it to 5, which should be enough for most website. It's a matter of trying and finding the right value for your homepage.

How to Search

There are two types of searches you can do in BoltWire, and two ways to do each. The types of searches include searching for page names by some pattern or criteria. The other is searching page content for specific text, data values, or links/tags. The two methods include generating search output automatically, and using user input to generate output, such as in a search box. To search automatically you use a function. To search by user supplied criteria, you will use a form command.

Search function parameters

The search function is great for producing dynamic lists of various types (using BoltWire's templating). Listed below are some of the parameters you can use to control how a search is conducted:

pattern='/pattern/' used to limit pages searched
group=action used to limit pages to specified group
exclude=one,two used to exclude pages one and two from list
type=-header used to exclude all header or footer pages from list
template=page define template used to display output
fmt={+p} a faster way to generate simple output
join=x used with fmt to connect output results
dir=stamps used to generate lists from stamps directory
order=reverse to return the pages in reverse order, can also set to random
count=5 to limit to first 5 returns, or can set to 10-20
sort=field to sort the list based on each pages' data value for field.
text=string what text to look for
data="field=value" used to find pages with specified data values
if="condition" to find pages with a certain condition. Example: if="equal {+p0} 4"
link=page used to find pages with links to specified page
tag=topic used to find pages tagged with specified topic

Examples


The following example would list your site's action pages: [(search group=action)]. The markup for finding pages with the word "happy" would be: [(search text=happy)]

Commands

The form commands work very similarly, using the same syntax and parameters. In fact they actually call the same underlying PHP functions. The parameters however must all be set by a corresponding form field named "search". Unlike the function, the search command do not produce any output directly but saves it to a session value to be displayed on the nextpage. To see this output, the target page must include a markup.

Complex Searches

When looking for pages with certain text (find), data, or links, you can use complex searches. For example:


<code>
No search results found. #will return pages with both words on it.
</code>
<code>
No search results found. #will return pages with either word on it.
</code>
<code>
Documentation > Administration > Installation
Documentation > Extending BoltWire > Creating a Blog/Forum
Documentation > Extending BoltWire > Skin Creation
Documentation > Handbook > Markups
Documentation > Layout
Documentation > Layout > Skins
Downloads
Downloads > Roadmap
Member > 6440
Member > 824859
Member > 982412
Member > Abandon357
Member > Abc454
Member > Abookfish
Member > Adamatayoesme
Member > Admin
Member > Alkayamasht
Member > Analbeard
Member > Bach
Member > Bcd414
Member > Beanlinda28
Member > Beannoemi29
Member > Beatriz26campos
Member > Bjorn
Member > Blitz
Member > Brucelin
Member > Bstep
Member > Byrdjillian35
Member > Cde381
Member > Cdinclay
Member > Danlanigan
Member > Dauerbach
Member > Def604
Member > Designerhandbag
Member > Dfaber09
Member > Dixonadeline25
Member > Dkmo
Member > Dorscholtesalva
Member > Doyle28juliet
Member > Drenddetatege
Member > Ebrinleethur
Member > Efg077
Member > Efg277
Member > Espinoza24tracey
Member > Esther20hubbard
Member > Evangelinerodriquez
Member > Farley29deann
Member > Farrelljami29
Member > Fchalffeyjani
Member > Fgm
Member > Flores26elsa
Member > Ghi539
Member > Ghi834
Member > Gillespieadriana26
Member > Ginoiori
Member > Hammondmelanie19
Member > Hij584
Member > Holmes27lily
Member > Holmeskatheryn24
Member > Icameliscott
Member > Ijk394
Member > Ijk805
Member > Ingmar
Member > Ioflaminibern
Member > Ionadiojera
Member > Isent
Member > Itacadinalurl
Member > Jacmgr
Member > Jacquelineirwin25
Member > Joygarner21
Member > Js
Member > Kittyfletcher
Member > Klm733
Member > Kulumulunku
Member > Langleylakisha20
Member > Lebaston
Member > Lmcfarlainmanue
Member > Lmn753
Member > Lmn825
Member > Madmin
Member > Mangeo
Member > Marciemunoz25
Member > Maricela21jordan
Member > Martin
Member > Michael31benita
Member > Mika
Member > Mno822
Member > Mno879
Member > Moj
Member > Morningprayers
Member > Morselessie33
Member > Myplatypus
Member > Nbehnams
Member > Neha1370411758gems
Member > Nell21rojas
Member > Nersonsdonn
Member > Nettiechan31
Member > Nnapesinasilva
Member > Nop015
Member > Nop297
Member > Nop404
Member > Nop575
Member > Nyrailingstace
Member > Opq216
Member > Othiaville
Member > Panero
Member > Patricemiranda
Member > Pauletteforeman
Member > Petradiaz19
Member > Phpadam
Member > Pixfun
Member > Pqr422
Member > Qrs153
Member > Qrs565
Member > Rdsaemenesrayfo
Member > Richfrancisca34
Member > Ricpot
Member > Rivers26faye
Member > Rowe19cherie
Member > Rst260
Member > Rst616
Member > Salaman
Member > Shuherus
Member > Silverado1363821540community1363821540garden
Member > Skiwi
Member > Sosa25araceli
Member > Srini
Member > Sskotasphyli
Member > Stevej
Member > Suzannemontoya35
Member > Suzette28lawson
Member > Tatax
Member > Tercuttinsylv
Member > Test123
Member > Thelma32mcdonald
Member > Thorntonjulianne23
Member > Ttadougtiffany
Member > Tuv125
Member > Tuv400
Member > Ukads
Member > Umettler
Member > Univerinfoswiki
Member > Uvw893
Member > Vermuz
Member > Vwx035
Member > Vwx213
Member > Ysaito
Member > Yuiio
Solutions > Community > Addthis
Solutions > PIM > To Do Box
Test
Test > Abort
Test > Alert
Test > Badbox
Test > Calculator
Test > Html
Test > Img
Test > Kingdom
Test > Main
Test > Search
Test > Sectionheader2 #will return pages with neither word on it.
</code>
<code>
No search results found. #will return pages with both apples and oranges or without bananas.
</code>



This complex, boolean capabilities makes sophisticated searches possible.

Templating

BoltWire is powerful when it comes to how to display search results. Fore more info read search Template & Fmt

How To

How to display pictures which were uploaded?

[(search dir=files type=gif,jpg fmt="img:{+p}")]

or when subfolders are used:

[(search dir=files/covers type=jpg fmt="[^{+p}.jpg dir=covers^]")]

Copyright © 2013, all rights reserved.