First of all, to call PicoSearch use the code from your account manager's section on "How to Add a Search Box". Then there are several initializers you can pass to PicoSearch from the
search box code on your site, so that searches will start in a certain
partition, a certain language, or a certain ANY/ALL/EXACT state, for
example. These possibilities are usually covered under the respective
special features they represent, and here we'll just collect the most
popular options into one FAQ. You may also be interested in the FAQ on how to make a custom search box.
- Initializing the ANY/ALL/EXACT state
- If you have the ANY/ALL/EXACT drop-down menu turned on in your
account manager's Page Design options (on by default), then your user
can change their searches to match any word, all words, or exact phrase
(see the query syntax FAQ for examples of what these do). Even if you turn off the user's choice,
you can set the ANY/ALL/EXACT searching mode in two ways. (1) Set the
default searching mode in that same account manager section, or this
default is easily overridden whenever (2) the ANY/ALL/EXACT setting
comes from the opt argument in the search box code on your website.
ALL searching can be great for focussing and limiting the search
results. For example, if your site pages use a lot of the same words
such as a hair products store, then searches for [hair spray] in ANY
words mode should return the hair spray pages first but will also return
every page with "hair", which is probably most. ALL searching would
only return pages with "hair" and "spray". And you don't have to worry
about one bad word breaking the search, because the default behavior is
to rollover to ANY search for ALL searches that return no result (see
the option in Page Design).
If you have the ANY/ALL/EXACT drop-down menu in the search box code that
you paste on your website, you can change the starting selection simply
moving the selected="selected" attribute that's probably next to the value="ANY" to instead be next to the value="ALL" or value="EXACT". The selected="selected" attribute is how HTML sets a menu's initial choice.
If you don't have the ANY/ALL/EXACT drop-down menu in your search box
code, then searches will use the default that you set in your account
manager. Or you can still quietly initialize the choice by adding the
following to your calling code anywhere after the "<form ... >"
statement. To initialize the search to EXACT phrase mode, substitute the
word EXACT for ALL.
<input type="hidden" name="opt" value="ALL" />
If you are calling a simple link such as the one-click entrance (ts0.pl rather than ts.pl) to start
your searches, you just need to add the code in red from the following
HTML example. Substitute your account ID for 123456. Remember, the
one-click entrance is the alternative to a search box, that's why it doesn't have a query and doesn't
actually search for anything yet.
- Initializing the Query search term
- You can initialize the search term, and in fact initialize multiple
search terms that get logically combined. This is covered in Combo Searches FAQ in detail for advanced users.
To preload the search query box is simply a matter of filling in the value attribute in the query input line of your search box code. This can be good for helping the user get started, as in this example:
<input type="text" name="query" value="TYPE SEARCH HERE" size="20" />
Or if you want to have a simple link or graphic that goes straight to a
predefined search, see this example for the url that searches instantly
for "antique cars". Notice that spaces need to become %20 in a direct
link call like this. Similarly, quotes would need to become %22. You can
also add other arguments like the &opt= to initialize the
"ANY/ALL/EXACT" state (see above).
<a href="http://www.picosearch.com/cgi-bin/ts.pl?index=123456&query=antique%20cars">search antique cars</a>
With the one-click entrance, you can similarly add
"&query=TYPE%20SEARCH%20HERE" to the end of the url to call. If you
call the usual ts0.pl for the one-click, no search is done, so you get
the effect of adding some documentation to the following search box.
But if you call ts.pl, then you get a real search begun on the preloaded
word. It's up to you which makes more sense for your users to see.
- Initializing the Partition state
- See the instructions at the bottom of the Partition FAQ.
- Initializing the Language display
- See the instructions in the Set Language FAQ.
- Initializing the Number of Results and Total Results
- You can set the number of results per page (default 10, maximum
200), and the number of total results possible (default ALL) in your
account manager's Ranking Options section. You can also override these
settings for specific search boxes with the following hidden arguments
from your search box code (nr for number of results, tr for total
<input type="hidden" name="nr" value="42" />
<input type="hidden" name="tr" value="199" />
- Initializing the Sort selection
- You can set the type of sorting for search results to be by date or relevancy in your account manager's Ranking Options section. You can also override this setting for specific search boxes with the following hidden argument from your search box code. The values for sortsel are either "date" or "relevancy", and may include more options in the future.
<input type="hidden" name="sortsel" value="date" />
- Initializing the Search Within context
- The Search Within
feature accumulates searches, so that the next search is in the context
of the results already found. You can turn on the option to search within results for all of your searches, from your account manager's Page Design section. If you want to initialize the Search
Within feature to be on from just a particular search box on your site, add the following to your calling code after
the "<form ... >" statement
<input type="hidden" name="within" value="1" />
And if you want to preload a context so that the user's search is
already searching within a query initialized by you, add this tag as
<input type="hidden" name="lastq" value="TYPE PREVIOUS SEARCH HERE" />
- Initializing the Results Page section (paying accounts only)
- You can set the following call-time input arguments to turn off
entire sections of the search results when starting from a particular search box. See
examples of other input arguments above for how these options are set as form
or link args.
- boxshow=0 turns off the search box. Same effect as setting Show Box off in Page Design topic of account manager, but per search.
- queryshow=0 turns off the search box and query display. Good for
preloading a topical search link for the user without showing them the
- searchshow=0 turns off the search box, query display, and status
bar. Same effect as <!-- PICO_TEMPLATE_LISTONLY--> in template,
but per search.