Search and Ye Shall Find
- Published
- about 8 months ago
- by
- with
- 0 Comments
Last week we finally launched our integrated search engine, letting you easily add a fully customizable search to any of your websites.
One of the advantages of a fully hosted CMS is that we can take advantage of exciting new technologies. A CMS made to be installed on a shared host needs to stick to the lowest common denominator. We don't.

For our built-in search we've taken advantage of this and set up an ElasticSearch cluster. All content on your site gets indexed by elasticsearch and we've added a new <pop:search> tag to let you add a search to your site.
Setting up a site search is easy. Add a new template to your site called search.tpl (or whatever you prefer) and add a "Search" section to your content using this new template.
First we add a search box to our template. This is just a plain html form:
<form action="/search" method="get">
<p class="field">
<label for="search-box">Search: </label>
<input type="search" name="q" value="<pop:search:query/>"/>
</p>
</form>
Then, in the template, where you want the search results to appear, paste this code:
<pop:search>
<h3>Got <pop:count/> results for <pop:query/></h3>
<pop:results>
<h4><a href="<pop:permalink/>"><pop:title/></a></h4>
<pop:description wrap="p"/>
</pop:results>
<pop:pagination>
<pop:next><a href="<pop:permalink/>">More</a></pop:next>
</pop:pagination>
</pop:search>
That's all there is to it. You now have a fully integrated site search that you can style and design however you want.
