Boost PC performance: How more available memory can improve productivity
Solr and symfony in Harmony with SolrJs
1. #1
Solr and symfony in Harmony with SolrJs
Doc. v. 0.1 - 21/04/09
Wildan Maulana | wildan [at] tobethink.com
2. About SolrJs
• SolrJS is a JQuery based ajaxian
interface to the Solr search engine
• One of the 2008 Google summer of
code project topic
• Still work in progress but already been
useable, watch
http://wiki.apache.org/solr/SolrJS for
newest info
3. About SolrJs - Cont
• Written In Object
Oriented JavaScript
4. Architectural Overview
SolrJS → a collection of reusable and extendable “widget”
•
A widget is a javascript object that is responsible for creating the according
•
solr query as well as render the result from the server to html
One manager object acts as a container that holds these widgets, performs
•
the actual query using jQueries getJSON
http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback method
There are two base types of widgets:
•
– client side widgets: They get a Javascript JSON response from the
server and render the needed html for the widget using jQuery javascript
code.
– server side widgets: They move the rendering logic to the server,
using the VelocityResponseWriter (see
https://issues.apache.org/jira/browse/SOLR-620. The widget then only
quot;copiesquot; the html reponse from the server into the target div.
The Js files is organized in “packages” like in a Java Application:
•
– core: The manager and other base classes.
– server: server side widgets
– client: client side widgets
5. The Manager Object
addSelectionView(widget)
•
Adds a selection view to this manager.
addWidget(widget)
•
Adds a widget to this manager.
containsItem(item)
•
Checks if the given item is available in the current selection.
deselectItem(widgetId)
•
Removes the given item from the current selection, regardless of widgets.
deselectItems(widgetId)
•
Removes the given items from the current selection.
doRequest(start, resultsOnly)
•
Creates a query out of the current selection and calls all bound widgets to
request their data from the server.
doRequestAll()
•
Sets the current selection to *:* and requests all docs.
getLoadingDiv()
•
Helper method that returns an ajax-loading.gif inside a div.
selectItems(widgetId, items)
•
Adds the given items to the current selection.