SignalsSearch Store API functions
Click signals
Pass a value as a JSON object that includes, at a minimum, the document ID. This value is returned by the search
, searchahead
, and browse
functions at docs.id
. You can include optional parameters in the JSON object.
The following table describes the required parameters and some recommended optional parameters to pass with this function. For full details on all parameters and allowed values, see the Signals API configuration specifications. For conceptual information, see Signals.
Parameter | Type | Description |
---|---|---|
Required |
||
|
string |
The unique identifier for the record within the indexed collection. |
Optional |
||
|
string |
The unique identifier for the query. |
|
integer |
The date and time the signal was recorded. Format this value as Unix epoch time, in milliseconds. If this optional parameter isn’t used, the current time is passed by default. |
Example requests
- Required parameters
window.getSearchStore().clickSignal({documentId: 'DOC_ID'})
- Required and optional parameters
window.getSearchStore().clickSignal({
documentId: 'DOC_ID',
queryId: 'QUERY_ID',
timestamp: TIMESTAMP
})
Demo
The following CodePen resource demonstrates the usage of this function. Open your browser’s web console and network monitor logs and watch for activity after clicking the buttons that trigger the Search Store API function.
Edit the function and click the corresponding button again to see the result change. |
Query signals
Pass a value as a JSON object that includes, at a minimum, the search terms and document ID, The query ID is optional.
The following table describes the parameters to pass with this function. For full details on all parameters and allowed values, see the Signals API configuration specifications. For conceptual information, see Signals.
Parameter | Type | Description |
---|---|---|
Required |
||
|
string |
The term or phrase you are searching. |
|
array |
The unique identifiers for the documents submitted in the query. |
Optional |
||
|
string |
The unique identifier for the query. |
Example requests
- Required parameters
window.getSearchStore().querySignal({
searchTerms: 'SEARCH_TERMS',
documentIds: [
"DOC_ID1",
"DOC_ID2",
"DOC_ID3"
]
})
- Required and optional parameters
window.getSearchStore().querySignal({
searchTerms: 'SEARCH_TERMS',
documentIds: [
"DOC_ID1",
"DOC_ID2",
"DOC_ID3"
],
queryId: 'QUERY_ID'
})