<!-- navigation search box -->
<div id="nav-search-box"></div>
<!-- results page -->
<div id="results-search-box"></div>
<div id="results-search-response"></div>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ResultRenderer(props) { | |
const { values, token, resultClicked } = props; | |
return ( | |
<div className="gg-result"> | |
{values["image"] ? ( | |
<div className="gg-result__image"> | |
<TokenLink | |
url={values["url"]} | |
token={token} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sajari = require("@sajari/sdk-node") | |
const SajariProject = "<your-project>"; | |
const SajariCollection = "<your-collection>"; | |
const SajariCredentials = { | |
key: "<your-api-key>", | |
secret: "<your-api-secret>" | |
}; | |
// create client |
The following Javascript code block should be placed in the <head />
of your global page template.
<script>
(function() {
function setup(c,a,f){function g(){var a=[],b=function(){a.push(arguments)};b.arr=a;c.sajari=c.sajari||{};c.sajari.ui=c.sajari.ui||[];c.sajari.ui.push(b);return b}var d=a.createElement("link");d.href=f;d.as="script";d.rel="preload";d.crossorigin=!0;var e=a.createElement("script");e.async=!0;e.src=f;a.head.appendChild(d);a.head.appendChild(e);a=g();a.init=function(a){var b=g();b(a);return b};return a};
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
// createLocationFilter generates the location filter based on the | |
// location matching matrix provided by careerone | |
func createLocationFilter(locationLevel int, locations []int) string { | |
filterSegmentFmt := "(location_level_%[1]d = %[2]d OR location_level_%[1]d = 0)" | |
s := make([]string, 0, len(locations)) | |
for i := locationLevel; i < len(locations)+1; i++ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* fixing the text alignment and suggestions container width */ | |
#nav-search-box ul, | |
#results-search-box ul { | |
margin: 0; | |
padding: 0; | |
text-align: left; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var getUrlParam = function (e) { var t = new RegExp("[?&]" + e.replace(/[\[\]]/g, "\\$&") + "(=([^&#]*)|&|#|$)"), a = t.exec(window.location.href); return a && a[2] ? decodeURIComponent(a[2].replace(/\+/g, " ")) : "" }; | |
var setup = function (c, a, f) { function g() { var a = [], b = function () { a.push(arguments) }; b.arr = a; c.sajari = c.sajari || {}; c.sajari.ui = c.sajari.ui || []; c.sajari.ui.push(b); return b } var e = a.createElement("script"); e.async = !0; e.src = f; var d = a.createElement("link"); d.as = "script"; d.rel = "preload"; d.crossorigin = !0; d.href = f; a.head.appendChild(d); a.head.appendChild(e); a = g(); a.init = function (a) { var b = g(); b(a); return b }; return a }; | |
var sajari = setup(window, document, "//cdn.sajari.net/js/integrations/website-search-1.4.js"); | |
var searchBox = sajari.init({ | |
mode: "search-box", | |
project: "1534384424562720477", // Set this to your project. | |
collection: "triblive-com", // Set this to your collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Removing this rule, achieves the same result as adding 10px padding to the following selector .top-search-form input[placeholder="Search"] | |
*/ | |
.top-search-form input { | |
position: absolute; | |
background: none; | |
top: 0; | |
left: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Assumes the following div exists in the page, note: you can change this using the "attachDynamicContent" setting | |
// <div id="dynamic-content"></div> | |
// 2. The "pipeline" parameter controls the query execution, this example uses "popular", this is configurable | |
// 3. The "values" map controls the query. You don't need the "q" parameter, but can use this to control the context of | |
// the results. For example you may wish to use the "document.title" to find related content to the current page | |
// 4. The filter parameter allows any number of filters to be used to filter the query results, e.g. to domains, or sections, | |
// or any other number of factors | |
var recommend = setup(window, document, "script", "sajari", "//cdn.sajari.net/js/integrations/website-search-1.4.js"); | |
recommend({ |
NewerOlder