Skip to content
effkay edited this page Oct 24, 2014 · 1 revision

Integrating search

Qbrick supports fulltext search when using PostgreSQL with a simple LIKE fallback for any other ActiveRecord DB.

Add a call to the search_page_form helper in your views. This renders the default search form. The query will be executed by qbrick.

# e.g. _footer.html.haml
= search_page_form

To customize the search and result views you can add your own partials to your rails app. The following partials are overridable.

app/views/qbrick/search
├── _form.html.haml           # Search form
├── _results.html.haml        # Results list (@pages)
└── _results_entry.html.haml  # Single result entry (@page)

When using PostgreSQL, an additional attribute excerpt will be available on the page model. It includes a highlighted excerpt of the matching fulltext column.

Clone this wiki locally