ReplaceVar

Name

ReplaceVar -- creates or modifies a variable

indexer.conf

search.htm

Synopsis

ReplaceVar {name} {value}

Creates a variable with the given name and value, for further use in the other indexer.conf or search.htm commands.

If the variable has previously been created with another ReplaceVar or ImportEnv command, then its old value is replaced.

The value parameter can reference to other variables previously created by ReplaceVar or ImportEnv commands using $(name) syntax.

Variables created using ReplaceVar are considered to have the character set with the one specified in LocalCharset. When being displayed in search template, variable values are converted to BrowserCharset.

ReplaceVar can also be used to set search query parameters in search.htm, without having to pass them in CGI query string. This example sets sorting order to title, like if the s=s&su=title parameters would have been passed in CGI query string:


ReplaceVar s s
ReplaceVar su title
    

Note: ReplaceVar has higher precedence over CGI query string parameters. In the above example search.cgi will sort search results strictly in title ascending order, no matter what the user passes in the s and su query string parameters.

Examples


ReplaceVar etcdir "/usr/local/mnogosearch/etc/"
Include $(etcdir)/include1.conf
Include $(etcdir)/include2.conf
      

See also

ImportEnv, Include.