outoftime-sunspot 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -6
- data/README.rdoc +45 -13
- data/Rakefile +5 -21
- data/VERSION.yml +4 -0
- data/bin/sunspot-solr +39 -0
- data/lib/sunspot/builder.rb +78 -0
- data/lib/sunspot/dsl/fields.rb +39 -0
- data/lib/sunspot/dsl/query.rb +32 -0
- data/lib/sunspot/dsl/scope.rb +35 -0
- data/lib/sunspot/dsl.rb +3 -0
- data/lib/sunspot/query.rb +9 -20
- data/lib/sunspot/search.rb +8 -25
- data/lib/sunspot.rb +2 -3
- data/solr/etc/jetty.xml +10 -4
- data/solr/solr/conf/{admin-extra.html → elevate.xml} +18 -13
- data/solr/solr/conf/solrconfig.xml +369 -67
- data/solr/webapps/solr.war +0 -0
- data/spec/api/build_search_spec.rb +195 -0
- data/spec/api/indexer_spec.rb +112 -0
- data/spec/api/search_retrieval_spec.rb +59 -0
- data/spec/api/session_spec.rb +44 -0
- data/spec/api/spec_helper.rb +1 -0
- data/spec/api/standard_search_builder_spec.rb +76 -0
- data/{test → spec}/custom_expectation.rb +0 -0
- data/{test/integration/test_field_types.rb → spec/integration/field_types_spec.rb} +9 -9
- data/{test/integration/test_keyword_search.rb → spec/integration/keyword_search_spec.rb} +5 -5
- data/spec/integration/spec_helper.rb +1 -0
- data/{test → spec}/integration/test_pagination.rb +5 -5
- data/{test → spec}/mocks/base_class.rb +0 -0
- data/{test → spec}/mocks/comment.rb +0 -0
- data/{test → spec}/mocks/mock_adapter.rb +0 -0
- data/{test → spec}/mocks/post.rb +0 -0
- data/{test/test_helper.rb → spec/spec_helper.rb} +6 -12
- data/tasks/gemspec.rake +18 -0
- data/tasks/rcov.rake +27 -5
- data/tasks/spec.rake +21 -0
- metadata +90 -125
- data/Manifest.txt +0 -104
- data/PostInstall.txt +0 -7
- data/config/hoe.rb +0 -74
- data/config/requirements.rb +0 -15
- data/lib/sunspot/conditions.rb +0 -50
- data/lib/sunspot/conditions_builder.rb +0 -37
- data/lib/sunspot/field_builder.rb +0 -37
- data/lib/sunspot/query_builder.rb +0 -30
- data/lib/sunspot/scope_builder.rb +0 -33
- data/lib/sunspot/version.rb +0 -10
- data/setup.rb +0 -1585
- data/solr/README.txt +0 -36
- data/solr/exampledocs/books.csv +0 -11
- data/solr/exampledocs/hd.xml +0 -46
- data/solr/exampledocs/ipod_other.xml +0 -50
- data/solr/exampledocs/ipod_video.xml +0 -35
- data/solr/exampledocs/mem.xml +0 -58
- data/solr/exampledocs/monitor.xml +0 -31
- data/solr/exampledocs/monitor2.xml +0 -30
- data/solr/exampledocs/mp500.xml +0 -39
- data/solr/exampledocs/post.jar +0 -0
- data/solr/exampledocs/post.sh +0 -28
- data/solr/exampledocs/sd500.xml +0 -33
- data/solr/exampledocs/solr.xml +0 -38
- data/solr/exampledocs/spellchecker.xml +0 -58
- data/solr/exampledocs/utf8-example.xml +0 -42
- data/solr/exampledocs/vidcard.xml +0 -52
- data/solr/solr/README.txt +0 -52
- data/solr/solr/bin/abc +0 -176
- data/solr/solr/bin/abo +0 -176
- data/solr/solr/bin/backup +0 -108
- data/solr/solr/bin/backupcleaner +0 -142
- data/solr/solr/bin/commit +0 -128
- data/solr/solr/bin/optimize +0 -129
- data/solr/solr/bin/readercycle +0 -129
- data/solr/solr/bin/rsyncd-disable +0 -77
- data/solr/solr/bin/rsyncd-enable +0 -76
- data/solr/solr/bin/rsyncd-start +0 -145
- data/solr/solr/bin/rsyncd-stop +0 -105
- data/solr/solr/bin/scripts-util +0 -83
- data/solr/solr/bin/snapcleaner +0 -148
- data/solr/solr/bin/snapinstaller +0 -168
- data/solr/solr/bin/snappuller +0 -248
- data/solr/solr/bin/snappuller-disable +0 -77
- data/solr/solr/bin/snappuller-enable +0 -77
- data/solr/solr/bin/snapshooter +0 -109
- data/solr/solr/conf/scripts.conf +0 -24
- data/tasks/deployment.rake +0 -34
- data/tasks/environment.rake +0 -7
- data/tasks/solr.rake +0 -12
- data/tasks/website.rake +0 -17
- data/test/api/test_build_search.rb +0 -216
- data/test/api/test_helper.rb +0 -4
- data/test/api/test_indexer.rb +0 -110
- data/test/api/test_retrieve_search.rb +0 -114
- data/test/api/test_session.rb +0 -46
- data/test/integration/test_helper.rb +0 -1
@@ -1,33 +0,0 @@
|
|
1
|
-
module Sunspot
|
2
|
-
class ScopeBuilder
|
3
|
-
def initialize(query)
|
4
|
-
@query = query
|
5
|
-
end
|
6
|
-
|
7
|
-
def method_missing(field_name, *args)
|
8
|
-
if args.length == 0 then RestrictionBuilder.new(field_name, @query)
|
9
|
-
elsif args.length == 1 then @query.add_scope @query.build_condition(field_name, ::Sunspot::Restriction::EqualTo, args.first)
|
10
|
-
else super(field_name.to_sym, *args)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class RestrictionBuilder
|
15
|
-
def initialize(field_name, query)
|
16
|
-
@field_name, @query = field_name, query
|
17
|
-
end
|
18
|
-
|
19
|
-
def method_missing(condition_name, *args)
|
20
|
-
clazz = begin
|
21
|
-
::Sunspot::Restriction.const_get(condition_name.to_s.camel_case)
|
22
|
-
rescue(NameError)
|
23
|
-
super(condition_name.to_sym, *args)
|
24
|
-
end
|
25
|
-
if value = args.first
|
26
|
-
@query.add_scope @query.build_condition(@field_name, clazz, args.first)
|
27
|
-
else
|
28
|
-
@query.interpret_condition @field_name, clazz
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|