Search and Replace Columns using Full Text Search Mysql -


is there way of running mysql query using full text search search column example (hayes) , replace rest of string "hayes" once matched?:

column1: london, hayes, md15 736

where match (column1) against ('hayes' in boolean mode) 

column1: hayes

so since column 1 has matched "hayes" removed rest of string. needs done full text example takes long on large data sets.

and there no set order keyword maybe cannot use find_in_set

also running large number of keywords below:

where match (column1) against ('hayes' in boolean mode) or match (column1) against ('+west +bromwich' in boolean mode) or match (column1) against ('london' in boolean mode) 

so if run above query on column1 contains following string:

london, m456, hayes <<< match hayes , not both london , hayes.

you can try find rows contain @ least 1 of 2 words.

     against ('+hayes +london' in boolean mode)  

if want find row contain both words use this

    against ('+hayes london' in boolean mode)  

edit:

update table set column1 =         'hayes'    column1      '%hayes%'; 

if have more keywords use that

   update table    set column1 =if(     column1 '%hayes%', 'hayas', if(      column1 '%derby%' ,'derby' , if(     column1 '%wawwaw%' ,'wawawa', column1))) 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -