first of all thanks for your help and this beatifull forum! My case is folowing: I have to pull out single words from the for instance #form.search# which contains "word1 word2 word3 word4" I nead to show every single of this words as variable of it's own. I nead it for full text search for CONTAINS(contains, 'word1 and word2 and word3 and word4') Thanks for your help.
Hello nejcpass, If I understand you correctly, you want to search for each word in a search string. I have used this method before. WHERE 0=0 <cfloop index="x" list="#FORM.search#" delimiters=" "> <cfoutput>AND Content LIKE '%#x#%'</cfoutput> </cfloop> Hope this helps.
It work well but I would nead it for instance when you search with ALL of the words, with the EXACT PHRASE ,with AT LEAST ONE of the words Your code tells that CONTAINS(contains, 'word1') and CONTAINS(contains, 'word2') and CONTAINS(contains, 'word3') and ... that doesn't help me much... I nead it formated like this: CONTAINS(contains, 'word1 and word2 and word3 and word4')
>WHERE 0=0 ><cfloop index="x" list="#FORM.search#" delimiters=" "> ><cfoutput>AND Content LIKE '%#x#%'</cfoutput> ></cfloop> what if you tried to set a cf variable to the search string.. like WHERE 0=0 <cfloop index="x" list="#FORM.search#" delimiters=" "> <cfset contentstring = contentstring + '#x# and '> </cfloop> <cfset contentstring = rereplace(contentstring, '/and $/', '')> <cfoutput>CONTAINS(contains, '#contentstring#')</cfoutput> just me taking a guess at it.. i'm not the best with coldfusion syntax so i meant this just to give you an idea of something that might be able to be done