summaryrefslogtreecommitdiff
path: root/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/deltas.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-04-28 00:15:53 +0200
committerhukl <contact@smyck.org>2009-05-01 17:14:02 +0200
commit4bd16f053847f2efe347ebda9136ef2233ee0d2c (patch)
treef4c11f89455de991c8d87726d5757b752e7129e2 /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/deltas.rb
parentd3a9b46ba5c863a0ff377dcffae9a494fe476e02 (diff)
added thinking_sphinx plugin for fulltext search on nodes and heads
Diffstat (limited to 'vendor/plugins/thinking-sphinx/lib/thinking_sphinx/deltas.rb')
-rw-r--r--vendor/plugins/thinking-sphinx/lib/thinking_sphinx/deltas.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/deltas.rb b/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/deltas.rb
new file mode 100644
index 0000000..57c396e
--- /dev/null
+++ b/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/deltas.rb
@@ -0,0 +1,27 @@
1require 'thinking_sphinx/deltas/default_delta'
2require 'thinking_sphinx/deltas/delayed_delta'
3require 'thinking_sphinx/deltas/datetime_delta'
4
5module ThinkingSphinx
6 module Deltas
7 def self.parse(index, options)
8 delta_option = options.delete(:delta)
9 case delta_option
10 when TrueClass, :default
11 DefaultDelta.new index, options
12 when :delayed
13 DelayedDelta.new index, options
14 when :datetime
15 DatetimeDelta.new index, options
16 when FalseClass, nil
17 nil
18 else
19 if delta_option.ancestors.include?(ThinkingSphinx::Deltas::DefaultDelta)
20 delta_option.new index, options
21 else
22 raise "Unknown delta type"
23 end
24 end
25 end
26 end
27end