Skip to content

Instantly share code, notes, and snippets.

@pavanBS
Last active October 16, 2019 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavanBS/479ab7ca4d5faa79c4a3c4cf33f60879 to your computer and use it in GitHub Desktop.
Save pavanBS/479ab7ca4d5faa79c4a3c4cf33f60879 to your computer and use it in GitHub Desktop.
var query_values = getUrlParam("as_q");
var searchInterface = setup(window, document, "script", "sajari", "https://cdn.sajari.net/js/integrations/website-search-1.3.0.js");
searchInterface("inline", {
project: "xxxx", // Set this to your project.
collection: sajaridomain, // Set this to your collection.
pipeline: "website", // Set the search pipeline.
instantPipeline: "autocomplete", // Set the instant pipeline.
attachSearchBox: document.getElementById("results-search-box"), // DOM element to render search box.
attachSearchResponse: document.getElementById("results-search-response"), // DOM element to render search results.
inputPlaceholder: "Enter Your Keywords", // Placeholder text for the search box.
inputAutoFocus: true, // Focus the input element on render.
maxSuggestions: 5, // Maximum number of suggestions to show.
results: {
"showImages": false
}, // Configure the results.
tabFilters: {
defaultTab: "All",
tabs: [{
title: "All",
filter: ""
}, {
title: "Test1",
filter: "dir2='test1'"
}, {
title: "Test2",
filter: "dir1='test2'"
}, {
title: "Test3",
filter: "dir1='test3'"
}, {
title: "Test4",
filter: "dir1='test4'"
}, {
title: "Test5",
filter: "dir2='test5'"
}, {
title: "Test6",
filter: "dir1='test6'"
}, {
title: "Test7",
filter: "dir2='test7'"
}]
},
values: {
"q.override": true,
"resultsPerPage": "10",
"q": getUrlParam("as_q")
} // Set default values.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment