sunspot 2.0.0.pre.120720 → 2.0.0.pre.120924
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -11
- data/.travis.yml +35 -0
- data/README.md +863 -0
- data/Rakefile +32 -8
- data/ci/travis.sh +67 -0
- data/sunspot/.gitignore +13 -0
- data/{Gemfile → sunspot/Gemfile} +0 -0
- data/{History.txt → sunspot/History.txt} +0 -0
- data/{LICENSE → sunspot/LICENSE} +0 -0
- data/sunspot/Rakefile +13 -0
- data/{TODO → sunspot/TODO} +0 -0
- data/{lib → sunspot/lib}/light_config.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/adapters.rb +85 -5
- data/{lib → sunspot/lib}/sunspot/batcher.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/class_set.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/composite_setup.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/configuration.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/data_extractor.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/adjustable.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/field_group.rb +2 -2
- data/{lib → sunspot/lib}/sunspot/dsl/field_query.rb +1 -1
- data/{lib → sunspot/lib}/sunspot/dsl/fields.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/fulltext.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/function.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/functional.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/more_like_this_query.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/paginatable.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/query_facet.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/restriction.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/restriction_with_near.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/scope.rb +8 -11
- data/{lib → sunspot/lib}/sunspot/dsl/search.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/dsl/standard_query.rb +3 -4
- data/{lib → sunspot/lib}/sunspot/dsl.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/field.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/field_factory.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/indexer.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/abstract_field_facet.rb +1 -1
- data/{lib → sunspot/lib}/sunspot/query/bbox.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/boost_query.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/common_query.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/composite_fulltext.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/connective.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/date_field_facet.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/dismax.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/field_facet.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/field_group.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/filter.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/function_query.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/geo.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/geofilt.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/highlighting.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/more_like_this.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/more_like_this_query.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/pagination.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/query_facet.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/range_facet.rb +1 -0
- data/{lib → sunspot/lib}/sunspot/query/restriction.rb +12 -0
- data/{lib → sunspot/lib}/sunspot/query/scope.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/sort.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/sort_composite.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/standard_query.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query/text_field_boost.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/query.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/schema.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/abstract_search.rb +2 -2
- data/{lib → sunspot/lib}/sunspot/search/date_facet.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/facet_row.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/field_facet.rb +0 -0
- data/sunspot/lib/sunspot/search/field_group.rb +70 -0
- data/{lib → sunspot/lib}/sunspot/search/group.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/highlight.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/hit.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/hit_enumerable.rb +5 -9
- data/{lib → sunspot/lib}/sunspot/search/more_like_this_search.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/paginated_collection.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/query_facet.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/range_facet.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search/standard_search.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/search.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session_proxy/abstract_session_proxy.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session_proxy/class_sharding_session_proxy.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session_proxy/id_sharding_session_proxy.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session_proxy/master_slave_session_proxy.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session_proxy/retry_5xx_session_proxy.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session_proxy/sharding_session_proxy.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session_proxy/silent_fail_session_proxy.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session_proxy/thread_local_session_proxy.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/session_proxy.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/setup.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/text_field_setup.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/type.rb +0 -0
- data/{lib → sunspot/lib}/sunspot/util.rb +0 -0
- data/sunspot/lib/sunspot/version.rb +3 -0
- data/{lib → sunspot/lib}/sunspot.rb +0 -0
- data/{log → sunspot/log}/.gitignore +0 -0
- data/{pkg → sunspot/pkg}/.gitignore +0 -0
- data/{script → sunspot/script}/console +0 -0
- data/sunspot/spec/api/adapters_spec.rb +68 -0
- data/{spec → sunspot/spec}/api/batcher_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/binding_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/class_set_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/hit_enumerable_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/indexer/attributes_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/indexer/batch_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/indexer/dynamic_fields_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/indexer/fixed_fields_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/indexer/fulltext_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/indexer/removal_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/indexer/spec_helper.rb +0 -0
- data/{spec → sunspot/spec}/api/indexer_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/query/advanced_manipulation_examples.rb +0 -0
- data/{spec → sunspot/spec}/api/query/connectives_examples.rb +12 -0
- data/{spec → sunspot/spec}/api/query/dsl_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/query/dynamic_fields_examples.rb +0 -0
- data/{spec → sunspot/spec}/api/query/faceting_examples.rb +8 -8
- data/{spec → sunspot/spec}/api/query/fulltext_examples.rb +0 -0
- data/{spec → sunspot/spec}/api/query/function_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/query/geo_examples.rb +0 -0
- data/{spec → sunspot/spec}/api/query/group_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/query/highlighting_examples.rb +0 -0
- data/{spec → sunspot/spec}/api/query/more_like_this_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/query/ordering_pagination_examples.rb +0 -0
- data/{spec → sunspot/spec}/api/query/scope_examples.rb +0 -0
- data/{spec → sunspot/spec}/api/query/spatial_examples.rb +0 -0
- data/{spec → sunspot/spec}/api/query/spec_helper.rb +0 -0
- data/{spec → sunspot/spec}/api/query/standard_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/query/text_field_scoping_examples.rb +0 -0
- data/{spec → sunspot/spec}/api/query/types_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/search/dynamic_fields_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/search/faceting_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/search/highlighting_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/search/hits_spec.rb +16 -0
- data/{spec → sunspot/spec}/api/search/paginated_collection_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/search/results_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/search/search_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/search/spec_helper.rb +0 -0
- data/{spec → sunspot/spec}/api/session_proxy/class_sharding_session_proxy_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/session_proxy/id_sharding_session_proxy_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/session_proxy/master_slave_session_proxy_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/session_proxy/retry_5xx_session_proxy_spec.rb +5 -0
- data/{spec → sunspot/spec}/api/session_proxy/sharding_session_proxy_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/session_proxy/silent_fail_session_proxy_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/session_proxy/spec_helper.rb +0 -0
- data/{spec → sunspot/spec}/api/session_proxy/thread_local_session_proxy_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/session_spec.rb +0 -0
- data/{spec → sunspot/spec}/api/spec_helper.rb +0 -0
- data/{spec → sunspot/spec}/api/sunspot_spec.rb +2 -2
- data/{spec → sunspot/spec}/ext.rb +0 -0
- data/{spec → sunspot/spec}/helpers/indexer_helper.rb +0 -0
- data/{spec → sunspot/spec}/helpers/integration_helper.rb +0 -0
- data/{spec → sunspot/spec}/helpers/mock_session_helper.rb +0 -0
- data/{spec → sunspot/spec}/helpers/query_helper.rb +0 -0
- data/{spec → sunspot/spec}/helpers/search_helper.rb +0 -0
- data/{spec → sunspot/spec}/integration/dynamic_fields_spec.rb +0 -0
- data/{spec → sunspot/spec}/integration/faceting_spec.rb +26 -0
- data/{spec → sunspot/spec}/integration/field_grouping_spec.rb +0 -0
- data/{spec → sunspot/spec}/integration/geospatial_spec.rb +11 -0
- data/{spec → sunspot/spec}/integration/highlighting_spec.rb +0 -0
- data/{spec → sunspot/spec}/integration/indexing_spec.rb +0 -0
- data/{spec → sunspot/spec}/integration/keyword_search_spec.rb +0 -0
- data/{spec → sunspot/spec}/integration/local_search_spec.rb +0 -0
- data/{spec → sunspot/spec}/integration/more_like_this_spec.rb +0 -0
- data/{spec → sunspot/spec}/integration/scoped_search_spec.rb +0 -0
- data/{spec → sunspot/spec}/integration/stored_fields_spec.rb +0 -0
- data/{spec → sunspot/spec}/integration/test_pagination.rb +0 -0
- data/{spec → sunspot/spec}/integration/unicode_spec.rb +0 -0
- data/{spec → sunspot/spec}/mocks/adapters.rb +1 -0
- data/{spec → sunspot/spec}/mocks/blog.rb +0 -0
- data/{spec → sunspot/spec}/mocks/comment.rb +0 -0
- data/{spec → sunspot/spec}/mocks/connection.rb +0 -0
- data/{spec → sunspot/spec}/mocks/mock_adapter.rb +0 -0
- data/{spec → sunspot/spec}/mocks/mock_class_sharding_session_proxy.rb +0 -0
- data/{spec → sunspot/spec}/mocks/mock_record.rb +0 -0
- data/{spec → sunspot/spec}/mocks/mock_sharding_session_proxy.rb +0 -0
- data/{spec → sunspot/spec}/mocks/photo.rb +0 -0
- data/{spec → sunspot/spec}/mocks/post.rb +0 -0
- data/{spec → sunspot/spec}/mocks/super_class.rb +0 -0
- data/{spec → sunspot/spec}/mocks/user.rb +0 -0
- data/{spec → sunspot/spec}/spec_helper.rb +0 -0
- data/{sunspot.gemspec → sunspot/sunspot.gemspec} +0 -0
- data/{tasks → sunspot/tasks}/rdoc.rake +0 -0
- data/{tasks → sunspot/tasks}/schema.rake +0 -0
- data/{tasks → sunspot/tasks}/todo.rake +0 -0
- data/sunspot_rails/.gitignore +7 -0
- data/sunspot_rails/.rspec +1 -0
- data/sunspot_rails/History.txt +74 -0
- data/sunspot_rails/LICENSE +18 -0
- data/sunspot_rails/MIT-LICENSE +20 -0
- data/sunspot_rails/README.rdoc +265 -0
- data/sunspot_rails/Rakefile +17 -0
- data/sunspot_rails/TODO +8 -0
- data/sunspot_rails/dev_tasks/rdoc.rake +24 -0
- data/sunspot_rails/dev_tasks/release.rake +4 -0
- data/sunspot_rails/dev_tasks/spec.rake +107 -0
- data/sunspot_rails/dev_tasks/todo.rake +4 -0
- data/sunspot_rails/gemfiles/rails-2.3.14 +12 -0
- data/sunspot_rails/gemfiles/rails-3.0.15 +12 -0
- data/sunspot_rails/gemfiles/rails-3.1.6 +12 -0
- data/sunspot_rails/gemfiles/rails-3.2.6 +12 -0
- data/sunspot_rails/generators/sunspot/sunspot_generator.rb +9 -0
- data/sunspot_rails/generators/sunspot/templates/sunspot.yml +20 -0
- data/sunspot_rails/install.rb +1 -0
- data/sunspot_rails/lib/generators/sunspot_rails/install/install_generator.rb +13 -0
- data/sunspot_rails/lib/generators/sunspot_rails/install/templates/config/sunspot.yml +19 -0
- data/sunspot_rails/lib/generators/sunspot_rails.rb +9 -0
- data/sunspot_rails/lib/sunspot/rails/adapters.rb +88 -0
- data/sunspot_rails/lib/sunspot/rails/configuration.rb +352 -0
- data/sunspot_rails/lib/sunspot/rails/init.rb +5 -0
- data/sunspot_rails/lib/sunspot/rails/log_subscriber.rb +45 -0
- data/sunspot_rails/lib/sunspot/rails/railtie.rb +41 -0
- data/sunspot_rails/lib/sunspot/rails/railties/controller_runtime.rb +36 -0
- data/sunspot_rails/lib/sunspot/rails/request_lifecycle.rb +36 -0
- data/sunspot_rails/lib/sunspot/rails/searchable.rb +495 -0
- data/sunspot_rails/lib/sunspot/rails/server.rb +106 -0
- data/sunspot_rails/lib/sunspot/rails/solr_instrumentation.rb +19 -0
- data/sunspot_rails/lib/sunspot/rails/solr_logging.rb +62 -0
- data/sunspot_rails/lib/sunspot/rails/spec_helper.rb +26 -0
- data/sunspot_rails/lib/sunspot/rails/stub_session_proxy.rb +146 -0
- data/sunspot_rails/lib/sunspot/rails/tasks.rb +94 -0
- data/sunspot_rails/lib/sunspot/rails.rb +69 -0
- data/sunspot_rails/lib/sunspot_rails.rb +12 -0
- data/sunspot_rails/spec/configuration_spec.rb +209 -0
- data/sunspot_rails/spec/model_lifecycle_spec.rb +63 -0
- data/sunspot_rails/spec/model_spec.rb +601 -0
- data/sunspot_rails/spec/rails_template/app/controllers/application_controller.rb +10 -0
- data/sunspot_rails/spec/rails_template/app/controllers/posts_controller.rb +6 -0
- data/sunspot_rails/spec/rails_template/app/models/author.rb +10 -0
- data/sunspot_rails/spec/rails_template/app/models/blog.rb +14 -0
- data/sunspot_rails/spec/rails_template/app/models/location.rb +3 -0
- data/sunspot_rails/spec/rails_template/app/models/photo_post.rb +2 -0
- data/sunspot_rails/spec/rails_template/app/models/post.rb +13 -0
- data/sunspot_rails/spec/rails_template/app/models/post_with_auto.rb +12 -0
- data/sunspot_rails/spec/rails_template/app/models/post_with_default_scope.rb +13 -0
- data/sunspot_rails/spec/rails_template/config/boot.rb +127 -0
- data/sunspot_rails/spec/rails_template/config/preinitializer.rb +22 -0
- data/sunspot_rails/spec/rails_template/config/routes.rb +9 -0
- data/sunspot_rails/spec/rails_template/config/sunspot.yml +24 -0
- data/sunspot_rails/spec/rails_template/db/schema.rb +27 -0
- data/sunspot_rails/spec/request_lifecycle_spec.rb +61 -0
- data/sunspot_rails/spec/schema.rb +27 -0
- data/sunspot_rails/spec/searchable_spec.rb +12 -0
- data/sunspot_rails/spec/server_spec.rb +33 -0
- data/sunspot_rails/spec/session_spec.rb +57 -0
- data/sunspot_rails/spec/shared_examples/indexed_after_save.rb +8 -0
- data/sunspot_rails/spec/shared_examples/not_indexed_after_save.rb +8 -0
- data/sunspot_rails/spec/spec_helper.rb +48 -0
- data/sunspot_rails/spec/stub_session_proxy_spec.rb +122 -0
- data/sunspot_rails/sunspot_rails.gemspec +43 -0
- data/sunspot_rails/tmp/.gitkeep +0 -0
- data/sunspot_solr/Gemfile +3 -0
- data/sunspot_solr/README.rdoc +24 -0
- data/sunspot_solr/bin/sunspot-installer +20 -0
- data/sunspot_solr/bin/sunspot-solr +80 -0
- data/sunspot_solr/lib/sunspot/solr/installer/config_installer.rb +46 -0
- data/sunspot_solr/lib/sunspot/solr/installer/task_helper.rb +13 -0
- data/sunspot_solr/lib/sunspot/solr/installer.rb +25 -0
- data/sunspot_solr/lib/sunspot/solr/java.rb +10 -0
- data/sunspot_solr/lib/sunspot/solr/railtie.rb +15 -0
- data/sunspot_solr/lib/sunspot/solr/server.rb +223 -0
- data/sunspot_solr/lib/sunspot/solr/tasks.rb +49 -0
- data/sunspot_solr/lib/sunspot_solr.rb +5 -0
- data/sunspot_solr/solr/README.txt +42 -0
- data/sunspot_solr/solr/etc/jetty.xml +219 -0
- data/sunspot_solr/solr/etc/webdefault.xml +379 -0
- data/sunspot_solr/solr/lib/jetty-6.1.26-patched-JETTY-1340.jar +0 -0
- data/sunspot_solr/solr/lib/jetty-util-6.1.26-patched-JETTY-1340.jar +0 -0
- data/sunspot_solr/solr/lib/jsp-2.1/ant-1.6.5.jar +0 -0
- data/sunspot_solr/solr/lib/jsp-2.1/core-3.1.1.jar +0 -0
- data/sunspot_solr/solr/lib/jsp-2.1/jsp-2.1.jar +0 -0
- data/sunspot_solr/solr/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
- data/sunspot_solr/solr/lib/servlet-api-2.5-20081211.jar +0 -0
- data/sunspot_solr/solr/solr/.gitignore +1 -0
- data/sunspot_solr/solr/solr/README.txt +54 -0
- data/sunspot_solr/solr/solr/conf/admin-extra.html +31 -0
- data/sunspot_solr/solr/solr/conf/elevate.xml +36 -0
- data/sunspot_solr/solr/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/sunspot_solr/solr/solr/conf/protwords.txt +21 -0
- data/sunspot_solr/solr/solr/conf/schema.xml +250 -0
- data/sunspot_solr/solr/solr/conf/scripts.conf +24 -0
- data/sunspot_solr/solr/solr/conf/solrconfig.xml +934 -0
- data/sunspot_solr/solr/solr/conf/spellings.txt +2 -0
- data/sunspot_solr/solr/solr/conf/stopwords.txt +58 -0
- data/sunspot_solr/solr/solr/conf/synonyms.txt +31 -0
- data/sunspot_solr/solr/solr/conf/xslt/example.xsl +132 -0
- data/sunspot_solr/solr/solr/conf/xslt/example_atom.xsl +67 -0
- data/sunspot_solr/solr/solr/conf/xslt/example_rss.xsl +66 -0
- data/sunspot_solr/solr/solr/conf/xslt/luke.xsl +337 -0
- data/sunspot_solr/solr/start.jar +0 -0
- data/sunspot_solr/solr/webapps/solr.war +0 -0
- data/sunspot_solr/spec/server_spec.rb +98 -0
- data/sunspot_solr/spec/spec_helper.rb +18 -0
- data/sunspot_solr/sunspot_solr.gemspec +37 -0
- data/tools/gem_tasks.rb +69 -0
- metadata +353 -343
- data/lib/sunspot/search/field_group.rb +0 -46
- data/lib/sunspot/version.rb +0 -3
- data/spec/api/adapters_spec.rb +0 -33
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require File.expand_path('spec_helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
describe Sunspot::Adapters::InstanceAdapter do
|
4
|
+
it "finds adapter by superclass" do
|
5
|
+
Sunspot::Adapters::InstanceAdapter::for(Model).should be(AbstractModelInstanceAdapter)
|
6
|
+
end
|
7
|
+
|
8
|
+
it "finds adapter by mixin" do
|
9
|
+
Sunspot::Adapters::InstanceAdapter::for(MixModel).should be(MixInModelInstanceAdapter)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'throws NoAdapterError if anonymous module passed in' do
|
13
|
+
lambda do
|
14
|
+
Sunspot::Adapters::InstanceAdapter::for(Module.new)
|
15
|
+
end.should raise_error(Sunspot::NoAdapterError)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe Sunspot::Adapters::DataAccessor do
|
20
|
+
it "finds adapter by superclass" do
|
21
|
+
Sunspot::Adapters::DataAccessor::for(Model).should be(AbstractModelDataAccessor)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "finds adapter by mixin" do
|
25
|
+
Sunspot::Adapters::DataAccessor::for(MixModel).should be(MixInModelDataAccessor)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'throws NoAdapterError if anonymous module passed in' do
|
29
|
+
lambda do
|
30
|
+
Sunspot::Adapters::DataAccessor::for(Module.new)
|
31
|
+
end.should raise_error(Sunspot::NoAdapterError)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe Sunspot::Adapters::Registry do
|
36
|
+
let(:registry){ Sunspot::Adapters::Registry.new }
|
37
|
+
let(:abstractclass_accessor){ Sunspot::Adapters::DataAccessor::for(AbstractModel) }
|
38
|
+
let(:superclass_accessor){ Sunspot::Adapters::DataAccessor::for(Model) }
|
39
|
+
let(:mixin_accessor){ Sunspot::Adapters::DataAccessor::for(MixModel) }
|
40
|
+
|
41
|
+
it "registers and retrieves a data accessor for abstractclass" do
|
42
|
+
registry.retrieve(AbstractModel).should be_a(abstractclass_accessor)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "registers and retrieves a data accessor for superclass" do
|
46
|
+
registry.retrieve(Model).should be_a(superclass_accessor)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "registers and retrieves a data accessor for mixin" do
|
50
|
+
registry.retrieve(MixModel).should be_a(mixin_accessor)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "injects inherited attributes" do
|
54
|
+
AbstractModelDataAccessor.any_instance.stub(:inherited_attributes).and_return([:to_be_injected])
|
55
|
+
in_registry_data_accessor = registry.retrieve(AbstractModel)
|
56
|
+
in_registry_data_accessor.to_be_injected = "value"
|
57
|
+
registry.retrieve(Model).to_be_injected.should == "value"
|
58
|
+
end
|
59
|
+
|
60
|
+
it "not overrides inherited attributes" do
|
61
|
+
AbstractModelDataAccessor.any_instance.stub(:inherited_attributes).and_return([:to_be_injected])
|
62
|
+
parent_data_accessor = registry.retrieve(AbstractModel)
|
63
|
+
current_data_accessor = registry.retrieve(Model)
|
64
|
+
parent_data_accessor.to_be_injected = "value"
|
65
|
+
current_data_accessor.to_be_injected = "safe-value"
|
66
|
+
registry.retrieve(Model).to_be_injected.should == "safe-value"
|
67
|
+
end
|
68
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -186,4 +186,16 @@ shared_examples_for "query with connective scope" do
|
|
186
186
|
end
|
187
187
|
connection.should_not have_last_search_including(:fq, '')
|
188
188
|
end
|
189
|
+
|
190
|
+
it 'creates a conjunction of in_radius queries' do
|
191
|
+
search do
|
192
|
+
any_of do
|
193
|
+
with(:coordinates_new).in_radius(23, -46, 100)
|
194
|
+
with(:coordinates_new).in_radius(42, 56, 50)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
connection.should have_last_search_including(
|
198
|
+
:fq, '(_query_:"{!geofilt sfield=coordinates_new_ll pt=23,-46 d=100}" OR _query_:"{!geofilt sfield=coordinates_new_ll pt=42,56 d=50}")'
|
199
|
+
)
|
200
|
+
end
|
189
201
|
end
|
File without changes
|
File without changes
|
@@ -89,14 +89,7 @@ shared_examples_for "facetable query" do
|
|
89
89
|
end
|
90
90
|
connection.should have_last_search_with(:"f.title_ss.facet.prefix" => 'Test')
|
91
91
|
end
|
92
|
-
|
93
|
-
it 'escapes the facet prefix' do
|
94
|
-
search do
|
95
|
-
facet :title, :prefix => 'Test Title'
|
96
|
-
end
|
97
|
-
connection.should have_last_search_with(:"f.title_ss.facet.prefix" => 'Test\ Title')
|
98
|
-
end
|
99
|
-
|
92
|
+
|
100
93
|
it 'sends a query facet for :any extra' do
|
101
94
|
search do
|
102
95
|
facet :category_ids, :extra => :any
|
@@ -294,6 +287,13 @@ shared_examples_for "facetable query" do
|
|
294
287
|
connection.should have_last_search_with(:"f.average_rating_ft.facet.range.gap" => "1")
|
295
288
|
end
|
296
289
|
|
290
|
+
it 'sets the include if one is specified' do
|
291
|
+
search do |query|
|
292
|
+
query.facet :average_rating, :range => @range, :include => :edge
|
293
|
+
end
|
294
|
+
connection.should have_last_search_with(:"f.average_rating_ft.facet.range.include" => "edge")
|
295
|
+
end
|
296
|
+
|
297
297
|
it 'does not allow date faceting on a non-continuous field' do
|
298
298
|
lambda do
|
299
299
|
search do |query|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -43,10 +43,26 @@ describe 'hits', :type => :search do
|
|
43
43
|
stub_results(*posts)
|
44
44
|
search = session.search(Post)
|
45
45
|
hits, results = [], []
|
46
|
+
|
46
47
|
search.each_hit_with_result do |hit, result|
|
47
48
|
hits << hit
|
48
49
|
results << result
|
49
50
|
end
|
51
|
+
|
52
|
+
hits.should have(2).hits
|
53
|
+
results.should have(2).results
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'should provide an Enumerator over hits with instances' do
|
57
|
+
posts = Array.new(2) { Post.new }
|
58
|
+
stub_results(*posts)
|
59
|
+
search = session.search(Post)
|
60
|
+
hits, results = [], []
|
61
|
+
search.each_hit_with_result.with_index do |(hit, result), index|
|
62
|
+
hit.should be_kind_of(Sunspot::Search::Hit)
|
63
|
+
result.should be_kind_of(Post)
|
64
|
+
index.should be_kind_of(Integer)
|
65
|
+
end
|
50
66
|
end
|
51
67
|
|
52
68
|
it 'should hydrate all hits when an instance is requested from a hit' do
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -9,6 +9,11 @@ describe Sunspot::SessionProxy::Retry5xxSessionProxy do
|
|
9
9
|
Sunspot.session = @proxy
|
10
10
|
end
|
11
11
|
|
12
|
+
after :each do
|
13
|
+
Sunspot::Session.connection_class = nil
|
14
|
+
Sunspot.reset!(true)
|
15
|
+
end
|
16
|
+
|
12
17
|
class FakeRSolrErrorHttp < RSolr::Error::Http
|
13
18
|
def backtrace
|
14
19
|
[]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -4,11 +4,11 @@ describe Sunspot do
|
|
4
4
|
|
5
5
|
describe "setup" do
|
6
6
|
it "should register the class in Sunspot.searchable" do
|
7
|
-
Sunspot.setup(
|
7
|
+
Sunspot.setup(User) do
|
8
8
|
text :name
|
9
9
|
end
|
10
10
|
Sunspot.searchable.should_not be_empty
|
11
|
-
Sunspot.searchable.should include(
|
11
|
+
Sunspot.searchable.should include(User)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -156,6 +156,32 @@ describe 'search faceting' do
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
+
context 'prefix escaping' do
|
160
|
+
before do
|
161
|
+
Sunspot.remove_all
|
162
|
+
["title1", "title2", "title with spaces 1", "title with spaces 2", "title/with/slashes/1", "title/with/slashes/2"].each do |value|
|
163
|
+
Sunspot.index(Post.new(:title => value, :blog_id => 1))
|
164
|
+
end
|
165
|
+
Sunspot.commit
|
166
|
+
end
|
167
|
+
|
168
|
+
it 'should limit facet values by a prefix with spaces' do
|
169
|
+
search = Sunspot.search(Post) do
|
170
|
+
with :blog_id, 1
|
171
|
+
facet :title, :prefix => 'title '
|
172
|
+
end
|
173
|
+
search.facet(:title).rows.map { |row| row.value }.sort.should == ["title with spaces 1", "title with spaces 2"]
|
174
|
+
end
|
175
|
+
|
176
|
+
it 'should limit facet values by a prefix with slashes' do
|
177
|
+
search = Sunspot.search(Post) do
|
178
|
+
with :blog_id, 1
|
179
|
+
facet :title, :prefix => 'title/'
|
180
|
+
end
|
181
|
+
search.facet(:title).rows.map { |row| row.value }.sort.should == ["title/with/slashes/1", "title/with/slashes/2"]
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
159
185
|
context 'multiselect faceting' do
|
160
186
|
before do
|
161
187
|
Sunspot.remove_all
|
File without changes
|
@@ -25,6 +25,17 @@ describe "geospatial search" do
|
|
25
25
|
|
26
26
|
results.should_not include(@post)
|
27
27
|
end
|
28
|
+
|
29
|
+
it "allows conjunction queries" do
|
30
|
+
results = Sunspot.search(Post) {
|
31
|
+
any_of do
|
32
|
+
with(:coordinates_new).in_radius(32, -68, 1)
|
33
|
+
with(:coordinates_new).in_radius(35, 68, 1)
|
34
|
+
end
|
35
|
+
}.results
|
36
|
+
|
37
|
+
results.should include(@post)
|
38
|
+
end
|
28
39
|
end
|
29
40
|
|
30
41
|
describe "filtering by bounding box" do
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -8,6 +8,7 @@ class AbstractModelInstanceAdapter < Sunspot::Adapters::InstanceAdapter
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class AbstractModelDataAccessor < Sunspot::Adapters::DataAccessor
|
11
|
+
attr_accessor :to_be_injected
|
11
12
|
end
|
12
13
|
|
13
14
|
Sunspot::Adapters::InstanceAdapter.register(AbstractModelInstanceAdapter, AbstractModel)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
@@ -0,0 +1,74 @@
|
|
1
|
+
== 2.0.0
|
2
|
+
* Finds orphaned objects in batches to avoid excessive memory use (Peer Allan)
|
3
|
+
* Default batch size can be specified by setting `Sunspot.config.indexing.default_batch_size`
|
4
|
+
(Peer Allan)
|
5
|
+
* Explanation of `progress_bar` is written to stdout instead of stderr (Matt Gornick)
|
6
|
+
* Fixes deprecated behavior of using InstanceMethods module with
|
7
|
+
ActiveSupport::Concern (Everton J. Carpes)
|
8
|
+
|
9
|
+
== 1.3.0 2011-11-26
|
10
|
+
* `Model.index` correctly uses `:first_id` option (Hamza Khan-Cheema)
|
11
|
+
* Solr request performance is instrumented in Rails (Paco Guzmán)
|
12
|
+
* Reindexing tasks display a progress bar if `progress_bar` gem is available (Paul Carey)
|
13
|
+
* Deprecated Rails syntax is removed from `Sunspot::Rails::Searchable` (Steve Schwartz)
|
14
|
+
* Deprecated syntax is removed from rake tasks (Huned Botee)
|
15
|
+
* `sunspot:reindex` rake task correctly handles namespaced models (João Gradim)
|
16
|
+
* `bind_address` parameter can be specified in `sunspot.yml` to bind Solr to a
|
17
|
+
specific interface (Sylvain Utard)
|
18
|
+
* `disabled` parameter can be specified in `sunspot.yml` to stub out the
|
19
|
+
connection to Solr (David B)
|
20
|
+
|
21
|
+
== 1.2.1 2010-12-28
|
22
|
+
* Decreased default reindexing batch size from 500 to 50
|
23
|
+
|
24
|
+
== 1.2.0 2010-12-28
|
25
|
+
* Compatible with both Rails 2 and Rails 3
|
26
|
+
* Configure Sunspot with a SOLR_URL or WEBSOLR_URL environment variable, also
|
27
|
+
provide a default port based on Rails.env.
|
28
|
+
* Fix the 'Anonymous modules' ArgumentError for Ruby 1.9.2 and Rails 2.3
|
29
|
+
* Fix SQL's ambiguous ID issue when tables are joined
|
30
|
+
|
31
|
+
== 1.1.0 2010-04-01
|
32
|
+
* Added include option to searchable options to allow definition of eager
|
33
|
+
loading associations when indexing
|
34
|
+
|
35
|
+
== 1.0.4 2010-03-19
|
36
|
+
* Fix StubSessionProxy to match new internal API
|
37
|
+
|
38
|
+
== 1.0.2 2010-03-11
|
39
|
+
* Allow use of ActiveRecord object for coordinates extraction
|
40
|
+
* Works with non-standard primary keys
|
41
|
+
* Add :include, :select options to Searchable::search()
|
42
|
+
* Allow specification of min_memory and max_memory in config/sunspot.yml
|
43
|
+
* Searchable now more considerate of model namespaces
|
44
|
+
|
45
|
+
== 1.0.1 2010-03-05
|
46
|
+
* Fix Solr logging compatibility with RSolr 0.12.1
|
47
|
+
|
48
|
+
== 1.0.0 2010-03-03
|
49
|
+
* Sunspot::Rails::Server subclasses Sunspot::Server; no longer needs to shell out
|
50
|
+
* Use Sunspot built-in session proxies in Sunspot::Rails
|
51
|
+
* Sunspot::Rails adapter compatible with assumed inconsistency
|
52
|
+
* Use session proxy for disconnecting Sunspot in specs
|
53
|
+
* Allow specification of first ID for reindex batches.
|
54
|
+
* Log Solr requests in Rails logger
|
55
|
+
* Use class_inheritable_hash for sunspot_options
|
56
|
+
* Add `index` class method, which is like `reindex` but doesn't clear first
|
57
|
+
* Rename sunspot:solr:reindex to sunspot:reindex
|
58
|
+
* Use Sunspot::Installer to bootstrap Rails Solr home
|
59
|
+
|
60
|
+
== 0.10.7
|
61
|
+
* Added Sunspot::Rails::Server class to start/stop/run/bootstrap the solr server
|
62
|
+
* Added log_level key to sunspot.yml, see java docs for valid values (http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/Level.html)
|
63
|
+
* Added log_file key to sunspot.yml. This defaults to RAILS_ROOT/log/solr_<environment>.log.
|
64
|
+
* Added support for localsolr in sunspot_rails. You can add custom extension.jar files to your Rails.root/solr/lib directory
|
65
|
+
* Added an option to not reindex an object when certain columns have changed.
|
66
|
+
|
67
|
+
== 0.10.6
|
68
|
+
* Added script/generate sunspot support to generate the required sunspot.yml
|
69
|
+
file [Brandon Keepers]
|
70
|
+
|
71
|
+
== 0.10.5
|
72
|
+
* Added a auto_commit_after_request option to sunspot.yml. Sunspot will not
|
73
|
+
automatically commit any changes in solr if you set this value to false.
|
74
|
+
Strongly encouraged for production environment.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
2
|
+
a copy of this software and associated documentation files (the
|
3
|
+
'Software'), to deal in the Software without restriction, including
|
4
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
5
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
6
|
+
permit persons to whom the Software is furnished to do so, subject to
|
7
|
+
the following conditions:
|
8
|
+
|
9
|
+
The above copyright notice and this permission notice shall be
|
10
|
+
included in all copies or substantial portions of the Software.
|
11
|
+
|
12
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
13
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
14
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
15
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
16
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
17
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
18
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Mat Brown
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|