# Need php script to highlight boolean search results



## HowdeeDoodee (Aug 26, 2004)

Is there a script around somewhere I can add to my php pagination file that will highlight the search terms found on each page retrieved from a boolean search?

*OR*

Is there a way to extract the words or phrases searched for by the MySql boolean embedded search engine

Question: 
A boolean search form calls a php script paginating the search results. I want to know if there is a way to extract the words or phrases searched for by the MySql boolean embedded search engine after the Select statement executes. I want to do this so I can highlight the found words or terms by the boolean search feature of MySql before the records are displayed back to the user. The MySql boolean embedded search engine leaves out common words from the stop word list, and (as I understand it) does some other things like search for meanings and different combinations. So is there any way of extracting out the words actually searched for by MySql boolean search? Is there a built-in function that will give back the searched for words?

As an example, "in God we trust" would be reduced down to "God" and "trust" in one pass by the search engine.

In he following query statement, $all $none $any are boolean search terms or string variables passed to the Select statement from the search form prior to the query2 statement.

Here is the query statement.

$query2 = " 
SELECT *, 
MATCH(Topic, Subtopic) AGAINST ('$all $none $any' IN BOOLEAN MODE)
FROM View2_ConcordFT
WHERE MATCH(Topic, Subtopic) AGAINST ('$all $none $any' IN BOOLEAN MODE) LIMIT $startrecord, $display";

Thank you in advance for your replies.


----------

