Its not a good idea to use different queries for the different data types - this can lead to bugs. You can do something like:
```
  @posts = Post.published
  @posts = @posts.contains(params[:searh_field]) if params[:search_field]
```
after that list them in the index.html or rabl file.