yaz_ccl_parse
yaz_ccl_parse
Invoke CCL Parser
bool **yaz_ccl_parse** resource $id string $query array $result
This function invokes a CCL parser. It converts a given CCL FIND query to
an RPN query which may be passed to the
function to perform a search.
yaz_search
To define a set of valid CCL fields call
prior to this function.
yaz_ccl_conf
id
The connection resource returned by .
yaz_connect
queryThe CCL FIND query.
result
If the function was executed successfully, this will be an array
containing the valid RPN query under the key .
rpn
Upon failure, three indexes are set in this array to indicate the cause
of failure:
- - the CCL error code (integer) `errorcode`
-
- the CCL error string
errorstring
- the CCL error string
-
- approximate position in query of failure (integer is character position)
errorpos
- approximate position in query of failure (integer is character position)
return.success
Voorbeeld: CCL Parsing
We will try to search using CCL. In the example below,
is a CCL query.
$ccl
<?php
yaz_ccl_conf($id, $fields); // see example for yaz_ccl_conf
if (!yaz_ccl_parse($id, $ccl, $cclresult)) {
echo 'Error: ' . $cclresult["errorstring"];
} else {
$rpn = $cclresult["rpn"];
yaz_search($id, "rpn", $rpn);
}
?>