/* getAll 1 (busqueda) - getAll - http://www.casinuevo.net/estufas-electricas.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('%estufas%') OR LOWER('estufas%') OR LOWER('%estufas'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%estufa%') OR LOWER('estufa%') OR LOWER('%estufa'),1,0) +IF(LOWER(a.nombre) like LOWER('%estufa%') OR LOWER('estufa%') OR LOWER('%estufa'),1,0) +IF(LOWER(a.nombre) like LOWER('%estufas%') OR LOWER('estufas%') OR LOWER('%estufas'),1,0) +IF(LOWER(a.nombre) like LOWER('%estufas%') OR LOWER('estufas%') OR LOWER('%estufas'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%estufas electricas%') OR LOWER('estufas electricas%') OR LOWER('%estufas electricas'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%electrica%') OR LOWER('electrica%') OR LOWER('%electrica'),1,0) +IF(LOWER(a.nombre) like LOWER('%electrica%') OR LOWER('electrica%') OR LOWER('%electrica'),1,0) +IF(LOWER(a.nombre) like LOWER('%electricas%') OR LOWER('electricas%') OR LOWER('%electricas'),1,0) +IF(LOWER(a.nombre) like LOWER('%estufas electricas%') OR LOWER('estufas electricas%') OR LOWER('%estufas electricas'),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 ('+estufas +electricas' IN BOOLEAN MODE)) order by rank desc, modificado desc LIMIT 0 , 30