Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.
/ pdf-search Public archive

PDF read & search ( FULLTEXT + MATCH + AGAINST ) / Create Update SQL ( INSERT ON DUPLICATE KEY UPDATE )

Notifications You must be signed in to change notification settings

fadilxcoder/pdf-search

Repository files navigation

SQL MATCH AGAINST & search in pdf

search_modifier

  • IN NATURAL LANGUAGE MODE - This will return a list of rows where the specified column(s) contains at least one word of the search text, by default it will be ordered by relevance (the more words of the search text a column contains, the higher up it will be).

  • IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION - This type essentially performs 2 searches on the database, first it searches columns for the desired keywords. Then it uses the most commonly occurring words from the found columns to perform a second search, the results are then concatenated into 1 result set. This provides a more thorough search and can be quite useful.

  • IN BOOLEAN MODE - TBoolean mode allows you to use operators such as + and - to specify whether a particular word or phrase must or must not be present.

The default mode is IN NATURAL LANGUAGE MODE.

ON DUPLICATE KEY UPDATE

  • Files
    • api-replace-data.php
    • api-replace-data.sql
    • functions.php
    function createUpdate($tbl, $data)
    {
        global $connection;

        foreach( array_keys($data) as $key ) 
        {
            $fields[] = "`$key`";
            $values[] = "'" .$data[$key] . "'";
        }
        
        $fields = implode(",", $fields);
        $values = implode(",", $values);
        $sql = "INSERT INTO `$tbl`($fields) VALUES ($values) ON DUPLICATE KEY UPDATE ";

        unset($data['id']);
        $sql_append = '';

        foreach($data as $key => $value)
        {
            $sql_append .= $key."='". $value."', ";
        }

        $sql_append = rtrim($sql_append, ", ");
        $sql = $sql . $sql_append;
        echo '<pre>' . $sql . '</pre>';
        $connection->query($sql);
        return true;
    }

About

PDF read & search ( FULLTEXT + MATCH + AGAINST ) / Create Update SQL ( INSERT ON DUPLICATE KEY UPDATE )

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages