diff --git a/search-g2-sdk-javascript-examples/knockoutjs-search-g2-sdk-javascript-example.html b/search-g2-sdk-javascript-examples/knockoutjs-search-g2-sdk-javascript-example.html index 89220af..8ee300c 100644 --- a/search-g2-sdk-javascript-examples/knockoutjs-search-g2-sdk-javascript-example.html +++ b/search-g2-sdk-javascript-examples/knockoutjs-search-g2-sdk-javascript-example.html @@ -148,27 +148,19 @@
Last updated: - var ICON_FOLDER = "../images/icons/"; + var BASE_URL = "../"; //or use https://raw.githubusercontent.com/Crownpeak/search-g2/master/ + var ICON_FOLDER = BASE_URL + "images/icons/"; var ICONS = ",doc,htm,pdf,ppt,txt,xls,"; - var UNKNOWN_ICON = "../images/icons/txt.png"; + var UNKNOWN_ICON = ICON_FOLDER+"txt.png"; - // Set some properties on the CrownPeakSearch object - var cps = new CrownPeakSearch(); - cps.collection("www.crownpeak.com"); - cps.facets(["title", "type"]); - cps.maxFacets(6); - cps.highlight(true); - //cps.resultProxy("http://test/proxy?search=%%query%%&result=%%index%%&url="); - //cps.sort(["url desc"]); - //cps.rows(2); - cps.spellcheck(true); - //cps.parameters("&hl=true&hl.fl=*"); /// /// The ViewModel object manages communication between our ui and the search /// - function ViewModel() { + function ViewModel(searchg2Client,searchg2AutocompleteClient) { var self = this; + self.searchClient = searchg2Client; + self.autocompleteClient = searchg2AutocompleteClient; self.query = ko.observable(""); self.lastQuery = ko.observable(""); self.page = ko.observable(1); @@ -207,7 +199,7 @@
Last updated: Last updated: Last updated: + + + diff --git a/search-g2-sdk-javascript-examples/plainjs-search-g2-sdk-javascript-example.html b/search-g2-sdk-javascript-examples/plainjs-search-g2-sdk-javascript-example.html index ca7e63d..4061200 100644 --- a/search-g2-sdk-javascript-examples/plainjs-search-g2-sdk-javascript-example.html +++ b/search-g2-sdk-javascript-examples/plainjs-search-g2-sdk-javascript-example.html @@ -61,9 +61,10 @@