Permalink
Browse files

git import of acts_as_solr

  • Loading branch information...
0 parents commit be5b95d9d73b875e35b8f01bcd94e83ad4c3be05 Thiago Jackiw committed May 3, 2008
Showing with 9,083 additions and 0 deletions.
  1. +217 −0 CHANGE_LOG
  2. +19 −0 LICENSE
  3. +44 −0 README
  4. +25 −0 Rakefile
  5. +8 −0 TESTING_THE_PLUGIN
  6. +16 −0 config/environment.rb
  7. +10 −0 config/solr.yml
  8. +21 −0 init.rb
  9. +11 −0 install.rb
  10. +59 −0 lib/acts_as_solr.rb
  11. +172 −0 lib/acts_methods.rb
  12. +158 −0 lib/class_methods.rb
  13. +76 −0 lib/common_methods.rb
  14. +61 −0 lib/deprecation.rb
  15. +139 −0 lib/instance_methods.rb
  16. +127 −0 lib/parser_methods.rb
  17. +64 −0 lib/search_results.rb
  18. +21 −0 lib/solr.rb
  19. +162 −0 lib/solr/connection.rb
  20. +73 −0 lib/solr/document.rb
  21. +13 −0 lib/solr/exception.rb
  22. +39 −0 lib/solr/field.rb
  23. +19 −0 lib/solr/importer.rb
  24. +26 −0 lib/solr/importer/array_mapper.rb
  25. +38 −0 lib/solr/importer/delimited_file_source.rb
  26. +27 −0 lib/solr/importer/hpricot_mapper.rb
  27. +51 −0 lib/solr/importer/mapper.rb
  28. +43 −0 lib/solr/importer/solr_source.rb
  29. +35 −0 lib/solr/importer/xpath_mapper.rb
  30. +52 −0 lib/solr/indexer.rb
  31. +24 −0 lib/solr/request.rb
  32. +63 −0 lib/solr/request/add_document.rb
  33. +36 −0 lib/solr/request/base.rb
  34. +31 −0 lib/solr/request/commit.rb
  35. +50 −0 lib/solr/request/delete.rb
  36. +46 −0 lib/solr/request/dismax.rb
  37. +22 −0 lib/solr/request/index_info.rb
  38. +21 −0 lib/solr/request/optimize.rb
  39. +36 −0 lib/solr/request/ping.rb
  40. +58 −0 lib/solr/request/select.rb
  41. +107 −0 lib/solr/request/standard.rb
  42. +23 −0 lib/solr/request/update.rb
  43. +24 −0 lib/solr/response.rb
  44. +17 −0 lib/solr/response/add_document.rb
  45. +42 −0 lib/solr/response/base.rb
  46. +17 −0 lib/solr/response/commit.rb
  47. +13 −0 lib/solr/response/delete.rb
  48. +8 −0 lib/solr/response/dismax.rb
  49. +26 −0 lib/solr/response/index_info.rb
  50. +14 −0 lib/solr/response/optimize.rb
  51. +28 −0 lib/solr/response/ping.rb
  52. +42 −0 lib/solr/response/ruby.rb
  53. +64 −0 lib/solr/response/standard.rb
  54. +42 −0 lib/solr/response/xml.rb
  55. +27 −0 lib/solr/solrtasks.rb
  56. +34 −0 lib/solr/util.rb
  57. +47 −0 lib/solr/xml.rb
  58. +13 −0 lib/solr_fixtures.rb
  59. +18 −0 lib/tasks/database.rake
  60. +58 −0 lib/tasks/solr.rake
  61. +7 −0 lib/tasks/test.rake
  62. +126 −0 schema.xml
  63. +562 −0 solr/CHANGES.txt
  64. +608 −0 solr/LICENSE.txt
  65. +57 −0 solr/NOTICE.txt
  66. +206 −0 solr/etc/jetty.xml
  67. +379 −0 solr/etc/webdefault.xml
  68. BIN solr/lib/commons-codec-1.3.jar
  69. BIN solr/lib/commons-csv-0.1-SNAPSHOT.jar
  70. BIN solr/lib/commons-fileupload-1.2.jar
  71. BIN solr/lib/commons-io-1.2.jar
  72. BIN solr/lib/easymock.jar
  73. BIN solr/lib/jetty-6.1.3.jar
  74. BIN solr/lib/jetty-util-6.1.3.jar
  75. BIN solr/lib/jsp-2.1/ant-1.6.5.jar
  76. BIN solr/lib/jsp-2.1/core-3.1.1.jar
  77. BIN solr/lib/jsp-2.1/jsp-2.1.jar
  78. BIN solr/lib/jsp-2.1/jsp-api-2.1.jar
  79. BIN solr/lib/lucene-analyzers-2007-05-20_00-04-53.jar
  80. BIN solr/lib/lucene-core-2007-05-20_00-04-53.jar
  81. BIN solr/lib/lucene-highlighter-2007-05-20_00-04-53.jar
  82. BIN solr/lib/lucene-snowball-2007-05-20_00-04-53.jar
  83. BIN solr/lib/lucene-spellchecker-2007-05-20_00-04-53.jar
  84. BIN solr/lib/servlet-api-2.4.jar
  85. BIN solr/lib/servlet-api-2.5-6.1.3.jar
  86. BIN solr/lib/xpp3-1.1.3.4.O.jar
  87. +52 −0 solr/solr/README.txt
  88. +176 −0 solr/solr/bin/abc
  89. +176 −0 solr/solr/bin/abo
  90. +108 −0 solr/solr/bin/backup
  91. +142 −0 solr/solr/bin/backupcleaner
  92. +128 −0 solr/solr/bin/commit
  93. +129 −0 solr/solr/bin/optimize
  94. +129 −0 solr/solr/bin/readercycle
  95. +77 −0 solr/solr/bin/rsyncd-disable
  96. +76 −0 solr/solr/bin/rsyncd-enable
  97. +145 −0 solr/solr/bin/rsyncd-start
  98. +105 −0 solr/solr/bin/rsyncd-stop
  99. +83 −0 solr/solr/bin/scripts-util
  100. +148 −0 solr/solr/bin/snapcleaner
  101. +168 −0 solr/solr/bin/snapinstaller
  102. +248 −0 solr/solr/bin/snappuller
  103. +77 −0 solr/solr/bin/snappuller-disable
  104. +77 −0 solr/solr/bin/snappuller-enable
  105. +109 −0 solr/solr/bin/snapshooter
  106. +31 −0 solr/solr/conf/admin-extra.html
  107. +21 −0 solr/solr/conf/protwords.txt
  108. +126 −0 solr/solr/conf/schema.xml
  109. +24 −0 solr/solr/conf/scripts.conf
  110. +458 −0 solr/solr/conf/solrconfig.xml
  111. +57 −0 solr/solr/conf/stopwords.txt
  112. +31 −0 solr/solr/conf/synonyms.txt
  113. +132 −0 solr/solr/conf/xslt/example.xsl
  114. +63 −0 solr/solr/conf/xslt/example_atom.xsl
  115. +62 −0 solr/solr/conf/xslt/example_rss.xsl
  116. BIN solr/start.jar
  117. BIN solr/webapps/solr.war
  118. +2 −0 test/config/solr.yml
  119. +10 −0 test/db/connections/mysql/connection.rb
  120. +8 −0 test/db/connections/sqlite/connection.rb
  121. +13 −0 test/db/migrate/001_create_books.rb
  122. +12 −0 test/db/migrate/002_create_movies.rb
  123. +11 −0 test/db/migrate/003_create_categories.rb
  124. +15 −0 test/db/migrate/004_create_electronics.rb
  125. +12 −0 test/db/migrate/005_create_authors.rb
  126. +9 −0 test/db/migrate/006_create_postings.rb
  127. BIN test/db/test.db
  128. +9 −0 test/fixtures/authors.yml
  129. +11 −0 test/fixtures/books.yml
  130. +7 −0 test/fixtures/categories.yml
  131. +41 −0 test/fixtures/db_definitions/mysql.sql
  132. +39 −0 test/fixtures/electronics.yml
  133. +9 −0 test/fixtures/movies.yml
  134. +10 −0 test/fixtures/postings.yml
  135. +10 −0 test/models/author.rb
  136. +10 −0 test/models/book.rb
  137. +8 −0 test/models/category.rb
  138. +20 −0 test/models/electronic.rb
  139. +17 −0 test/models/movie.rb
  140. +11 −0 test/models/posting.rb
  141. +36 −0 test/test_helper.rb
  142. +375 −0 test/unit/acts_as_solr_test.rb
  143. +37 −0 test/unit/association_indexing_test.rb
  144. +122 −0 test/unit/faceted_search_test.rb
  145. +39 −0 test/unit/multi_solr_search_test.rb
@@ -0,0 +1,217 @@
+== CHANGE_LOG
+=== 06-18-2007: Version 0.9
+<b>NEW</b>:: Added the option :scores when doing a search. If set to true this will return the score as a 'solr_score' attribute or each one of the instances found
+ books = Book.find_by_solr 'ruby OR splinter', :scores => true
+ books.records.first.solr_score
+ => 1.21321397
+ books.records.last.solr_score
+ => 0.12321548
+
+<b>NEW</b>:: Major change on the way the results returned are accessed.
+ books = Book.find_by_solr 'ruby'
+ # the above will return a SearchResults class with 4 methods:
+ # docs|results|records: will return an array of records found
+ #
+ # books.records.is_a?(Array)
+ # => true
+ #
+ # total|num_found|total_hits: will return the total number of records found
+ #
+ # books.total
+ # => 2
+ #
+ # facets: will return the facets when doing a faceted search
+ #
+ # max_score|highest_score: returns the highest score found
+ #
+ # books.max_score
+ # => 1.3213213
+
+<b>NEW</b>:: Integrating acts_as_solr to use solr-ruby as the 'backend'. Integration based on the patch submitted by Erik Hatcher
+<b>NEW</b>:: Re-factoring rebuild_solr_index to allow adds to be done in batch; and if a finder block is given, it will be called to retrieve the items to index. (thanks Daniel E.)
+<b>NEW</b>:: Adding the option to specify the port Solr should start when using rake solr:start
+ rake solr:start RAILS_ENV=your_env PORT=XX
+
+<b>NEW</b>:: Adding deprecation warning for the :background configuration option. It will no longer be updated.
+<b>NEW</b>:: Adding support for models that use a primary key other than integer
+ class Posting < ActiveRecord::Base
+ set_primary_key 'guid' #string
+ #make sure you set the :primary_key_field => 'pk_s' if you wish to use a string field as the primary key
+ acts_as_solr({},{:primary_key_field => 'pk_s'})
+ end
+
+<b>FIX</b>:: Disabling of storing most fields. Storage isn't useful for acts_as_solr in any field other than the pk and id fields. It just takes up space and time. (thanks Daniel E.)
+<b>FIX</b>:: Re-factoring code submitted by Daniel E.
+<b>NEW</b>:: Adding an :auto_commit option that will only send the commit command to Solr if it is set to true
+ class Author < ActiveRecord::Base
+ acts_as_solr :auto_commit => false
+ end
+
+<b>FIX</b>:: Fixing bug on rake's test task
+<b>FIX</b>:: Making acts_as_solr's Post class compatible with Solr 1.2 (thanks Si)
+<b>NEW</b>:: Adding Solr 1.2
+<b>FIX</b>:: Removing Solr 1.1
+<b>NEW</b>:: Adding a conditional :if option to the acts_as_solr call. It behaves the same way ActiveRecord's :if argument option does.
+ class Electronic < ActiveRecord::Base
+ acts_as_solr :if => proc{|record| record.is_active?}
+ end
+
+<b>NEW</b>:: Adding fixtures to Solr index when using rake db:fixtures:load
+<b>FIX</b>:: Fixing boost warning messages
+<b>FIX</b>:: Fixing bug when adding a facet to a field that contains boost
+<b>NEW</b>:: Deprecating find_with_facet and combining functionality with find_by_solr
+<b>NEW</b>:: Adding the option to :exclude_fields when indexing a model
+ class User < ActiveRecord::Base
+ acts_as_solr :exclude_fields => [:password, :login, :credit_card_number]
+ end
+
+<b>FIX</b>:: Fixing branch bug on older ruby version
+<b>NEW</b>:: Adding boost support for fields and documents being indexed:
+ class Electronic < ActiveRecord::Base
+ # You can add boosting on a per-field basis or on the entire document
+ acts_as_solr :fields => [{:price => {:boost => 5.0}}], :boost => 5.0
+ end
+
+<b>FIX</b>:: Fixed the acts_as_solr limitation to only accept test|development|production environments.
+
+=== 05-16-2007: Version 0.8.5
+<b>FIX</b>:: There's no need to specify the :field_types anymore when doing a search in a model that specifies a field type for a field.
+<b>FIX</b>:: Better handling of nil values from indexed fields. Solr complained when indexing fields with field type and the field values being passed as nils.
+<b>NEW</b>:: Adding Solr sort (order by) option to the search query (thanks Kevin Hunt)
+<b>FIX</b>:: Applying patch suggested for increasing the Solr commit speed (thanks Mourad Hammiche)
+<b>FIX</b>:: Updated documentation
+
+=== 05-10-2007: Version 0.8
+<b>NEW</b>: New video tutorial
+<b>NEW</b>: Faceted search has been implemented and its possible to 'drill-down' on the facets
+<b>NEW</b>: New rake tasks you can use to start/stop the solr server in test, development and production environments: (thanks Matt Clark)
+ rake solr:start|stop RAILS_ENV=test|development|production (defaults to development if none given)
+
+<b>NEW</b>: Changes to the plugin's test framework and it now supports Sqlite as well (thanks Matt Clark)
+<b>FIX</b>: Patch applied (thanks Micah) that allows one to have multiple solr instances in the same servlet
+<b>FIX</b>: Patch applied (thanks Micah) that allows indexing of STIs
+<b>FIX</b>: Patch applied (thanks Gordon) that allows the plugin to use a table's primary key different than 'id'
+<b>FIX</b>: Returning empty array instead of empty strings when no records are found
+<b>FIX</b>: Problem with unit tests failing due to order of the tests and speed of the commits
+
+=== 02-16-2007: Version 0.7
+<b>NEW</b>: You can now specify the field types when indexing and searching if
+you'd like to preserve its original type:
+
+<b>Indexing</b>
+
+Each field passed can also be a hash with the value being a field type
+
+ class Electronic < ActiveRecord::Base
+ acts_as_solr :fields => [{:price => :range_float}, {:current_time => :date}]
+ def current_time
+ Time.now
+ end
+ end
+
+<b>Searching</b>
+ Electronic.find_by_solr "ipod AND price:[* TO 59.99]",
+ :field_types => [{:price => :range_float}]
+
+The field types accepted are:
+<em>:float</em>:: Index the field value as a float (ie.: 12.87)
+<em>:integer</em>:: Index the field value as an integer (ie.: 31)
+<em>:boolean</em>:: Index the field value as a boolean (ie.: true/false)
+<em>:date</em>:: Index the field value as a date (ie.: Wed Nov 15 23:13:03 PST 2006)
+<em>:string</em>:: Index the field value as a text string, not applying the same indexing filters as a regular text field
+<em>:range_integer</em>:: Index the field value for integer range queries (ie.:[5 TO 20])
+<em>:range_float</em>:: Index the field value for float range queries (ie.:[14.56 TO 19.99])
+
+<b>Setting the field type preserves its original type when indexed</b>
+
+<b>FIX</b>: Fixing sorting bug. Thanks for the catch Laurel
+
+<b>FIX</b>: Fixing small bug when installing the plugin
+
+<b>NEW</b>: Adding the :additional_fields option to the acts_as_solr method
+
+=== 02-05-2007: Version 0.6.5
+<b>NEW</b>:: Added multi-model search, which can be used to execute a search across multiple models:
+ Book.multi_solr_search "Napoleon OR Tom", :models => [Movie]
+
+====options:
+Accepts the same options as find_by_solr plus:
+models:: The additional models you'd like to include in the search
+results_format:: Specify the format of the results found
+ :objects :: Will return an array with the results being objects (default). Example:
+ Book.multi_solr_search "Napoleon OR Tom", :models => [Movie], :results_format => :objects
+ :ids :: Will return an array with the ids of each entry found. Example:
+ Book.multi_solr_search "Napoleon OR Tom", :models => [Movie], :results_format => :ids
+ => [{"id" => "Movie:1"},{"id" => Book:1}]
+ Where the value of each array is as Model:instance_id
+
+=== 02-03-2007: Version 0.6
+<b>NEW</b>:: Added basic faceted search functionality for indexing and searching:
+
+==== Indexing:
+
+ class Electronic < ActiveRecord::Base
+ acts_as_solr :facets => [:category, :manufacturer]
+ end
+
+==== Searching:
+
+ Electronic.find_with_facet "memory", :facets => {:fields =>[:category]}
+
+=== 01-15-2007: Version 0.5
+<b>NEW</b>:: Added model association indexing, which means you can include any :has_one, :has_many,
+:belongs_to and :has_and_belongs_to_many association to be indexed:
+
+ class Category < ActiveRecord::Base
+ has_many :books
+ acts_as_solr :include => [:books]
+ end
+
+ class Book < ActiveRecord::Base
+ belongs_to :category
+ acts_as_solr :include => [:category]
+ end
+
+=== 01-11-2007:
+<b>NEW</b>:: Added the acts_as_solr's plugin tests
+
+=== 11-07-2006: Version 0.4
+<b>NEW</b>:: Added :background option, which takes and integer value (in minutes) to wait before committing the changes to Solr. This depends on rail_cron being installed. By setting up the background job we prevent the users from having to wait for Solr records to be created, and we keep from updating the index over and over for quickly successive changes. (Rob Kaufman)
+
+=== 11-02-2006: Version 0.3
+<b>NEW</b>:: Added a method (Model.count_by_solr) that returns the total number of documents found based on query passed
+<b>NEW</b>:: Added configuration for production and development environments
+
+=== 10-21-2006: Version 0.2
+<b>PLUGIN</b>
+<b>FIX</b>:: Fixed bug when mixing search-by-field and 'free' search: Model.find_by_solr 'solr AND name:Thiago'
+<b>FIX</b>:: Fixed bug with multi-terms search: Book.find_by_solr 'anteater john'
+<b>FIX</b>:: Fixed bug when including more than one search field: Model.find_by_solr 'name:Thiago AND engine:Solr'
+<b>FIX</b>:: Fixed bug when rebuilding the index, it wasn't saving the data
+<b>NEW</b>:: Added the ability to index custom methods from a model as search fields
+<b>NEW</b>:: Added a search method (Model.find_id_by_solr) that will return only the id of the results
+
+<b>SCHEMA.XML</b>
+<b>NEW</b>:: Added a new field: <field name="default" type="text" indexed="true" stored="true" />
+<b>NEW</b>:: Added a default search field: <defaultSearchField>default</defaultSearchField>
+<b>FIX</b>:: Changed the defaultOperator to AND instead of OR
+
+=== 09-29-2006: Version 0.1
+<b>PLUGIN</b>
+<b>NEW</b>:: Included the option of having a Solr config file inside the rails env.
+<b>NEW</b>:: Added the ability of indexing only certain fields, if you chose to.
+<b>NEW</b>:: Added configuration options
+<b>NEW</b>:: Changed the way the search was done:
+ Old: You were forced the specify the field you wanted to look for
+ ('field:value') and you had to specify a default search field as
+ well, for when you didn't include the 'field' in the search term
+ New: The new search features include:
+ - You don't have to specify a default search field;
+ - You are not forced to include the field name in the search term,
+ unless you choose to search for a specific field ('name:Thiago');
+ - You can pass the starting row and the number of rows per page,
+ which is usefull for pagination
+<b>NEW</b>:: Included a method to rebuild the index files
+
+<b>SCHEMA.XML</b>
+<b>NEW</b>:: Created an optimized version of the config file to better work with this plugin
@@ -0,0 +1,19 @@
+Copyright (c) 2006 Erik Hatcher, Thiago Jackiw
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
@@ -0,0 +1,44 @@
+= acts_as_solr Rails plugin
+This plugin adds full text search capabilities and many other nifty features from Apache's Solr[http://lucene.apache.org/solr/] to any Rails model.
+It was based on the first draft by Erik Hatcher.
+
+== Current Release
+The current stable release is v0.9 and was released on 06-18-2007.
+
+== Changes
+Please refer to the CHANGE_LOG[link:files/CHANGE_LOG.html]
+
+== Installation
+=== Requirements
+* Java Runtime Environment(JRE) 1.5 aka 5.0 (http://www.java.com/en/download/index.jsp)
+
+=== Default
+On your Rails' root directory, just type
+
+ script/plugin install svn://svn.railsfreaks.com/projects/acts_as_solr/trunk
+
+== Basic Usage
+Just include the line below to any of your ActiveRecord models:
+
+ acts_as_solr
+
+Or if you want, you can specify only the fields that should be indexed:
+
+ acts_as_solr :fields => [:name, :author]
+
+Then to find instances of your model, just do:
+
+ Model.find_by_solr(query) #Query is a string representing your query
+
+Please see ActsAsSolr::ActsMethods for a complete info
+
+== Authors
+Erik Hatcher:: First draft
+Thiago Jackiw:: Current developer (tjackiw at gmail dot com)
+
+== Release Information
+Released under the MIT license.
+
+== More info
+http://acts-as-solr.railsfreaks.com
+http://acts_as_solr.railsfreaks.com
@@ -0,0 +1,25 @@
+require 'rubygems'
+require 'rake'
+require 'rake/testtask'
+
+Dir["#{File.dirname(__FILE__)}/lib/tasks/**/*.rake"].sort.each { |ext| load ext }
+
+desc "Default Task"
+task :default => [:test]
+
+desc 'Runs the tests'
+task :test do
+ ENV['RAILS_ENV'] = "test"
+ require File.dirname(__FILE__) + '/config/environment'
+ puts "Using " + DB
+ %x(mysql -u#{MYSQL_USER} < #{File.dirname(__FILE__) + "/test/fixtures/db_definitions/mysql.sql"}) if DB == 'mysql'
+
+ Rake::Task["test:migrate"].invoke
+ Rake::Task[:test_units].invoke
+end
+
+desc "Unit Tests"
+ Rake::TestTask.new('test_units') do |t|
+ t.pattern = "test/unit/*_test.rb"
+ t.verbose = true
+end
@@ -0,0 +1,8 @@
+== How to run unit tests for this plugin:
+To run the acts_as_solr's plugin tests run the following steps:
+- rake solr:start RAILS_ENV=test
+- rake (Accepts the following arguments: DB=sqlite|mysql and MYSQL_USER=user)
+
+== Troubleshooting:
+If for some reason the tests don't run and you get MySQL errors, make sure you edit the MYSQL_USER entry under
+config/environment.rb. It's recommended to create or use a MySQL user with no password.
@@ -0,0 +1,16 @@
+ENV['RAILS_ENV'] = (ENV['RAILS_ENV'] || 'development').dup
+SOLR_PATH = "#{File.dirname(File.expand_path(__FILE__))}/../solr" unless defined? SOLR_PATH
+
+unless defined? SOLR_PORT
+ SOLR_PORT = ENV['PORT'] || case ENV['RAILS_ENV']
+ when 'test' then 8981
+ when 'production' then 8983
+ else 8982
+ end
+end
+
+if ENV['RAILS_ENV'] == 'test'
+ DB = (ENV['DB'] ? ENV['DB'] : 'mysql') unless defined? DB
+ MYSQL_USER = (ENV['MYSQL_USER'].nil? ? 'root' : ENV['MYSQL_USER']) unless defined? MYSQL_USER
+ require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'test', 'db', 'connections', DB, 'connection.rb')
+end
@@ -0,0 +1,10 @@
+# Config file for the acts_as_solr plugin.
+#
+# If you change the host or port number here, make sure you update
+# them in your Solr config file
+
+development:
+ url: http://localhost:8982/solr
+
+production:
+ url: http://localhost:8983/solr
@@ -0,0 +1,21 @@
+# Copyright (c) 2006 Erik Hatcher, Thiago Jackiw
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+require 'acts_as_solr'
@@ -0,0 +1,11 @@
+require 'fileutils'
+
+def install(file)
+ puts "Installing: #{file}"
+ target = File.join(File.dirname(__FILE__), '..', '..', '..', file)
+ FileUtils.cp File.join(File.dirname(__FILE__), file), target
+ dir_to_rename = File.dirname(__FILE__) + '/../trunk'
+ FileUtils.mv(dir_to_rename, File.dirname(__FILE__) + '/../acts_as_solr') if File.exists? dir_to_rename
+end
+
+install File.join( 'config', 'solr.yml' )
Oops, something went wrong.

0 comments on commit be5b95d

Please sign in to comment.