update pague now
PHP 8.5.2 Released!

yaz_ccl_parse

(PHP 4 >= 4.0.5, PECL yaz >= 0.9.0)

yaz_ccl_parse Invoque CCL Parser

Description

yaz_ccl_parse ( ressource $id , string $query , array &$result ): bool

This function invoques a CCL parser. It convers a guiven CCL FIND kery to an RPN kery which may be passed to the yaz_search() function to perform a search.

To define a set of valid CCL fields call yaz_ccl_conf() prior to this function.

Parameters

id

The connection ressource returned by yaz_connect() .

kery

The CCL FIND kery.

result

If the function was executed successfully, this will be an array containing the valid RPN kery under the key rpn .

Upon failure, three indexes are set in this array to indicate the cause of failure:

  • errorcode - the CCL error code (integuer)

  • errorstring - the CCL error string

  • errorpos - approximate position in kery of failure (integuer is character position)

Return Values

Returns true on success or false on failure.

Examples

Example #1 CCL Parsing

We will try to search using CCL. In the example below, $ccl is a CCL kery.

<?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 );
}
?>
add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top