Customize search using CludoJS options

When implementing search on a website, the CludoJS can be used to enable/disable and customize certain features. These settings should be implemented in the CludoSettings script, where the options are defined as an object with multiple parameters.

Option reference (Overlay and Legacy Inline)

The table below lists each option with a precise description, default value, and—where the same behaviour exists in the Rich Inline Template—the equivalent path in window.cludoConfig. For the Rich Inline Template, use cludoConfig and the nested structure described in the Rich Inline Template documentation; option names and nesting differ from Overlay and Legacy.

OptionOverlayLegacy InlineDefaultDescriptionRich Inline Template equivalentExample
allowSearchWithoutSearchword✅✅falseWhen true, loading the search results page with no query runs a wildcard search and shows results. When false, no search runs until the user enters a query.behavior.allowSearchWithoutSearchwordallowSearchWithoutSearchword: true
autocompleteMinimumQueryLength✅✅1Minimum number of characters the user must type before autocomplete suggestions appear.autocomplete.minimumQueryLength (RIT default: 3)autocompleteMinimumQueryLength: 3
customCallbackAfterSearch✅✅—Function called after search results have been received and rendered. Use for custom analytics or DOM updates.callbacks.afterSearchcustomCallbackAfterSearch: function(data){ console.log(data); }
customNoResultsMessage❌✅—Text or HTML shown when a search returns no results (replaces the default “no results” message).overrideStrings (e.g. template_nrm_*)customNoResultsMessage: "No results found."
disableAutocomplete✅✅falseWhen true, the autocomplete dropdown is disabled; no suggestions appear as the user types.autocomplete.disabledisableAutocomplete: true
filters✅✅—Pre-applied filters that restrict which results are returned. Key = filter type (e.g. DomainName, PageType), value = array of allowed values.facets.defaultValues (and engine filters in MyCludo)filters: {"DomainName": ["https://www.example.com"]}
sortOrder✅✅—Sort results by a crawler field and direction. Key = field name, value = “asc” or “desc”. If not set, results are sorted by relevance.sort.defaultOrdersortOrder: {"Date_date": "desc"}
focusOnResultsAfterSearch❌✅falseWhen true, after the user submits a search, focus moves to the search results area (improves keyboard and screen-reader UX).behavior.focusOnResultsAfterSearchfocusOnResultsAfterSearch: true
hideResultsCount✅✅falseWhen true, the line showing the number of results (e.g. “X results”) is hidden.overrideStrings or themehideResultsCount: true
hideSearchDidYouMean✅✅falseWhen true, the “Did you mean …?” suggestion line is hidden.—hideSearchDidYouMean: true
hideSearchFilters✅❌falseWhen true, the facets/filters panel (e.g. categories) is hidden.—hideSearchFilters: true
hideSearchFiltersIfNoResult❌❌trueWhen true, the facets panel is hidden when the search returns no results.—hideSearchFiltersIfNoResult: false
initFacets❌✅—Facet values applied by default to every search (e.g. restrict to a category). Key = facet type, value = array of values.facets.defaultValuesinitFacets: {"Category": ["Documents"]}
initSearchBoxText✅✅“”Placeholder or hint text shown in the search input when it is empty (e.g. on blur or before typing).—initSearchBoxText: "Search..."
jumpToTopOnFacetClick✅✅trueWhen true, clicking a facet/filter scrolls the page or result list to the top so the user sees the updated results.behavior.jumpToTopOnFacetClickjumpToTopOnFacetClick: false
language✅✅e.g. “en”Search language (ISO code). Affects query processing, autocomplete, and result language. Must match a supported language.language (top-level)language: 'en'
loading❌✅—HTML or text shown while a search is in progress (e.g. spinner or “Searching…”).behavior.loadingElementloading: "<span>Loading...</span>"

Use this callback to tie Cludo session tracking to your cookie consent platform. Cludo calls it before storing session data in local storage. Return true if the user has consented to tracking, or false if not. For setup instructions and return-value implications, see Connecting Cludo to your cookie consent functionality.

OptionOverlayLegacy InlineDefaultDescriptionRich Inline Template equivalentExample
canUserBeTracked✅✅—Function called before Cludo stores session tracking data. Return true if the user may be tracked, false if not.tracking.canUserBeTrackedcanUserBeTracked: function(){ return true; }