/* getAll 1 (busqueda) - getAll - http://www.casinuevo.net/dxk-12z3-s.html */ SELECT l.nombre localidad_nombre,l.url_nombre localidad_nombre_url, a.*,u.tienda,u.facebook_uid,u.tlf_verificado,u.telefono , (+IF(LOWER(a.keywords_busqueda) like LOWER('%dxk%') OR LOWER('dxk%') OR LOWER('%dxk'),1,0) +IF(LOWER(a.nombre) like LOWER('%dxk%') OR LOWER('dxk%') OR LOWER('%dxk'),1,0) +IF(LOWER(a.nombre) like LOWER('%dxk%') OR LOWER('dxk%') OR LOWER('%dxk'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%dxk 12z3%') OR LOWER('dxk 12z3%') OR LOWER('%dxk 12z3'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%12z3es%') OR LOWER('12z3es%') OR LOWER('%12z3es'),1,0) +IF(LOWER(a.nombre) like LOWER('%12z3es%') OR LOWER('12z3es%') OR LOWER('%12z3es'),1,0) +IF(LOWER(a.nombre) like LOWER('%12z3%') OR LOWER('12z3%') OR LOWER('%12z3'),1,0) +IF(LOWER(a.nombre) like LOWER('%dxk 12z3%') OR LOWER('dxk 12z3%') OR LOWER('%dxk 12z3'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%dxk 12z3 s%') OR LOWER('dxk 12z3 s%') OR LOWER('%dxk 12z3 s'),1,0) +IF(LOWER(a.nombre) like LOWER('%s%') OR LOWER('s%') OR LOWER('%s'),1,0) +IF(LOWER(a.nombre) like LOWER('%dxk 12z3 s%') OR LOWER('dxk 12z3 s%') OR LOWER('%dxk 12z3 s'),1,0) +IF(patrocinado1 IS NOT NULL OR patrocinado2 IS NOT NULL,5,0) -IF(LENGTH(a.descript)>2200,2,0) ) as rank FROM anuncios a LEFT JOIN localidades l ON a.id_localidad = l.id INNER JOIN usuarios u ON u.id = a.id_usuario WHERE 1 AND id_subcategoria != 0 AND website = 'C' AND a.id_categoria !=321 AND id_subcategoria != '330' AND id_subcategoria != '260' AND (MATCH (a.keywords_busqueda) AGAINST ('+dxk +12z3 +s' IN BOOLEAN MODE)) order by rank desc, modificado desc LIMIT 0 , 30