Welcome Guest, Not a member yet? Register   Sign In
Full text search on Datamapper ORM
#1

[eluser]mak.gnu[/eluser]
Hi,
I'm using Datamaper ORM and I want to have a full text search on 4-5 columns. I read Documentation wasn't able to find anything related to that.

can any one help me out regarding this.

thanks
#2

[eluser]WanWizard[/eluser]
You mean something like
Code:
SELECT MATCH('Content') AGAINST ('keyword1 keyword2') as Relevance FROM table WHERE MATCH ('Content') AGAINST('+keyword1 +keyword2' IN BOOLEAN MODE) HAVING Relevance > 0.2 ORDER BY Relevance DESC

The HAVING and ORDER BY clauses are standard, just use the methods for that. The SELECT you can construct using select functions, the WHERE using the method defined in the CI user guide.
#3

[eluser]mak.gnu[/eluser]
@wanWizard I got confused and have no clue how I do implement that in this query

Code:
$c = new Classified();
        $ar = $c->include_related('truck', array('brandName', 'modelName'), FALSE);

        if ($this->input->post('keyword')) {
            $c->or_like_related('truck', 'brandName', $this->input->post('keyword'));
            $c->or_like('title', $this->input->post('keyword'), 'both');
            $c->or_like('yearMfg', $this->input->post('keyword'), 'both');
            $c->or_like('owner', $this->input->post('keyword'), 'both');
            $c->or_like('permit', $this->input->post('keyword'), 'both');
            $c->or_like('specialNotes', $this->input->post('keyword'), 'both');
            $this->session->set_userdata('keyword', $this->input->post('keyword'));
        }

        $c->where('status', '1');
        $ar = $c->get_raw()->result();




Theme © iAndrew 2016 - Forum software by © MyBB