
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
notch8_sunspot_autocomplete
Advanced tools
= Fork reason
Updated to work with the asset pipeline
= Sunspot Autocomplete
Sunspot Autocomplete is a Rails plugin that lets you use Solr and Sunspot for handy autocompletion of your html text inputs.
=== Features:
== Prerequisites
You should have solr, sunspot and sunspot_rails ON and running.
http://outoftime.github.com/sunspot
== Installation
Download the plugin and place it under vendor/plugins.
Run the following rake task to copy the plugin's assets to your public directory. This will copy jquery.js and solr-autocompleter to your public/javascripts.
rake sunspot_autocomplete:copy_assets
== Usage
In your solr schema.xml, in addition to field types added by sunspot, add the following field types inside the tag:
Also in your solr schema.xml, in addition to fields added by sunspot, add the following fields inside thw tag.
To be able to autocomplete/autosuggest a model's attribute, call 'autocomplete'/'autosuggest' on it in its 'searchable' block. the field_name used (post_title and post_author in the following example) must be unique across all your autocomplete fields of the application.
class Post < ActiveRecord::Base searchable do autocomplete :post_title, :using => :title autosuggest :post_author, :using => :author end end
In your view, Add the following script tags (in the given order) to be able to use the view helpers.
Also, add the following stylesheet to use the basic style included. Alternatively, you can override those style rules to force your design's look and feel.
In your view, to create a text field with autocomplete:
<%=autocomplete_text_field "post", "title", "http://127.0.0.1:8983/solr/", "post_title"%>
And to create a text field with autosuggest:
<%=autosuggest_text_field "post", "author", "http://127.0.0.1:8983/solr/", "post_author"%>
You can view documentation for more advanced features of the helpers.
FAQs
Unknown package
We found that notch8_sunspot_autocomplete demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.