Class Index | File Index

Classes


Class AjaxSolr.ParameterStore

ParameterStore
Defined in: ParameterStore.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
The ParameterStore, as its name suggests, stores Solr parameters.
Method Summary
Method Attributes Method Name and Description
 
add(name, param)
If the parameter may be specified multiple times, adds the given parameter to the list of identically-named parameters, unless one already exists with the same value.
 
addByValue(name, value, locals)
If the parameter may be specified multiple times, creates a parameter using the given name and value, and adds it to the list of identically-named parameters, unless one already exists with the same value.
 
constructor(attributes)
 
Resets the values of the exposed parameters.
 
Returns the exposed parameters as a query string.
 
find(name, value)
Finds all parameters with matching values.
 
get(name)
Returns a parameter.
 
init()
An abstract hook for child implementations.
 
isMultiple(name)
Some Solr parameters may be specified multiple times.
 
load(reset)
Loads the values of exposed parameters from persistent storage.
 
Parses a query string into Solr parameters.
 
remove(name, index)
Deletes a parameter.
 
removeByValue(name, value)
Deletes any parameter with a matching value.
 
save()
An abstract hook for child implementations.
 
An abstract hook for child implementations.
 
Returns the Solr parameters as a query string.
 
values(name)
If the parameter may be specified multiple times, returns the values of all identically-named parameters.
Class Detail
AjaxSolr.ParameterStore(properties)
The ParameterStore, as its name suggests, stores Solr parameters. Widgets expose some of these parameters to the user. Whenever the user changes the values of these parameters, the state of the application changes. In order to allow the user to move back and forth between these states with the browser's Back and Forward buttons, and to bookmark these states, each state needs to be stored. The easiest method is to store the exposed parameters in the URL hash (see the ParameterHashStore class). However, you may implement your own storage method by extending this class.

For a list of possible parameters, please consult the links below.

Parameters:
properties
A map of fields to set. Refer to the list of public fields.
See:
http://wiki.apache.org/solr/CoreQueryParameters
http://wiki.apache.org/solr/CommonQueryParameters
http://wiki.apache.org/solr/SimpleFacetParameters
http://wiki.apache.org/solr/HighlightingParameters
http://wiki.apache.org/solr/MoreLikeThis
http://wiki.apache.org/solr/SpellCheckComponent
http://wiki.apache.org/solr/StatsComponent
http://wiki.apache.org/solr/TermsComponent
http://wiki.apache.org/solr/TermVectorComponent
http://wiki.apache.org/solr/LocalParams
Method Detail
{AjaxSolr.Parameter|Boolean} add(name, param)
If the parameter may be specified multiple times, adds the given parameter to the list of identically-named parameters, unless one already exists with the same value. If it may be specified only once, replaces the parameter.
Parameters:
{String} name
The name of the parameter.
{AjaxSolr.Parameter} param Optional
The parameter.
Returns:
{AjaxSolr.Parameter|Boolean} The parameter, or false.

{AjaxSolr.Parameter|Boolean} addByValue(name, value, locals)
If the parameter may be specified multiple times, creates a parameter using the given name and value, and adds it to the list of identically-named parameters, unless one already exists with the same value. If it may be specified only once, replaces the parameter.
Parameters:
{String} name
The name of the parameter.
{String|Number|String[]|Number[]} value
The value.
{Object} locals Optional
The parameter's local parameters.
Returns:
{AjaxSolr.Parameter|Boolean} The parameter, or false.

constructor(attributes)
Parameters:
attributes

exposedReset()
Resets the values of the exposed parameters.

{String} exposedString()
Returns the exposed parameters as a query string.
Returns:
{String} A string representation of the exposed parameters.

{String|Number[]} find(name, value)
Finds all parameters with matching values.
Parameters:
{String} name
The name of the parameter.
{String|Number|String[]|Number[]|RegExp} value
The value.
Returns:
{String|Number[]} The indices of the parameters found.

{AjaxSolr.Parameter|AjaxSolr.Parameter[]} get(name)
Returns a parameter. If the parameter doesn't exist, creates it.
Parameters:
{String} name
The name of the parameter.
Returns:
{AjaxSolr.Parameter|AjaxSolr.Parameter[]} The parameter.

init()
An abstract hook for child implementations.

This method should do any necessary one-time initializations.


{Boolean} isMultiple(name)
Some Solr parameters may be specified multiple times. It is easiest to hard-code a list of such parameters. You may change the list by passing { multiple: /pattern/ } as an argument to the constructor of this class or one of its children, e.g.:

new ParameterStore({ multiple: /pattern/ })

Parameters:
{String} name
The name of the parameter.
Returns:
{Boolean} Whether the parameter may be specified multiple times.
See:
http://lucene.apache.org/solr/api/org/apache/solr/handler/DisMaxRequestHandler.html

load(reset)
Loads the values of exposed parameters from persistent storage. It is necessary, in most cases, to reset the values of exposed parameters before setting the parameters to the values in storage. This is to ensure that a parameter whose name is not present in storage is properly reset.
Parameters:
{Boolean} reset Optional, Default: true
Whether to reset the exposed parameters. before loading new values from persistent storage. Default: true.

parseString(str)
Parses a query string into Solr parameters.
Parameters:
{String} str
The string to parse.

remove(name, index)
Deletes a parameter.
Parameters:
{String} name
The name of the parameter.
{Number} index Optional
The index of the parameter.

{String|Number[]} removeByValue(name, value)
Deletes any parameter with a matching value.
Parameters:
{String} name
The name of the parameter.
{String|Number|String[]|Number[]|RegExp} value
The value.
Returns:
{String|Number[]} The indices deleted.

save()
An abstract hook for child implementations.

Stores the values of the exposed parameters in persistent storage. This method should usually be called before each Solr request.


{String} storedString()
An abstract hook for child implementations.

Returns the string to parse from persistent storage.

Returns:
{String} The string from persistent storage.

string()
Returns the Solr parameters as a query string.

IE6 calls the default toString() if you write store.toString() . So, we need to choose another name for toString().


{String[]|Number[]} values(name)
If the parameter may be specified multiple times, returns the values of all identically-named parameters. If the parameter may be specified only once, returns the value of that parameter.
Parameters:
{String} name
The name of the parameter.
Returns:
{String[]|Number[]} The value(s) of the parameter.

Documentation generated by JsDoc Toolkit 2.3.0 on Mon Apr 29 2013 14:55:21 GMT-0400 (EDT)