Greetings Mr Isaak,
I do not think mysql's match() has a facility for the fuzzy searches you need. you might have to generate the permutations of the search terms youself and then pas them on to match() .. against().
Fuzzy searches are a bit of a hack, at least for me. Supposing you were searching for the phrase "Management Trainees" you would need to first search for an exact match of "Management Trainees" then probably search for the singular form "Management Trainee" {just stripping the 's' and doing the search again}, break the word into two separate terms "Management" and "Trainee" then search for all possible combinations of the phrase.. ad infinitum.
--
Ndungi Kyalo
biblia.kenya.or.ke
i tweet! @ndungikyalo
okay just wrote a query for the search but its works only for exact matchesHow do i make it work with fuzzy searches.Code:SELECT *, MATCH( position ) AGAINST('%$q%') OR MATCH( dept_name )AGAINST('%$q%')AS score FROM vacancy LEFT JOIN departments ON vacancy.dept_no = departments.dept_idWHERE MATCH( position )AGAINST('%$q%')OR MATCH( dept_name )AGAINST('%$q%')Pablo Picasso - "Computers are useless. They can only give you answers."On Fri, Dec 11, 2009 at 10:02 AM, Ndungi Kyalo <ndungi@gmail.com> wrote:
There is one I have found extremely helpful from Particle Tree [http://particletree.com/notebook/ranked-searches-with-sql/]. You can try it out. You might, however, have to forego the convenience of CodeIgniter's (?) query builder methods and write the queries yourself.
The other great thing about Particle Tree's search method/strategy/query is that it doesnt rely on fulltext indexes, so you can use it on Innodb tables as well.
Good luck!
--
Ndungi Kyalo
"if you want to go fast go alone, if you want to go far get company"
biblia.kenya.or.ke
On Fri, Dec 11, 2009 at 5:53 AM, Isaak Mogetutu <imogetutu@googlemail.com> wrote:$array = array('vacancy_position' => $this->input->post('q'),'department_name' => $this->input->post('q'),'vacancy_status' => $this->input->post('q'));$this->db->select('*');$this->db->from('vacancy');$this->db->join('departments', 'vacancy.dept_no = departments.dept_id');$this->db->like($array);i want to search vacancy and departments table where vacancy.department.id = departments.department.idfrom colums vacancy(position,status) and departments(deparment_name)where search query('q') matches any of the three columns.Samuel Goldwyn - "I'm willing to admit that I may not always be right, but I am never wrong."
On Fri, Dec 11, 2009 at 8:42 AM, solomon kariri <solomonkariri@gmail.com> wrote:Wah you just like posed a universal set statement dude. There is nothing that seems to be the problem here neither does it sound like you want any help. You did not even specify what u have done so far.
http://www.sqlcourse.com/
That will helpOn Fri, Dec 11, 2009 at 8:33 AM, Isaak Mogetutu <imogetutu@googlemail.com> wrote:
_______________________________________________Hi Skunks,I am trying to search multiple tables and columns just can't seem to get the query right.regardsMogetutu
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
--
Solomon Kariri,
Software Developer,
Cell: +254736 729 450
Skype: solomonkariri
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
--
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
--
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general