CMS Development

Michiel_Tob
Participant

Search results for multiple domains

SOLVE

Hi,

 

I am trying to set up a site search that shows the results of my website as well as those of my blogs. However, the blogs are on a different domain.

 

When I enter a keyword in the search input on my website, I do get suggestions from my blog pages, but these do not appear on the results page. On the domain of my blogs it is visa versa. It is exactly that only the results from the current domain are shown.

 

How can I set this up so that the results of both domains are shown?

2 Accepted solutions
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

Search results for multiple domains

SOLVE

@Michiel_Tob @dennisedson I'm gonna go out on a limb and guess that 1 or more of those searches aren't powered by the CMS Site search API which defaults to searching all domains associated to the portal. It's either that, or each search is limited to it's content type. If you see the query params in the URL that only have one "?type=BLOG_POST" or "&type=SITE_PAGE" then it's just a matter of enabling both of them like so "&type=SITE_PAGE&type=BLOG_POST"

Stefen Phelps, Community Champion, Kelp Web Developer

View solution in original post

Michiel_Tob
Solution
Participant

Search results for multiple domains

SOLVE

Hi @stefen,

 

I have found the problem.

 

The search module/search results module that I use is a clone of the one from hubspot. In the javascript files of the search input and search results I changed the url of the search api to 'https://api.hubapi.com/contentsearch/v2/search?...' and now it works perfectly.

 

Thanks for the help

 

View solution in original post

7 Replies 7
stefen
Key Advisor | Partner
Key Advisor | Partner

Search results for multiple domains

SOLVE

@adam976 are they both HubSpot hosted domains? If one is an external domain then you would need to use a third party service like Algolia.

Stefen Phelps, Community Champion, Kelp Web Developer
adam976
Member

Search results for multiple domains

SOLVE

Hi @stefen All hosted in Hubspot.

0 Upvotes
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

Search results for multiple domains

SOLVE

@Michiel_Tob @dennisedson I'm gonna go out on a limb and guess that 1 or more of those searches aren't powered by the CMS Site search API which defaults to searching all domains associated to the portal. It's either that, or each search is limited to it's content type. If you see the query params in the URL that only have one "?type=BLOG_POST" or "&type=SITE_PAGE" then it's just a matter of enabling both of them like so "&type=SITE_PAGE&type=BLOG_POST"

Stefen Phelps, Community Champion, Kelp Web Developer
adam976
Member

Search results for multiple domains

SOLVE

Hi @stefen 

 

I read the forum and made the same changes however it still does not work. For example if you are searching on a page that is on subdomainX.com I want it to show relevant results from subdomainY.com as well.

 

Could someone steer me onto the right direction?

 

Much appreciated!

nicole388
Participant

Search results for multiple domains

SOLVE

Following up on this... any solution for being able to search on subdomainX.com and subdomainY.com in the search results?

0 Upvotes
Michiel_Tob
Solution
Participant

Search results for multiple domains

SOLVE

Hi @stefen,

 

I have found the problem.

 

The search module/search results module that I use is a clone of the one from hubspot. In the javascript files of the search input and search results I changed the url of the search api to 'https://api.hubapi.com/contentsearch/v2/search?...' and now it works perfectly.

 

Thanks for the help

 

dennisedson
HubSpot Product Team
HubSpot Product Team

Search results for multiple domains

SOLVE

Hi @Michiel_Tob 

Adding @stefen to this conversation to  get his advice.