/* getAll 1 (busqueda) - getAll - http://www.casinuevo.net/iphone-5s-64gb-oro.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('%iphone%') OR LOWER('iphone%') OR LOWER('%iphone'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%iphones%') OR LOWER('iphones%') OR LOWER('%iphones'),1,0) +IF(LOWER(a.nombre) like LOWER('%iphones%') OR LOWER('iphones%') OR LOWER('%iphones'),1,0) +IF(LOWER(a.nombre) like LOWER('%iphone%') OR LOWER('iphone%') OR LOWER('%iphone'),1,0) +IF(LOWER(a.nombre) like LOWER('%iphone%') OR LOWER('iphone%') OR LOWER('%iphone'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%iphone 5s%') OR LOWER('iphone 5s%') OR LOWER('%iphone 5s'),1,0) +IF(LOWER(a.nombre) like LOWER('%5s%') OR LOWER('5s%') OR LOWER('%5s'),1,0) +IF(LOWER(a.nombre) like LOWER('%iphone 5s%') OR LOWER('iphone 5s%') OR LOWER('%iphone 5s'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%iphone 5s 64gb%') OR LOWER('iphone 5s 64gb%') OR LOWER('%iphone 5s 64gb'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%64gbes%') OR LOWER('64gbes%') OR LOWER('%64gbes'),1,0) +IF(LOWER(a.nombre) like LOWER('%64gbes%') OR LOWER('64gbes%') OR LOWER('%64gbes'),1,0) +IF(LOWER(a.nombre) like LOWER('%64gb%') OR LOWER('64gb%') OR LOWER('%64gb'),1,0) +IF(LOWER(a.nombre) like LOWER('%iphone 5s 64gb%') OR LOWER('iphone 5s 64gb%') OR LOWER('%iphone 5s 64gb'),1,0) +IF(LOWER(a.keywords_busqueda) like LOWER('%iphone 5s 64gb oro%') OR LOWER('iphone 5s 64gb oro%') OR LOWER('%iphone 5s 64gb oro'),1,0) +IF(LOWER(a.nombre) like LOWER('%oro%') OR LOWER('oro%') OR LOWER('%oro'),1,0) +IF(LOWER(a.nombre) like LOWER('%iphone 5s 64gb oro%') OR LOWER('iphone 5s 64gb oro%') OR LOWER('%iphone 5s 64gb oro'),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 ('+iphone +5s +64gb +oro' IN BOOLEAN MODE)) order by rank desc, modificado desc LIMIT 0 , 30