Skip to content
Snippets Groups Projects
  • JediKev's avatar
    issue: Search Reindexing Thread Entries · bbf1010c
    JediKev authored
    This addresses an issue where `IndexOldStuff()` doesn't reindex everything
    it's supposed to. The reindex leaves out all of the Thread Entries with
    empty titles or bodies. This is due to the SQL statement that retrieves
    thread entries. In the SQL statement, we check if the sum of the Thread
    Entry Title length and the Thread Entry Body length is greater than 0. If so
    we reindex the entry, otherwise we exclude it. The problem is both
    ```LENGTH(A1.`title`)``` and ```LENGTH(A1.`body`)``` can return `NULL` and
    you cannot add `NULL` (a string) to an integer. This updates the SQL to add
    `IFNULL()` statements around the possible `NULL` values so that if `NULL` we
    typecast to integer of 0 which can be added to integers successfully.
    bbf1010c