Updating the totals

The last thing that happens in indexing is the updating of the search_total table. As explained previously, a word is considered more valuable (lower count score) the rarer it is in the index. The following code first selects the sum total of every word that has been added to search_dirty during indexing. It then calculates the inverse document frequency of the word (IDF) and updates the search_total table. Sometimes words have been deleted during indexing (via search_wipe), and housecleaning dictates these be removed from search_total as well.

0 0

Post a comment