# Search patch (global tags)

**URL:** <https://www.ruby-forum.com/t/search-patch-global-tags/143112>\
**Category:** Radiant CMS\
**Created:** [July 15, 2008, 11:44am UTC](https://www.ruby-forum.com/t/search-patch-global-tags/143112 "2008-07-15T11:44:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![janpipek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@janpipek](https://www.ruby-forum.com/u/janpipek)\
**Post date:** [July 15, 2008, 11:44am UTC](https://www.ruby-forum.com/t/search-patch-global-tags/143112/1 "2008-07-15T11:44:04Z")

</div>

I have been following this guide to add search to radiant.

[http://wiki.radiantcms.org/Using\_the\_Search\_Extension](http://wiki.radiantcms.org/Using_the_Search_Extension)

I would like to add search globally - not only on a specific search  
page. And to do that I have to apply the “search\_extension.diff” patch,  
but when I run it it says:

[chainrea@belong radapp]$ patch -p0 \< search\_extension.diff  
patching file vendor/extensions/search/test/unit/search\_page\_test.rb  
patching file vendor/extensions/search/test/unit/search\_tags\_test.rb  
patching file  
vendor/extensions/search/test/functional/search\_extension\_test.rb  
patching file vendor/extensions/search/test/fixtures/pages.yml  
patching file vendor/extensions/search/test/fixtures/page\_parts.yml  
patching file vendor/extensions/search/app/models/search\_page.rb  
Hunk #2 succeeded at 72 (offset 8 lines).  
patching file vendor/extensions/search/app/models/search\_tags.rb  
patching file vendor/extensions/search/search\_extension.rb  
Hunk #1 FAILED at 9.  
1 out of 1 hunk FAILED – saving rejects to file  
vendor/extensions/search/search\_extension.rb.rej

I kind of hoped it did not matter, but when i add the search tag on a  
page it displays:

undefined tag `search’

(I also ran “rake production db:migrate:extensions” after the patch was  
applied)

---

<div class="post-metadata">

**Author:** ![janpipek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@janpipek](https://www.ruby-forum.com/u/janpipek)\
**Post date:** [July 15, 2008, 12:53pm UTC](https://www.ruby-forum.com/t/search-patch-global-tags/143112/2 "2008-07-15T12:53:59Z")

</div>

Now suddenly it is even more broken - it now says:

undefined tag `form’

I then deleted the search extension folder.

Re-unpacked the tar.gz file - renamed the folder to search and ran rake,  
but it still says:

undefined tag `form’

---

<div class="post-metadata">

**Author:** ![janpipek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@janpipek](https://www.ruby-forum.com/u/janpipek)\
**Post date:** [July 15, 2008, 1:02pm UTC](https://www.ruby-forum.com/t/search-patch-global-tags/143112/3 "2008-07-15T13:02:59Z")

</div>

Jan frederik Poulsen wrote:

> Now suddenly it is even more broken - it now says:
> 
> undefined tag `form’
> 
> I then deleted the search extension folder.
> 
> Re-unpacked the tar.gz file - renamed the folder to search and ran rake,  
> but it still says:
> 
> undefined tag `form’

Okay now the basic search is working again. It seems some time has to  
pass before it kind of resets.

But I would still like global search and live search, what seems to be  
the issue with the “search\_extension.diff” patch?

---

<div class="post-metadata">

**Author:** ![janpipek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@janpipek](https://www.ruby-forum.com/u/janpipek)\
**Post date:** [July 16, 2008, 7:33pm UTC](https://www.ruby-forum.com/t/search-patch-global-tags/143112/4 "2008-07-16T19:33:22Z")

</div>

Jan frederik Poulsen wrote:

> Any help? I’m getting a bit desperate? ☹

The newest Search Extension code is in GitHub:

> **[GitHub - radiant/radiant-search-extension: An extension for Radiant CMS to...](https://github.com/radiant/radiant-search-extension/tree/master)**
>
> master

However, it removes the live search functionality. You might want to use  
the download link and try it out anyways, because it should accomplish  
your other goals.

- Dave

---

<div class="post-metadata">

**Author:** ![janpipek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@janpipek](https://www.ruby-forum.com/u/janpipek)\
**Post date:** [July 15, 2008, 6:20pm UTC](https://www.ruby-forum.com/t/search-patch-global-tags/143112/5 "2008-07-15T18:20:41Z")

</div>

Any help? I’m getting a bit desperate? ☹

---

<div class="post-metadata">

**Author:** ![janpipek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@janpipek](https://www.ruby-forum.com/u/janpipek)\
**Post date:** [July 16, 2008, 7:37pm UTC](https://www.ruby-forum.com/t/search-patch-global-tags/143112/6 "2008-07-16T19:37:28Z")

</div>

David P. wrote:

> Jan frederik Poulsen wrote:
> 
> > Any help? I’m getting a bit desperate? ☹
> 
> The newest Search Extension code is in GitHub:  
> [GitHub - radiant/radiant-search-extension: An extension for Radiant CMS to support searching pages.](http://github.com/radiant/radiant-search-extension/tree/master)
> 
> However, it removes the live search functionality. You might want to use  
> the download link and try it out anyways, because it should accomplish  
> your other goals.
> 
> - Dave

Also, here are my notes on using an older version of the Search  
Extension. This might be helpful to you.

$ cd PATH/TO/PROJECT  
$ svn export  
[http://svn.radiantcms.org/radiant/tags/rel\_0-6-6/extensions/search](http://svn.radiantcms.org/radiant/tags/rel_0-6-6/extensions/search)  
vendor/extensions/search

Add a new tag to  
/PATH/TO/PROJECT/vendor/extensions/search/app/models/search\_page.rb

### 2008-05-21 DP added new tag to check if a search has been submitted

desc %{ Checks if a query was passed to the browser.}  
tag ‘search:if\_submitted’ do |tag|  
unless @query == “”  
tag.expand  
end  
end

Be sure to set the Page Type to “Search” or else loading the page will  
fail with an error about a missing tag.

The following is a good default Search pageâ€¦

\<r:search:form label=“Search for:”/\>

## Searching '' returned no results.

## Searching '' returned:

You can prevent pages from being returned by adding a ‘no-search’  
page-part to them.

The above tag \<r:unless\_content part=“no-search”\> is used to hide all  
pages with a page-part of â€˜no-searchâ€™ in the search results. This can  
result in searches that return â€œYour search for â€˜Xâ€™ returned the  
following pages:â€ with no results below, but its better than showing  
hidden pages.

- Dave
