# Search\_behavior and ruby-lang.org

**URL:** <https://www.ruby-forum.com/t/search-behavior-and-ruby-lang-org/73422>\
**Category:** Radiant CMS\
**Created:** [October 24, 2006, 5:30pm UTC](https://www.ruby-forum.com/t/search-behavior-and-ruby-lang-org/73422 "2006-10-24T17:30:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wes\_Bangerter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@Wes\_Bangerter](https://www.ruby-forum.com/u/Wes_Bangerter)\
**Post date:** [October 24, 2006, 5:30pm UTC](https://www.ruby-forum.com/t/search-behavior-and-ruby-lang-org/73422/1 "2006-10-24T17:30:31Z")

</div>

I’ve added search to a website I’m working on using the  
search\_behavior plugin, and everything is working fine. I noticed on  
the [ruby-lang.org](http://ruby-lang.org) site that the search there is a lot nicer though. It  
includes a bit of content from each page it finds with the search  
phrase highlighted. I think it’s also excluding some pages (I couldn’t  
get it to list the “page missing” page in its results). Is anyone here  
familiar with how that page on [ruby-lang.org](http://ruby-lang.org) works? Is it still using  
search\_behavior? Is it possible to get the search\_behavior in the  
radiant subversion repository working like that?

Thanks,  
Wes Bangerter

---

<div class="post-metadata">

**Author:** ![Wes\_Bangerter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@Wes\_Bangerter](https://www.ruby-forum.com/u/Wes_Bangerter)\
**Post date:** [October 24, 2006, 7:00pm UTC](https://www.ruby-forum.com/t/search-behavior-and-ruby-lang-org/73422/2 "2006-10-24T19:00:14Z")

</div>

Wes Bangerter wrote:

> I’ve added search to a website I’m working on using the  
> search\_behavior plugin, and everything is working fine. I noticed on  
> the [ruby-lang.org](http://ruby-lang.org) site that the search there is a lot nicer though. It  
> includes a bit of content from each page it finds with the search  
> phrase highlighted. I think it’s also excluding some pages (I couldn’t  
> get it to list the “page missing” page in its results). Is anyone here  
> familiar with how that page on [ruby-lang.org](http://ruby-lang.org) works? Is it still using  
> search\_behavior? Is it possible to get the search\_behavior in the  
> radiant subversion repository working like that?

Ruby-Lang is using a modified version of Oliver B.'s search  
behavior:

[http://rubyidentity.org/ruby-lang.org/browser/ruby-lang.org/trunk/www/vendor/plugins/search\_behavior/](http://rubyidentity.org/ruby-lang.org/browser/ruby-lang.org/trunk/www/vendor/plugins/search_behavior/)

Here’s the code that makes it work:

\<r:search\>  
\<r:if\_query\>  
\<r:empty\>

No matches.

  
\</r:empty\>

```
 <r:results:each>
   <h3><r:link><r:excerpt><r:title/></r:excerpt></r:link></h3>
   <p><r:excerpt radius="200"><r:content /></r:excerpt></p>
 </r:results:each>

 <hr class="hidden" />

 <form id="search-again-form" action="<r:url />" method="get">
   <p><r:input /> <input type="submit" value="Search Again" /></p>
 </form>

```

\</r:if\_query\>  
\<r:unless\_query\>

\<r:input /\>

  
  
\</r:unless\_query\>  
\</r:search\>

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Wes\_Bangerter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@Wes\_Bangerter](https://www.ruby-forum.com/u/Wes_Bangerter)\
**Post date:** [October 25, 2006, 1:55pm UTC](https://www.ruby-forum.com/t/search-behavior-and-ruby-lang-org/73422/3 "2006-10-25T13:55:12Z")

</div>

On 24 Oct 2006, at 17:59, John W. Long wrote:

> > familiar with how that page on [ruby-lang.org](http://ruby-lang.org) works? Is it still using  
> > search\_behavior? Is it possible to get the search\_behavior in the  
> > radiant subversion repository working like that?
> 
> Ruby-Lang is using a modified version of Oliver B.'s search  
> behavior:
> 
> [http://rubyidentity.org/ruby-lang.org/browser/ruby-lang.org/trunk/](http://rubyidentity.org/ruby-lang.org/browser/ruby-lang.org/trunk/)  
> www/vendor/plugins/search\_behavior/

the modifications look very useful. thanks for posting the link.  
I can browse the code but I can’t get at the plugin, though: script/  
plugin throws a 500 error and SVN does this:

$ svn co [http://rubyidentity.org/ruby-lang.org/browser/ruby-lang.org/](http://rubyidentity.org/ruby-lang.org/browser/ruby-lang.org/)  
trunk/www/vendor/plugins/search\_behavior/  
svn: PROPFIND request failed on ‘/ruby-lang.org/browser/ruby-lang.org/  
trunk/www/vendor/plugins/search\_behavior’  
svn: PROPFIND of ‘/ruby-lang.org/browser/ruby-lang.org/trunk/www/  
vendor/plugins/search\_behavior’: 501 Unsupported method (‘PROPFIND’)  
([http://rubyidentity.org](http://rubyidentity.org))

is there a glitch or am I just doing something wrong?

thanks,

will

---

<div class="post-metadata">

**Author:** ![Wes\_Bangerter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@Wes\_Bangerter](https://www.ruby-forum.com/u/Wes_Bangerter)\
**Post date:** [October 25, 2006, 7:34pm UTC](https://www.ruby-forum.com/t/search-behavior-and-ruby-lang-org/73422/4 "2006-10-25T19:34:21Z")

</div>

William Ross wrote:

> $ svn co [http://rubyidentity.org/ruby-lang.org/browser/ruby-lang.org/](http://rubyidentity.org/ruby-lang.org/browser/ruby-lang.org/)  
> trunk/www/vendor/plugins/search\_behavior/  
> svn: PROPFIND request failed on ‘/ruby-lang.org/browser/ruby-lang.org/  
> trunk/www/vendor/plugins/search\_behavior’  
> svn: PROPFIND of ‘/ruby-lang.org/browser/ruby-lang.org/trunk/www/  
> vendor/plugins/search\_behavior’: 501 Unsupported method (‘PROPFIND’)  
> ([http://rubyidentity.org](http://rubyidentity.org))
> 
> is there a glitch or am I just doing something wrong?

You are using the path for the Trac browser. For svn, try this one:

[http://rubyidentity.org/svn/ruby-lang/ruby-lang.org/trunk/www/vendor/plugins/search\_behavior/](http://rubyidentity.org/svn/ruby-lang/ruby-lang.org/trunk/www/vendor/plugins/search_behavior/)

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)
