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

Amateur Radio

Q&A for amateur radio enthusiasts

-- 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 sites:
loading Hold tight while we fetch your results