Service portal: Display all the records from search sources without any filters (data.q) in Faceted Search widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2020 06:40 AM
Hi All,
I am using existing 'Faceted Search' widget and modifying it to show list of records based on search keyworkds and filters.
Following is an example where 'demand' keyword is used to show list of records. (q=demand). URL also has (t=appstore) based on source.
When filter is removed, system filter out all the records and display following screen (evenif source business app is selected)
I want to show all the records when search keyword query (q=demand) is removed. How can I change this behavior.
I could not find code where data.q is used to filter out records. neither in search source nor in widget code.
Where is this logic written?
Thanks,
KUMAR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2020 05:28 AM
Hi Kumar,
Unfortunately there doesn't seem to be a way to that. The data.q is used in the fetch() function which is called when the widget loads and accepts the q as parameter. It uses the "spFacetsClientService" to search the record which calls the "api/now/sp/search" to fetch the result.
The search page shows us all the result when we remove the query q=XYZ as it queries the tables in the Server Script of the widget itself and returns the result.