Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
websolr-acts_as_solr
Advanced tools
== About
This is the gem to install for the supported version of acts_as_solr on websolr.
== Installation
cd your_rails_app sudo gem install websolr-acts_as_solr config.gem "websolr-acts_as_solr" # into config.environment.rb echo websolr-acts_as_solr >> .gems # if using Heroku acts_as_solr install # Installs config/solr.yml echo "require 'aas_tasks'" >> Rakefile # Installs local development tasks
== Usage
=== Starting a local development server
To start up a Solr instance for development, issue the following:
rake solr:start
=== Using in production
You need to make sure that the WEBSOLR_URL environment variable is set correctly.
If you're using Heroku, this should happen automatically. You can verify by running heroku config
.
If you're running in your own environment, set the environment variable as you normally would on a *nix system.
If you have to set the variable in Ruby, you should be able to put the following in an Rails initializer:
if RAILS_ENV == "production" ENV["WEBSOLR_URL"] = "http://index.websolr.com/solr/[your-api-key]" load "websolr-acts_as_solr.rb" end
== Requirements
== Basic Usage
acts_as_solr
acts_as_solr :fields => [:name, :author]
Model.find_by_solr(query) #query is a string representing your query
== acts_as_solr in your tests
To test code that uses acts_as_solr you must start a Solr server for the test environment. You can do that with
rake solr:start RAILS_ENV=test
However, if you would like to mock out Solr calls so that a Solr server is not needed (and your tests will run much faster), just add this to your test_helper.rb
or similar:
class ActsAsSolr::Post
def self.execute(request)
true
end
end
(via[http://www.subelsky.com/2007/10/actsassolr-capistranhttpwwwbloggercomim.html#c1646308013209805416])
FAQs
Unknown package
We found that websolr-acts_as_solr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.