diff --git a/reference/swish/reference.xml b/reference/swish/reference.xml index d40db2ae28..e4a9ca403b 100644 --- a/reference/swish/reference.xml +++ b/reference/swish/reference.xml @@ -1,5 +1,5 @@ - + @@ -38,6 +38,60 @@ &reftitle.runtime; &no.config; +
+ &reftitle.examples; + + + Basic search query + +query("test OR text"); + + echo "Found ", $results->hits, " results\n"; + while ($result = $results->nextResult()) { + var_dump($result); + break; //break after the first result + } + +} catch (SwishException $e) { + echo "Error: ", $e->getMessage(), "\n"; +} + +?> +]]> + + + + The above example will output something like this: + + + int(1) + ["swishrank"]=> + int(1000) + ["swishfilenum"]=> + int(10) + ["swishdbfile"]=> + string(13) "index.swish-e" + ["swishdocpath"]=> + string(23) "README.SUBMITTING_PATCH" + ["swishtitle"]=> + NULL + ["swishdocsize"]=> + int(4557) + ["swishlastmodified"]=> + int(1072136752) +} +]]> + +
&reference.swish.constants; &reference.swish.classes;