String search in Title/Tags/Body with a minimum score of 7 and without code in body

1

Please login or register to vote for this query.

(click on this box to dismiss)

Search for a string that occurs either in title, tags or body Posts need a minimum score of 7 and should be without code in body

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

-- Top Score Open Questions Title Or Tags Matching Keywords
-- Search for all open questions with both keywords in either the title or tags sorted by top score

DECLARE @QTagOne VARCHAR(255) = ##KeywordOne:string##;
SET     @QTagOne              = '%' + LTRIM(RTRIM(@QTagOne)) + '%';
DECLARE @QTagTwo VARCHAR(255) = ##KeywordTwo:string##;
SET     @QTagTwo              = '%' + LTRIM(RTRIM(@QTagTwo)) + '%';

SELECT     Id AS [Post Link], Score, Tags, ID
FROM       Posts
WHERE      PostTypeId = 1
AND        ((Tags LIKE @QTagOne AND Tags LIKE @QTagTwo) 
OR         (Title LIKE @QTagOne AND Title LIKE @QTagTwo))
AND        Body not like '%<blockquote%'
ORDER BY   Score DESC

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results