conf.js

Generic BBOP manager for dealing with gross GOlr configuration and management.

Contains bbop.golr.conf_field, bbop.golr.conf_class, and bbop.golr.conf.

TODO: better document all of this.  Essentially, this is all for getting data out of a JSONized version of the YAML files used to drive the OWLTools-Solr parts of GOlr.

Summary
conf.jsGeneric BBOP manager for dealing with gross GOlr configuration and management.
bbop.golr.conf_field
Functions
conf_fieldContructor for a GOlr search field.
display_nameThe user-facing display name.
descriptionA longer description.
idThe unique ID of this profile.
searchableReturns whether or not a string field has a shadow “*_searchable” field defined that is suitable for dismax searches.
requiredReturns whether or not this field is required.
is_multiUsing the “cardinality” entry, returns whether or not this field is “single” (false) or “multi” (true).
is_fixedUsing the “property_type” entry, returns whether or not this field is “dynamic” (false) or “fixed” (true).
propertyReturns the method of this field’s generation in the loader.
bbop.golr.conf_class
Functions
conf_classContructor for a GOlr search class.
display_nameThe user-facing display name.
descriptionA longer description.
weightThe relative weight of this search class.
idThe unique ID of this profile.
searchable_extensionThis returns the searchable extension used for this class.
get_fieldReturns a search field by id string.
get_fieldsReturn all of the fields in this search class.
get_weightsGet the various weights we need to run.
field_order_by_weightReturns an array of field ids ordered by weight.
bbop.golr.conf
Functions
confContructor for the GOlr query manager.
get_classReturns a class info object by id string.
get_classesReturns an array of all search classes.
get_classes_by_weightReturns an array of all search classes.

bbop.golr.conf_field

Summary
Functions
conf_fieldContructor for a GOlr search field.
display_nameThe user-facing display name.
descriptionA longer description.
idThe unique ID of this profile.
searchableReturns whether or not a string field has a shadow “*_searchable” field defined that is suitable for dismax searches.
requiredReturns whether or not this field is required.
is_multiUsing the “cardinality” entry, returns whether or not this field is “single” (false) or “multi” (true).
is_fixedUsing the “property_type” entry, returns whether or not this field is “dynamic” (false) or “fixed” (true).
propertyReturns the method of this field’s generation in the loader.

Functions

conf_field

bbop.golr.conf_field = function (field_conf_struct)

Contructor for a GOlr search field.

Arguments

field_conf_structJSONized config

Returns

conf_field object

display_name

this.display_name = function()

The user-facing display name.  Suitable for label or title somewhere.

Returns

Display name string.

description

this.description = function()

A longer description.  Suitable for tooltips.

Returns

Description string.

id

this.id = function()

The unique ID of this profile.

Returns

String.

searchable

this.searchable = function()

Returns whether or not a string field has a shadow “*_searchable” field defined that is suitable for dismax searches.  Defaults to false.

Returns

boolean

required

this.required = function()

Returns whether or not this field is required.  Defaults to false.

Not of particular use.

Returns

Boolean.

is_multi

this.is_multi = function()

Using the “cardinality” entry, returns whether or not this field is “single” (false) or “multi” (true).  Defaults to false.

Returns

Boolean.

is_fixed

this.is_fixed = function()

Using the “property_type” entry, returns whether or not this field is “dynamic” (false) or “fixed” (true).  Defaults to false.

Not of particular use.

Returns

Boolean.

property

this.property = function()

Returns the method of this field’s generation in the loader.

Not of particular use.

Returns

String.

bbop.golr.conf_class

Summary
Functions
conf_classContructor for a GOlr search class.
display_nameThe user-facing display name.
descriptionA longer description.
weightThe relative weight of this search class.
idThe unique ID of this profile.
searchable_extensionThis returns the searchable extension used for this class.
get_fieldReturns a search field by id string.
get_fieldsReturn all of the fields in this search class.
get_weightsGet the various weights we need to run.
field_order_by_weightReturns an array of field ids ordered by weight.

Functions

conf_class

bbop.golr.conf_class = function (class_conf_struct)

Contructor for a GOlr search class.

