CMS Development

MRatkai
Member

Search not showing results

SOLVE

Hi all,

 

I'm working on a client blog created on Hubspot and they're having an issue where the search results page is not showing any results. I'm pretty new to Hubspot development so tracking down this issue is pretty challenging. I've made sure that the whole search setup is how it's supposed to be, with a search template and all, query params seem to be passing along just fine, search template is set in the settings correctly, but still nothing. 

 

Here's the site in question. Any ideas?

https://blog.namastesolar.com/

 

Thanks in advance!

0 Upvotes
1 Accepted solution
piersg
Solution
Key Advisor

Search not showing results

SOLVE

What URL are you using in your GET request? In your page URL you're using "q" as the query parameter, which is fine as long as the URL of the GET request has "term" for the search term. It should follow this structure:

 

`https://api.hubapi.com/contentsearch/v2/search?portalId=${portalId}&term=${searchTerm}&type=SITE_PAGE&type=BLOG_POST&type=LISTING_PAGE`

 

View solution in original post

1 Reply 1
piersg
Solution
Key Advisor

Search not showing results

SOLVE

What URL are you using in your GET request? In your page URL you're using "q" as the query parameter, which is fine as long as the URL of the GET request has "term" for the search term. It should follow this structure:

 

`https://api.hubapi.com/contentsearch/v2/search?portalId=${portalId}&term=${searchTerm}&type=SITE_PAGE&type=BLOG_POST&type=LISTING_PAGE`