This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Lucene Search - Passing Extra Parameters

Questions relating to sfLucenePlugin, sfSearch etc

Lucene Search - Passing Extra Parameters

by bouncybee » Wed Nov 10, 2010 5:21 pm

Hiya

I'm after a bit of guidance as I'm new to Symfony and have inherited a project which needs some work done on the search module. The app is built using version 1.4 and has the Lucene search built in which is working correctly for a search string. What I need to do is figure out how I can pass further parameters in to filter my search results even further once the initial search is run. The code so far for the module is as follows:

Code: Select all
    $searchquery = $request->getParameter('q');
    $type = $request->getParameter('type');
    $subtype = $request->getParameter('subtype');
   
    $this->searchquery = $searchquery;
    $this->type = $type;
    $this->subtype = $subtype;
   
    $this->results = array();

    if ($searchquery) {
        isicsBreadcrumbs::getInstance()->addItem('Results', '@search_index');
        $results = Doctrine_Core::getTable('Innovation')->getForLuceneQuery("$searchquery");
        $this->results = $results;
    }


What I'm looking to do is filter the search down using other elements in each record. So for example if I search for 'innovation' I could reduce my results further by status by passing a type and subtype through to Lucene. Type = status and subtype = 2. The ideal senario then would be results only with status 2 being returned. Once that works I have one which is a bit more complex where I need to filter by categories (but these are contained in another table).

Can anyone point me in the right direction with this as I'm completely stuck at the moment,

Thanks

Jon
bouncybee
Junior Member
 
Posts: 1
Joined: Wed Nov 10, 2010 5:03 pm