ccl2rpn()
Submitted by lanttis on 6 July, 2004 - 08:07.
Description
string ccl2rpn (string query, array config)
This function will generate a RPN query of Your passed CCL query based on the config that You supply. The config can automatically be generated using the function generate_ccl_conf([string url]) or then alternatively be passed manually. To avoid errors and corrupt queries, we recommend using the generate_ccl_conf()-function.
The result of this function can directly be passed as the query argument to the perform() function. See examples below.
Examples
Example of generating an RPN-query of a passed CCL query.
... Initialize ...
$rpn = $search->ccl2rpn("title=mumin and author=jansson", generate_ccl_conf());
... End and clean ...
Will result in the following RPN query (example definitions, may vary from system to system).
@and @attr 5=3 @attr 1=1004 "mumin" @attr 5=3 @attr 1=4 "jansson"
Additionally and example of using the function to feed the perform() function.
... Initialize ...
$search->perform($search->ccl2rpn("title=mumin", generate_ccl_conf()), "1=4 ai")
if(!$search->errno()) {
... process ...
}
... End anc clean ...

