See qa-include/qa-search-basic.php function index_post() and function process_search().
Each word gets an ID.
Plus file qa-db-selects.php the function qa_db_search_posts_selectspec().
/* The search is performed for any of $titlewords in the title, $contentwords in the content (of the question or an answer or comment for whom that is the antecedent question), $tagwords in tags, for question author usernames which match a word in $handlewords or which match $handle as a whole. The results also include a 'score' column based on the matching strength and post hotness, and a 'matchparts' column that tells us where the score came from (since a question could get weight from a match in the question itself, and/or weight from a match in its answers, comments, or comments on answers). The 'matchparts' is a comma-separated list of tuples matchtype:matchpostid:matchscore to be used with qa_search_set_max_match(). */
Check also the db table qa_words for details.