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
Q&A about the site for musicians, students, and enthusiasts
-- Search for String in Title, Tags and Body with minimum score 4 and no code in body -- -- without code examples -- DECLARE @Text1 VARCHAR(100) = '%'+##String:string##+'%'; -- SET @Text1 = LTRIM(RTRIM(@Text1)); -- Search Tags and Keywords in Header SELECT Id AS [Post Link], Score, Tags, ViewCount, AnswerCount, CommentCount, FavoriteCount, OwnerUserId, Title FROM Posts WHERE (PostTypeId = 1) AND (Body NOT LIKE '%<pre%><code>%') AND (Posts.Score >= 4) AND ((lower(Posts.Tags) LIKE lower(@Text1)) OR (lower(Posts.Title) LIKE lower(@Text1)) OR (lower(Posts.Body) LIKE lower(@Text1))) ORDER BY Score DESC