okay just wrote a query for the search but its works only for exact matches

How 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_id 
WHERE MATCH( position ) 
AGAINST('%$q%')
OR MATCH( dept_name ) 
AGAINST('%$q%')

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.id

from colums vacancy(position,status) and departments(deparment_name)

where search query('q') matches any of the three columns.


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 help

On 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.

regards

Mogetutu

o_O?
--

Marie von Ebner-Eschenbach  - "Even a stopped clock is right twice a day."

_______________________________________________
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



--

Samuel Goldwyn  - "I'm willing to admit that I may not always be right, but I am never wrong."
_______________________________________________
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



--

Pablo Picasso  - "Computers are useless. They can only give you answers."