This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » Search plugins » Search filter
Search filter [message #79879] Mon, 15 June 2009 15:38 Go to next message
wigglesby85  is currently offline wigglesby85
Messages: 144
Registered: May 2009
Senior Member
Hi

I have a page called listResultsSuccess.php which displays a list of data that is pulled from a db.

Some of them have a field called 'type' and what I'm looking to do, is to keep the existing default list of all of the data but then create a search filter.

So from a select list, have the types in a list and if 'type1' is picked, the page will then display all of the items in the db that has a type of type1.

Is this possible?

Thanks

[Updated on: Mon, 15 June 2009 16:10]

Re: Search filter [message #79884 is a reply to message #79879 ] Mon, 15 June 2009 16:53 Go to previous messageGo to next message
wigglesby85  is currently offline wigglesby85
Messages: 144
Registered: May 2009
Senior Member
Anyone?

Even if it's a link to an example would be good Smile
Re: Search filter [message #80223 is a reply to message #79879 ] Fri, 19 June 2009 12:25 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Sure, that should be quite easy. You could always have your 'type' filter on-screen (as an ordinary drop-down list) and set the first option to "No filter" or "All rows". The other options would be the types you wish to filter on.

Then all you need do is link this into your database. Assuming you're using Propel, this would be a case of modifying your Criteria object before generating your list (or sfPropelPager object).


Remember Palestine
Re: Search filter [message #88796 is a reply to message #80223 ] Sat, 21 November 2009 17:08 Go to previous messageGo to next message
srozie  is currently offline srozie
Messages: 25
Registered: July 2009
Junior Member
Hello,

I am implementing search according to the steps described in Jobeet - search 17th chapter.

Now for example if I write a word in the textbox, then it looks for this word, and retrieves all the data that contains this word, but what I want is to retrieve only the exact word.

for example:
I have two fields in the table: 1) word 2) description

now if I write 'computer' in the textbox, it should look for the exact word 'computer' in the word field and retrieve its description.

Can you please help me with this??

I also modified this method:

static public function getForLuceneQuery($query)
{
$hits = self::getLuceneIndex()->find($query);

$pks = array();
foreach ($hits as $hit)
{
$pks[] = $hit->pk;
}

$criteria = new Criteria();
$criteria->add(self::ID, $pks, Criteria::IN);
$criteria->setLimit(20);

return self::doSelect($criteria);
}

and deleted the Criteria::IN so that it would take its default criteria EQUAL, but then it brings no result at all.

thanks.
Re: Search filter [message #88846 is a reply to message #88796 ] Sun, 22 November 2009 18:56 Go to previous message
srozie  is currently offline srozie
Messages: 25
Registered: July 2009
Junior Member
anybody has a solution???? please let me know! Sad
Previous Topic:problem about lucene
Next Topic:Searchable + Blog index
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software