Search plugin

Feed 33 posts, 11 voices

Jul 9, 2008 11:19
Avatar
77 posts

Any plans for a search plugin in the near future?

 
Jul 10, 2008 08:18
Avatar
77 posts

I found a post from Yahoo on July 9, 2008 about their new BOSS (Build your Own Search System) - http://www.ysearchblog.com/archives/000599.html. Could this be used with Frog CMS?

 
Aug 4, 2008 04:34
Avatar
51 posts

I think, that the plug-in of search is necessary. Foreign search systems it absolutely another.

 
Aug 14, 2008 16:03
Avatar
44 posts

I started work on a search plugin a long time ago, but never finished as it was getting really tricky to code.

 
Aug 14, 2008 16:12
Avatar
77 posts

ajcates,

I was curious if someone had worked on a search plugin. Do you think the Yahoo! BOSS application could be used with Frog CMS?

 
Aug 17, 2008 07:20
Avatar
44 posts

I wouldn't use some third party search thing, as they do not have access to the mySQL database so the results tend to be very miss leading. I wanted to build an ajax search plugin that would auto complete your searchers based on your tags, yet match the results of it against the body of your page parts.

With Frog 9.3 out I may start back up on a search plugin again.

 
Aug 17, 2008 11:03
Avatar
142 posts

Hey redcrew, I have used a third party search plugin, Orca search. You can check it out running live on AV Festival.

The search module itself is awesome - I have managed to convert it so that it works as a plugin in as much that the control pages are displayed in an iframe in the back end - it is nowhere near a proper plugin. However, as a search tool it is incredibly powerful to administer. I would recommend checking it out... if you need a quick solution. Obviously a native plugin would be soooo much better but this works nicely in the interim

Andy

 
Aug 18, 2008 03:16
Avatar
51 posts

ajcates, I think that better to make basic HTML plugin and then to exist Ajax futures.

 
Sep 19, 2008 06:16
Avatar
48 posts

Is anyone any closer to finding a site-search solution?

I’ve tried to write something myself, but like others here, I have found it to be really difficult to work around the database architecture. I was going to write something that worked for pages that didn’t have any parents (that’d be easy) but I honestly think it should be written to scale with parents … arghhh.

 
Sep 19, 2008 08:02
Avatar
142 posts

Same here – I’ve written one that is semi functional. I am having problems dealing with and endless number of slugs in the url though. If the page part table had a ‘url’ row it would take 5 minutes. I’m busy doing other stuff now, if I get a chance to work on it again I’ll let you know…

 
Sep 19, 2008 08:42
Avatar
396 posts

@Andy – are you prepared to send your stuff to me? I may be able to find a solution to your url problem.

 
Sep 19, 2008 08:43
Avatar
142 posts

Yeah sure – do you want to drop me an email to andrew at band-x.org with your email and I’ll send em across

 
Sep 19, 2008 10:24
Avatar
51 posts

We need search plugin for our project.

We have SQL-query:
$sql = “SELECT * FROM page_part as pp LEFT JOIN page as p ON pp.page_id = p.id WHERE pp.content_html LIKE“. $query .”‘”;

and I think about search plugin createon.

 
Sep 21, 2008 06:11
Avatar
48 posts

This is a working solution for a basic sites earch facility.

Step 1. Add to header snippet:

code
<form action="/search.html" method="post">
<input type="text" name="search" id="search" value="<?php echo $_POST['search'];?>"><input type="submit" name="submit" value="submit">
</form>

Step 2. Create sitesearch snippet with filter set to none and body:

code
<?php
function snippet_sitesearch($parent){
	$childs = $parent->children();
	if (count($childs) > 0){		
		foreach ($childs as $child) {		 	
			$mysearch = $_POST['search'];
		 	if(strstr($mychild.$child->content(),$mysearch)){
				$out .= '<li><strong>'.$child->link().'</strong></li>';
			}
			$out .= snippet_sitesearch($child);
		} 	 	
	}
	$out = str_replace("<li><li>", "<li>", $out);
	$out = str_replace("</li></li>", "</li>", $out);	
	return $out;  
}
?>
<div id="results">
<?php echo snippet_sitesearch($this->find('/')); ?>
</div>

Step 3. Create hidden search page with filter set to none and body:

code
<?php
if (isset($_POST['submit'])){
	$searchcriteria = $_POST['search'];
	if($searchcriteria != NULL){
		echo "<p>Search result for: <strong>" . $_POST['search'] . "</strong></p>";			
		echo "<ul>";
			$this->includeSnippet('sitesearch');
		echo "</ul>";
	}
}
?>

Summary:

This is not a plugin. It doesn’t have any fancy features, it just provides a small, lite and quick way of returning page results that contain the search term.

I hope it will be of use to others as it is, until something more advanced becomes available.

 
Sep 22, 2008 05:16
Avatar
3 posts

Form action should be /?search.html in my case.

Is there any way to mark search query?
For example:
I searching for “foo”
At page from results list, I have words foo warped with <span class=“mark”>foo</span>

 
Sep 22, 2008 06:59
Avatar
396 posts

Just FYI for those “listening” in on this thread: I got Andy’s plugin and I’m seeing whether it can be integrated in the core distribution as a plugin since I think a search plugin is vital enough to distribute along with the core.

I also have to do some cleanup on it first :-p (no offense Andy)

 
Sep 22, 2008 07:01
Avatar
77 posts

This is great news! I haven’t been back to the forums in a while, but am excited to see the updates and continued progress on the search plugin. Thanks to all who have been involved with the work on the search plugin.

 
Sep 22, 2008 09:34
Avatar
142 posts

hahah none taken – if you can get it to work URL’s properly then that would be great…

 
Sep 22, 2008 10:28
Avatar
819 posts

mvdkleijn wrote:

I think a search plugin is vital enough to distribute along with the core.

Sounds right to me.

 
Sep 23, 2008 05:07
Avatar
48 posts

Hi, Marek.

Do you mean wrap each instance of the matched term, so for example a search for ‘hello’ which returns a title called ‘hello world’ would in fact return ‘<span class=“mark”>hello<span> world’ ?

 
Sep 24, 2008 05:42
Avatar
3 posts

BlueFrog, exactly.

I need $_POST[‘search’] when navigating to the sub-page from search result.

 
Sep 24, 2008 06:38
Avatar
51 posts

@marek.kaczkowski, Maybe this help you.

 
Sep 24, 2008 17:57
Avatar
48 posts

Marek,

I thought you meant matched terms on the search results page.

If you need to highlight matched terms on those pages you click through to via the results page, then this is a little more messy. It is possible, but without presently being able to pass variables, this would require each search result to be a submit button as opposed to a text link. This is possible, but not only would the html markup be considerably increased in size, it would also be semantically incorrect and as such I’d avoid venturing down that route.

Perhaps there has been some progress on passing variables?

 
Sep 25, 2008 16:30
Avatar
15 posts

@BlueFrog

Thanks for this quick search! :)
Is there way to show not just title but whole article entry?

Thanks!

 
Sep 25, 2008 16:39
Avatar
48 posts

Super easy, Marko.

Try replacing the following:

code
$out .= '<li><strong>'.$child->link().'</strong></li>';

with:

code
$out .= '<li><strong>'.$child->link().'</strong><br />'.$child->content().'</li>';

The above returns both the page title And the page content.