
-- define search and set keywords
SET @search_keyword = 'we vibe';
SET @add_keyword = 'wevibe';

-- do the real update - with WHERE clause below!!!
UPDATE ArticleEntry_Language AS ael
SET ael.ArticleEntry_Language_Keyword = CONCAT(TRIM(IFNULL(ael.ArticleEntry_Language_Keyword, '')), IF(TRIM(IFNULL(ael.ArticleEntry_Language_Keyword, '')) != '', ', ', ''), @add_keyword)

-- just search
-- SELECT * FROM ArticleEntry_Language AS ael
WHERE
	ael.Language_Code = 'de'
	AND ael.ArticleEntry_ID IN (
		SELECT sa.ArticleEntry_ID FROM ShopArticle AS sa
	)
	AND (
		ael.ArticleEntry_Language_Title LIKE CONCAT('%', REPLACE(@search_keyword, ' ', '%'), '%')
		OR	ael.ArticleEntry_Language_Text LIKE CONCAT('%', REPLACE(@search_keyword, ' ', '%'), '%')
	)
	
