new GdiModel()
modules/searchbar/gdi/model.js, line 26
Properties:
Name | Type | Default | Description |
---|---|---|---|
minChars |
Number | 3 | Minimum length of search string to start. |
serviceId |
String | "" | Id of restService to derive url from. |
queryObject |
Object | {} | Payload used to append to url. |
elasticSearch |
ElasticModel | = new ElasticSearch() ElasticModel. |
Fires:
- Core#event:RadioRequestParametricURLGetInitString
- Searchbar#event:RadioTriggerSearchbarPushHits
- Searchbar#event:RadioTriggerSearchbarRemoveHits
- Searchbar#event:RadioTriggerSearchbarCreateRecommendedList
Listens to Events:
Extends
Methods
-
appendSearchStringToPayload(payload, searchStringAttribute, searchString){Object}
modules/searchbar/gdi/model.js, line 168 -
Recursively searches for the searchStringAttribute key and sets the searchString. Adds the search string to the payload using the given key
Name Type Description payload
Object Payload as Object searchStringAttribute
String Attribute key to be added to the payload object. searchString
String Search string to be added using the searchStringAttribute. Returns:
the payload with the search string.
-
createHit(result, hitMap, hitType, hitGlyphicon, triggerEvent){Object}
modules/searchbar/gdi/model.js, line 119 -
Creates hit that is sent to the hitList.
Name Type Description result
Object Result object from elastcisearch request. hitMap
Object Mapping object. Used to map results attributes to neccessary hit attributes. hitType
String Type of hit. hitGlyphicon
String Glyphicon class to show in reccomendedList triggerEvent
Object Object defining channel and event. used to fire event on mouseover and click in recommendedList. Returns:
hit.
-
createRecommendedList(responseData){void}
modules/searchbar/gdi/model.js, line 84 -
Creates the recommended List
Name Type Description responseData
Array.<Object> Response data. Fires:
-
deriveUrlFromServiceIdAndAppendParameter(serviceId){String}
modules/searchbar/gdi/model.js, line 41 -
Derives the url from the serviceId and appends url parameters.
Name Type Description serviceId
String Service Id. Returns:
url with appended parameters.
-
findAttributeByPath(object, path){*}
modules/searchbar/gdi/model.js, line 141 -
Returns the attribute value of the given object by path. If path is an array, the function recursively iterates over the object for each part and pushes the value in an array. Otherwise only the value of the given attribute path will be returned.
Name Type Description object
Object Object to derive value from. path
String | Array.<String> Path of the attribute. "." in the path indicates the next deeper level. Returns:
Value that is at position of given path.
-
search(searchString){void}
modules/searchbar/gdi/model.js, line 58 -
Checks if the minChars criterium is passed, then sends the request to the elastic search index.
Name Type Description searchString
String The search string. -
setUrl(value){void}
modules/searchbar/gdi/model.js, line 186 -
Setter for Attribute "url".
Name Type Description value
String Url.