CodeIgniter Forums
Does CI3 Has any search library for MySQL DB? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Does CI3 Has any search library for MySQL DB? (/showthread.php?tid=1502)



Does CI3 Has any search library for MySQL DB? - rakibtg - 03-15-2015

Does CI3 Has any search library for MySQL DB? Like full text search on which table .. etc


RE: Does CI3 Has any search library for MySQL DB? - sajid19991 - 03-16-2015

well, if there is or not....i  have decided to make it 3 days ago since i faced a lot of time wastage on search functions...so expect a library coming soon... but for now...

you can use in-built where clause for basic functions like..

Code:
$this->db->where('MATCH (content.title) AGAINST ("'. $term .'")')
$this->db->where('MATCH (content.body) AGAINST ("'. $term .'")')

or something like this

Code:
function search_results_count($terms)
   {
       // Run Query to count the total number of search results
       $sql = "SELECT COUNT(*) AS count
                   FROM content
                   WHERE MATCH (body) AGAINST (?)";
       $query = $this->db->query($sql, array($terms));
       return $query->row()->count;
   }

well i hope im right with those codes, been 3 years out of codeigniter...


RE: Does CI3 Has any search library for MySQL DB? - ivantcholakov - 03-16-2015

Would this work with InnoDB?


RE: Does CI3 Has any search library for MySQL DB? - Avenirer - 03-16-2015

Trick question, @ivantcholakov... Smile)


RE: Does CI3 Has any search library for MySQL DB? - Avenirer - 03-16-2015

@rakibtg Why would you need a search library for interrogating the database? Go figure, for every language on this world there is another way of doing a search library... This is more like a linguistics problem, not a programming one Smile


RE: Does CI3 Has any search library for MySQL DB? - rakibtg - 03-17-2015

Thanks @sajid19991 i am also doing the same Smile
@Avenirer You'r right 8-)


RE: Does CI3 Has any search library for MySQL DB? - sajid19991 - 03-18-2015

(03-17-2015, 10:42 PM)rakibtg Wrote: Thanks @sajid19991 i am also doing the same Smile

great....i haven't started yet so maybe if you would like i can contribute ...
created any repo yet?


RE: Does CI3 Has any search library for MySQL DB? - rakibtg - 03-19-2015

Any one please take a look here> http://forum.codeigniter.com/thread-1522.html


RE: Does CI3 Has any search library for MySQL DB? - Avenirer - 03-19-2015

@rakibtg I don't get it. What does that thread have to do with this one (except having the same author...)?