Arguments

class_conf_structJSONized config

Returns

conf_class object

display_name

this.display_name = function()

The user-facing display name.  Suitable for label or title somewhere.

Returns

Display name string.

description

this.description = function()

A longer description.  Suitable for tooltips.

Returns

Description string.

weight

this.weight = function()

The relative weight of this search class.

Returns

Integer.

id

this.id = function()

The unique ID of this profile.

Returns

String.

searchable_extension

this.searchable_extension = function()

This returns the searchable extension used for this class.  There is a typical default, but it might be change in namespace collisions, so it’s better to just use this.

Parameters

n/a

Returns

string

get_field

this.get_field = function(fid)

Returns a search field by id string.  Null otherwise.

Parameters

fida string id for the field

Returns

bbop.golr.conf_field

get_fields

this.get_fields = function()

Return all of the fields in this search class.

Returns

Array of bbop.golr.conf_field (unordered).

get_weights

this.get_weights = function(weight_category)

Get the various weights we need to run.

The weight category can be ‘boost’, ‘result’, or ‘filter’.

Arguments

weight_categorystring identifying the legal weight category

Returns

object of {field => weight, ...}

field_order_by_weight

this.field_order_by_weight = function(weight_category,
cutoff)

Returns an array of field ids ordered by weight.

The weight category can be ‘boost’, ‘result’, or ‘filter’.

Arguments

weight_categorystring identifying the legal weight category
cutoff[optional] if not defined, all listed fields in set returned

Returns

array like [field5, field4, ...]

bbop.golr.conf

Summary
Functions
confContructor for the GOlr query manager.
get_classReturns a class info object by id string.
get_classesReturns an array of all search classes.
get_classes_by_weightReturns an array of all search classes.

Functions

conf

bbop.golr.conf = function (golr_conf_var)

Contructor for the GOlr query manager.  Why don’t we just take bbop.golr.golr_meta as read?  We want to leave the door open to having multiple GOlrs running in the same area.

Arguments

golr_conf_varJSized GOlr config

Returns

golr conf object

get_class

this.get_class = function(fid)

Returns a class info object by id string.  Null otherwise.

Arguments

fidTODO

Returns

bbop.golr.conf_class.

get_classes

this.get_classes = function()

Returns an array of all search classes.

Returns

Array of bbop.golr.conf_class (unordered).

get_classes_by_weight

this.get_classes_by_weight = function()

Returns an array of all search classes.  Ordered by weight.

Returns

Array of bbop.golr.conf_class.

bbop.golr.conf_field = function (field_conf_struct)
Contructor for a GOlr search field.
this.display_name = function()
The user-facing display name.
this.description = function()
A longer description.
this.id = function()
The unique ID of this profile.
this.searchable = function()
Returns whether or not a string field has a shadow “*_searchable” field defined that is suitable for dismax searches.
this.required = function()
Returns whether or not this field is required.
this.is_multi = function()
Using the “cardinality” entry, returns whether or not this field is “single” (false) or “multi” (true).
this.is_fixed = function()
Using the “property_type” entry, returns whether or not this field is “dynamic” (false) or “fixed” (true).
this.property = function()
Returns the method of this field’s generation in the loader.
bbop.golr.conf_class = function (class_conf_struct)
Contructor for a GOlr search class.
this.display_name = function()
The user-facing display name.
this.description = function()
A longer description.
this.weight = function()
The relative weight of this search class.
this.id = function()
The unique ID of this profile.
this.searchable_extension = function()
This returns the searchable extension used for this class.
this.get_field = function(fid)
Returns a search field by id string.
this.get_fields = function()
Return all of the fields in this search class.
this.get_weights = function(weight_category)
Get the various weights we need to run.
this.field_order_by_weight = function(weight_category,
cutoff)
Returns an array of field ids ordered by weight.
bbop.golr.conf = function (golr_conf_var)
Contructor for the GOlr query manager.
this.get_class = function(fid)
Returns a class info object by id string.
this.get_classes = function()
Returns an array of all search classes.
this.get_classes_by_weight = function()
Returns an array of all search classes.
Close