SearchcraftConfig
The SearchcraftConfig object is used to initialize the Searchcraft JavaScript SDK in your front-end application. See the getting started page for a guide on how and where to use this configuration object.
Properties
Section titled “Properties”readKey
Section titled “readKey”readKey:
string
The read key value to use when sending Searchcraft search requests. This value needs read key-specific permissions. If you are using Searchcraft Cloud, this value can be configured in Vektron.
endpointURL
Section titled “endpointURL”endpointURL:
string
The endpoint url of your Searchcraft cluster where your specified search index exists. If you are using Searchcraft Cloud, this value can be found within the Vektron dashboard in the Code Snippets section when configuring a search index.
indexName
Section titled “indexName”indexName:
string
Name of the Searchcraft search index to search for results within. If you are using Searchcraft Cloud, this value can be found within the Vektron dashboard in the Code Snippets section when configuring a search index.
cortexURL?
Section titled “cortexURL?”
optional
cortexURL:string
The URL pointing towards Searchcraft Cloud’s semantic search and RAG summary processing layer. When using a searchcraft-summary-box
component, this value must be specified.
summaryInstructionsPrompt?
Section titled “summaryInstructionsPrompt?”
optional
summaryInstructionsPrompt:string
A prompt which provides additional instructions to the LLM when creating RAG search result summaries.
summaryDebounceDelay?
Section titled “summaryDebounceDelay?”
optional
summaryDebounceDelay:number
The amount of delay, in milliseconds, to debounce summary requests. Defaults to 1000
initialQuery?
Section titled “initialQuery?”
optional
initialQuery:string
The initial search query to call when Searchcraft is first initialized in your front-end application. This parameter can be used when you want to populate a page with an initial set of search results based on a query.
This value is a stringified Search query object. For a more in-depth reference on search queries, see the search endpoint documentation.
searchDebounceDelay?
Section titled “searchDebounceDelay?”
optional
searchDebounceDelay:number
The amount of delay, in milliseconds, to debounce search requests. Defaults to 0
.
searchResultsPerPage?
Section titled “searchResultsPerPage?”
optional
searchResultsPerPage:number
The maximum number of results to return per page.
measureUserIdentifier?
Section titled “measureUserIdentifier?”
optional
userId:string
A unique user identifier that represents a unique end-user of your product. This is an optional value that can be passed in for analytics and data visualization purposes within Searchcraft Cloud’s Vektron Dashboard.
customAdConfig?
Section titled “customAdConfig?”
optional
customAdConfig:object
This object allows you to configure the quantity, number, template, and positioning of custom ad containers within your search results. To see more information on how to configure custom ads, see the custom ads guide
customAdConfig Properties
Section titled “customAdConfig Properties”Property | Type | Description |
---|---|---|
template | CustomAdTemplate | The template to use when rendering custom ad containers. |
adStartQuantity | number optional | The number of custom ads to render at the start of the search results page. |
adEndQuantity | number optional | The number of custom ads to render at the end of the search results page. |
adInterstitialInterval | number optional | Renders a custom ad in between search results, at the specified interval. |
adInterstitialQuantity | number optional | Specifies the number of ads to be rendered in each interstitial in between search results. |
adContainerRenderedDebounceDelay | number optional | The amount of debounce delay to add before calling the ad_container_rendered event. The use case for setting this value would be when you would like to limit the number of ad calls being made when users are quickly paging through search results. |