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.
| Option | Overlay | Legacy Inline | Default | Description | Rich Inline Template equivalent | Example |
|---|---|---|---|---|---|---|
allowSearchWithoutSearchword | ✅ | ✅ | false | When 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.allowSearchWithoutSearchword | allowSearchWithoutSearchword: true |
autocompleteMinimumQueryLength | ✅ | ✅ | 1 | Minimum 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.afterSearch | customCallbackAfterSearch: 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 | ✅ | ✅ | false | When true, the autocomplete dropdown is disabled; no suggestions appear as the user types. | autocomplete.disable | disableAutocomplete: 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.defaultOrder | sortOrder: {"Date_date": "desc"} |
focusOnResultsAfterSearch | ❌ | ✅ | false | When true, after the user submits a search, focus moves to the search results area (improves keyboard and screen-reader UX). | behavior.focusOnResultsAfterSearch | focusOnResultsAfterSearch: true |
hideResultsCount | ✅ | ✅ | false | When true, the line showing the number of results (e.g. “X results”) is hidden. | overrideStrings or theme | hideResultsCount: true |
hideSearchDidYouMean | ✅ | ✅ | false | When true, the “Did you mean …?” suggestion line is hidden. | — | hideSearchDidYouMean: true |
hideSearchFilters | ✅ | ❌ | false | When true, the facets/filters panel (e.g. categories) is hidden. | — | hideSearchFilters: true |
hideSearchFiltersIfNoResult | ❌ | ❌ | true | When 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.defaultValues | initFacets: {"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 | ✅ | ✅ | true | When true, clicking a facet/filter scrolls the page or result list to the top so the user sees the updated results. | behavior.jumpToTopOnFacetClick | jumpToTopOnFacetClick: 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.loadingElement | loading: "<span>Loading...</span>" |
The table below describes each available option, what it does, and examples of values.