How to change the order of search results in portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 09:55 AM
Hi All,
How to change the order of search results in portal?
PFB, now i want to change order of catalog results and KB article results. Catalog should be first and then KB articles.
Thanks,
Rajashekhar Mushke
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 06:08 PM
The information I posted above, seemed to work perhaps before New York...now this works for sure...
So I was able to change it by going this.
For example...my search started like this when searching "Laptop":
So I want to change it to where catalog items show first, instead of knowledge articles...
Go to Service Portal > Search Sources, click "Knowledge Bases" search source, go to the "Data Fetch Script" section and do this change around line 66:
//article.score = result.meta.score;
article.score = -1000;
Now we try the search again:
Please mark reply as Helpful/Correct.
Please also mark any other reply as Helpful, if it was.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2020 07:07 PM
Hi Rajashekhar,
Let me know if you have any questions, but my reply should solve your question.
Please mark reply as Helpful/Correct and any other reply as Helpful, if so.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2020 01:54 PM
Hi,
It's been a bit since my reply was posted. I just wanted to check-in and see how things are going.
If my reply helped guide you correctly, please mark it as Helpful & Correct.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2021 06:57 AM
Hi
It's been a bit over a year since my reply was posted. I just wanted to check-in and see how things are going.
If my reply helped guide you correctly, please mark it as Helpful & Correct.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2021 04:01 AM
Excellent, we have a custom search source (Cisco's website) and adding a line for the score = -1000 pushed it to the bottom of the list.
We wanted catalog items to be at the top, but maintain the original query score, so changed this line:
item.score = parseInt(sc.ir_query_score.getDisplayValue())+1000;
The "+1000" pushes the catalog items above the others.