Skip to content

Instantly share code, notes, and snippets.

@benzheren
Created November 10, 2011 12:37
Show Gist options
  • Save benzheren/1354764 to your computer and use it in GitHub Desktop.
Save benzheren/1354764 to your computer and use it in GitHub Desktop.
Tire Search Code using DSL
@s = Tire.search index_path,
:from => 0,
:size => 100,
:query => {"text" => {"_all" => query}},
:highlight => {"fields" => {"text" => {}},
"pre_tags" => ["<strong class=\"highlight\">"],
"post_tags" => ["</strong>"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment