, StopSel = ')
AS highlight,
*
FROM fts_texts
WHERE
full_text_search_weighted
@@ websearch_to_tsquery('pali', '$q') OR
full_text_search_weighted_unaccent
@@ websearch_to_tsquery('pali_unaccent', '$q')
ORDER BY rank DESC
LIMIT 20;";
$result = pg_query($query) or die('Query failed: ' . pg_last_error());
// Printing results in HTML
echo "\n";
echo "
| rank |
highlight |
paragraph |
book |
wid |
bold_single |
bold_double |
bold_multiple |
content |
TSVECTOR |
TSVECTOR (unaccent) |
";
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
echo "\t\n";
foreach ($line as $col_value) {
echo "\t\t$col_value | \n";
}
echo "\t
\n";
}
echo "
\n";
// Free resultset
pg_free_result($result);
// Closing connection
pg_close($dbconn);
}
?>