Skip to content

Instantly share code, notes, and snippets.

class Story < ActiveRecord::Base
acts_as_solr :facets => [:notes],
:fields => [
:name, :title,
:content, :display_name, :intro
]
end
$ rake ultrasphinx:configure
$ rake ultrasphinx:index
$ rake ultrasphinx:daemon:start
@search = Ultrasphinx::Search.new(:query => @query)
@search.run
@search.results
class Story < ActiveRecord::Base
# FULLTEXT INDEXING
is_indexed :fields => [
{:field => 'title', :sortable => true},
:content, :teaser, :category_id
],
:include => [
{:association_name => 'category', :field => 'name', :as => 'category_name'},
{:association_name => 'category', :field => 'parent_id'}
@chadwpry
chadwpry / model
Created September 25, 2008 22:13
class Story < ActiveRecord::Base
# FULLTEXT INDEXING
is_indexed :fields => [
{:field => 'title', :sortable => true},
:content, :teaser, :category_id
],
:include => [
{:association_name => 'category', :field => 'name', :as => 'category_name'},
{:association_name => 'category', :field => 'parent_id'}