예제 #1
0
function ftsearch_set_entries($object_type, $object_id, $cache_id, &$text, $last_modified)
{
    ftsearch_delete_entries($object_type, $object_id, $cache_id);
    $ahash = ftsearch_hash($text);
    foreach ($ahash as $k => $h) {
        sql("INSERT INTO `search_index` (`object_type`, `cache_id`, `hash`, `count`) VALUES ('&1', '&2', '&3', '&4') ON DUPLICATE KEY UPDATE `count`=`count`+1", $object_type, $cache_id, $h, 1);
    }
    sql("INSERT INTO `search_index_times` (`object_id`, `object_type`, `last_refresh`) VALUES ('&1', '&2', '&3') ON DUPLICATE KEY UPDATE `last_refresh`='&3'", $object_id, $object_type, $last_modified);
}
예제 #2
0
function ftsearch_set_entries($object_type, $object_id, $cache_id, &$text, $last_modified)
{
    ftsearch_delete_entries($object_type, $object_id, $cache_id);
    $ahash = ftsearch_hash($text);
    foreach ($ahash as $k => $h) {
        XDb::xSql("INSERT DELAYED INTO `search_index` (`object_type`, `cache_id`, `hash`, `count`)\n            VALUES ( ?, ?, ?, ?)\n            ON DUPLICATE KEY UPDATE `count`=`count`+1", $object_type, $cache_id, $h, 1);
    }
    XDb::xSql("INSERT INTO `search_index_times` (`object_id`, `object_type`, `last_refresh`)\n        VALUES (?,?,?) ON DUPLICATE KEY UPDATE `last_refresh`= ? ", $object_id, $object_type, $last_modified, $last_modified);
}