Skip to content

Instantly share code, notes, and snippets.

@ananyo2012
Created July 3, 2016 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ananyo2012/ea7e4b801d847857d833f3371740cb63 to your computer and use it in GitHub Desktop.
Save ananyo2012/ea7e4b801d847857d833f3371740cb63 to your computer and use it in GitHub Desktop.
Ruby code for simple Search query
@notes = DrupalNode.where(
'type = "note" AND node.status = 1 AND title LIKE ?',
"%" + params[:id] + "%"
)
.joins(:drupal_tag)
.where('term_data.name LIKE ?', 'question:%')
.order('node.nid DESC')
.page(params[:page])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment