Search

The main method to embed search directly into a target page container, with a result being materialized into a different page container.

search(searchContainer:HTMLElement, previewContainer:HTMLElement, options: EmbedSearchOptions): search
  • The first 'search' container can be any legitimate HTML5 container - usually a DIV tag. It will house the search text box.
  • The second 'preview' container can be any legitimate HTML5 container - usually a DIV tag. It will house the resulting visual .
  • The settings for the embedded search are specified in the SearchEmbedOptions object. This can include various properties and style settings .
  • The method returns an instance of the "search" object, which has its own methods.

Example

The following snippet creates the embed search object

const embedClient = new PyramidEmbedClient('http://pyramid:8181');
		
		const searchContainer = document.getElementById('embed-search-container');
		const previewContainer = document.getElementById('embed-preview-container');
		
		const embedSearchOptions = {
			theme: 'light',
			locale: 'en-US',
		};

const searchObj = await embedClient.search(searchContainer, previewContainer, embedSearchOptions);