Installing AC into Your Application Server The command-line tools are used for loading suggestion items into the AC back-end. The returned suggestions are displayed as a list attached to the search field. It detects pauses in typing and issues queries to the back-end as the user keeps typing. The AJAX attaches to any existing HTML search form. The back-end consists of a special Solr schema suitable for fast retrieval of partial words and phrases. How it WorksĪC consists of a Solr-powered back-end, the AJAX/JavaScript front end, and command-line tools. At the same time, core functionality is available out-of-the-box, too - just send your queries to dismax_ac handler without advanced parameters. Different combinations are achieved by sending different sets of parameters to your dismax handler (more about the parameters in later sections). The example solrconfig.xml shows how to configure one simple dismax handler to provide all these functionalities. Custom data in AC GUI component – GUI component can display not just the text of AC suggestions, but also other data, such as images, URL links, “sponsored link” message, description, price, etc., as demonstrated in the example GUI component that comes with AC.Īll advanced functionality is optional and one can combine individual pieces of functionality as one needs it.For instance, if user enters “washington tim”, AC will push suggestion “the washington times article” above “times in washington”. Matching “word ordering” boost pushes to the top those suggestions that match the order of query terms.For instance, if a person enters “new”, the phrase “new york” would be pushed above “newton”. Full word match boosting pushes to the top suggestions which contain the exact words from partially entered queries.Suggestions grouping by a field – for instance, the first 2 suggestions could be sponsored, and the rest unsponsored or the first 5 suggestions could be book titles, followed by 4 dvd titles, with 1 cd title at the end, assuming you have these 3 types of items and their titles loaded into AC.Automatic misspelling correction – if you type “washeng” or “vashin”, both incomplete misspellings of “washington”, AC will offer suggestions like “washington” or “washington times”.AutoComplete in Distributed Environment.Installing AC into Your Application Server.For example, if you type "bass" AC might offer suggestions that include "bass fishing" or "bass guitar", and even "sea bass" (note how "bass" is not necessarily the first word) Contents One can then easily pick one of the suggestions or continue refining the suggestions by typing in more of the query. As one starts to enter search terms, the module detects a pause in typing and offers a list of suggested searches. You can view documentation for more advanced features of the helpers.The AutoComplete ( AC) enhances the search experience through suggest-as-you-type and auto-complete functionality built into the search form. In your view, to create a text field with autocomplete: Īnd to create a text field with autosuggest: Alternatively, you can override those style rules to force your design’s look and feel. Īlso, add the following stylesheet to use the basic style included. In your view, Add the following script tags (in the given order) to be able to use the view helpers. class Post :title autosuggest :post_author, :using => :author end end the field_name used (post_title and post_author in the following example) must be unique across all your autocomplete fields of the application. To be able to autocomplete/autosuggest a model’s attribute, call ‘autocomplete’/‘autosuggest’ on it in its ‘searchable’ block. In your solr schema.xml, add the following field types inside the tag: Īlso in your solr schema.xml, add the following fields inside thw tag. rake sunspot_autocomplete: copy_assets Usage This will copy jquery.js and solr-autocompleter to your public/javascripts. Run the following rake task to copy the plugin’s assets to your public directory. sunspot Installationĭownload the plugin and place it under vendor/plugins. You should have solr, sunspot and sunspot_rails ON and running. You can override some style rules to force your look and feel. Features:Īutocomplete: Typing “clo” will yield results that start with “clo”, like “cloudy with a chance of meatballs”.Īutosuggest: Typing “clo” will yield results that contain (or start with) “clo”, like “cloudy with a chance of meatballs” and “Jumping like Clowns”.Ī CSS based view. Sunspot Autocomplete is a Rails plugin that lets you use Solr and Sunspot for handy autocompletion of your html text inputs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |