This widget was written for use in the faceted search page and is used to handle the scenario where a
search term is requested by the search service reports that an alternative (better) search term was used.
This widget will both show the alternative term as well as the originally requested term. These terms
can both be clicked on in order to publish a request to issue a new search.
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Extends
Mixes In
- external:dojo/_TemplatedMixin
- external:dojo/_OnDijitClickMixin
- module:alfresco/core/Core
Members
-
cssRequirements :object[]
-
An array of the CSS files to use with this widget.
Type:
- object[]
- Default Value:
- [{cssFile:"./css/AlternativeSearchLabel.css"}]
- Source:
-
i18nRequirements :object[]
-
An array of the i18n files to use with this widget.
Type:
- object[]
- Default Value:
- [{i18nFile: "./i18n/AlternativeSearchLabel.properties"}]
- Source:
-
searchedFor :string
-
This should be set to the term that was actually searched for.
Type:
- string
- Default Value:
- null
- Source:
-
searchedForKey :string
-
This is the attribute key to use for retrieving the term that was actually searched for in the payload provided to the onAlternativeSearch function. It defaults to the key provided by the alfresco/search/AlfSearchList.
Type:
- string
- Default Value:
- "searchedFor"
- Source:
-
searchedForLabel :string
-
This is the label to use to prefix the term that was searched for instead of the originally requested term.
Type:
- string
- Default Value:
- "alternativesearch.searchedFor"
- Source:
-
searchInsteadForLabel :string
-
This is the label to use to prefix the term that was originally requested instead of the search that was actually carried out.
Type:
- string
- Default Value:
- "alternativesearch.searchInsteadFor"
- Source:
-
searchRequest :string
-
This should be set to the term that was originally requested
Type:
- string
- Default Value:
- null
- Source:
-
searchRequestKey :string
-
This is the attribute key to use for retrieving the term that was originally requested for in the payload provided to the onAlternativeSearch function. It defaults to the key provided by the [AlfSearchList]{@link alfresco/search/AlfSearchList}.
Type:
- string
- Default Value:
- "searchRequest"
- Source:
-
subscriptionTopic :string
-
This is the topic that will be subscribed to for receiving alternative search data. It defaults to the topic used by the [AlfSearchList]{@link alfresco/search/AlfSearchList} widget.
Type:
- string
- Default Value:
- "ALF_SPELL_CHECK_SEARCH_TERM"
- Source:
-
templateString :string
-
Type:
- string
- Source:
-
useHash :boolean
-
Indicates whether or not to use the browser URL hash for setting search terms. This should be set with the same value as the [AlfSearchList]AlfSearchList because if the list is not responding to hash changes then setting an alternative search term on the hash will not trigger a search.
Type:
- boolean
- Default Value:
- true
- Source:
Methods
-
onAlternativeSearch(payload)
-
This function handles alternative search data being provided. E.g. it is called when a search has been carried out and the search performed used an alternative search term to the one originally requested. This will then update the searchedFor and [searchRequest]{@link alfresco/search/AlternativeSearchLabel#searchRequest} attributes and update the DOM with the new data.
Parameters:
Name Type Description payload
object The payload containing details of the search carried out. - Source:
-
onSearchFor(evt)
-
This function is called if the user clicks on the link that displays the term that was actually searched on
Parameters:
Name Type Description evt
object The click event - Source:
-
onSearchInsteadFor(evt)
-
This function is called if the user clicks on the link that displays the term that was originally requested
Parameters:
Name Type Description evt
object The click event - Source:
-
postMixInProperties()
-
Iterates over the suggestions.
- Source: