| |
yaz_ccl_parse (PHP 4 >= 4.0.5, PECL) yaz_ccl_parse -- Invoke CCL Parser Descriptionbool 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 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 resource returned by yaz_connect().
- query
The 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:
errorcode - the CCL error code (integer)
errorstring - the CCL error string
errorpos - approximate position in query of failure
(integer is character position)
Return Values
Returns TRUE on success or FALSE on failure.
ExamplesExample 1. CCL Parsing
We will try to search using CCL. In the example below,
$ccl is a CCL query.
<?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); } ?>
|
|
Copyright © 1997 - 2007 by the PHP Documentation Group. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later. A copy of the Open Publication License is distributed with this manual, the latest version is presently available at http://www.opencontent.org/openpub/.
Please see full copyright text at http://www.php.net/manual/en/copyright.php
Original version of the above documentation is available at http://www.php.net/manual/en/
|
- Please click on Generation of Anti Spam Capcha Code using php mysql
- Please Also click on our Web developers Showcase
|