Another answer is to use a CTE to strip out the HTML before doing a search.
The following CTE extracts likely rows that satisfy the search criteria and recursively strips out the HTML. The Query then uses the results of the CTE to filter out rows still containing HTML and ones that don’t exactly match the search criteria.
The CTE isn’t as complicated as it looks. Most of the fiddling is to cope with PATINDEX returning 0.
--** Test table
DECLARE @HTML TABLE (id INT IDENTITY, html VARCHAR(max))
INSERT INTO @HTML SELECT 'This is a <span style="font-weight: bold; ">nice</span> question';
INSERT INTO @HTML SELECT 'The cat sat <span style="font-weight: bold; ">on the</span> mat';
--** Search criteria
DECLARE @Search VARCHAR(50) = 'is a nice';
--** CTE to return the matching rows ignoring the HTML
;WITH Search_CTE (html_id, html_text)
AS (
SELECT h.id AS 'html_id'
, LEFT(h.html,REPLACE(PATINDEX('%<%',h.html)-1,-1,999999)) + SUBSTRING(h.html,CONVERT(INT,REPLACE(PATINDEX('%>%',h.html)+1,1,999999)),LEN(h.html)) AS 'html_text'
FROM @HTML AS h
WHERE h.html LIKE '%' + REPLACE(@Search,' ','%') + '%'
UNION ALL
SELECT c.html_id AS 'html_id'
, LEFT(c.html_text,REPLACE(PATINDEX('%<%',c.html_text)-1,-1,999999)) + SUBSTRING(c.html_text,CONVERT(INT,REPLACE(PATINDEX('%>%',c.html_text)+1,1,999999)),LEN(c.html_text)) AS 'html_text'
FROM Search_CTE AS c
WHERE PATINDEX('%<%',c.html_text) > 0
)
SELECT h.html AS 'Original HTML'
, cte.html_text AS 'HTML Text'
FROM Search_CTE AS cte
JOIN @HTML AS h
ON h.id = cte.html_id
WHERE PATINDEX('%<%',cte.html_text) = 0 --** Filter out rows still containing HTML
AND html_text LIKE '%' + @Search + '%'; --** Filter out rows not matching the search criteria
This query has the limitation that it doesn't handle the situation where > or < is in the text, but this can be coded around if required.