From 4bd16f053847f2efe347ebda9136ef2233ee0d2c Mon Sep 17 00:00:00 2001 From: hukl Date: Tue, 28 Apr 2009 00:15:53 +0200 Subject: added thinking_sphinx plugin for fulltext search on nodes and heads --- .../thinking-sphinx/features/support/models/post.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 vendor/plugins/thinking-sphinx/features/support/models/post.rb (limited to 'vendor/plugins/thinking-sphinx/features/support/models/post.rb') diff --git a/vendor/plugins/thinking-sphinx/features/support/models/post.rb b/vendor/plugins/thinking-sphinx/features/support/models/post.rb new file mode 100644 index 0000000..430d17c --- /dev/null +++ b/vendor/plugins/thinking-sphinx/features/support/models/post.rb @@ -0,0 +1,16 @@ +class Post < ActiveRecord::Base + has_many :comments, :dependent => :destroy + has_many :taggings, :as => :taggable + has_many :tags, :through => :taggings + belongs_to :category + + define_index do + indexes subject + indexes content + indexes tags.text, :as => :tags + indexes comments.content, :as => :comments + + has comments(:id), :as => :comment_ids, :source => :ranged_query + has category.name, :facet => true, :as => :category_name, :type => :string + end +end -- cgit v1.3