How to consolidate the search from several domains ?

808 views September 27, 2016 June 14, 2018 admin 3

Let’s imagine you manage several newspapers, or blogs, or magazines. Let say that one site is about cooking, one is about fashion, and the last one is about quantum physics (geeks can be hip also).

Now, you would like to search in all your sites, and show all the results in one consolidated site, let say the newspapers site.

Solr search shows local or global results on websites

Solr search shows local or global results on websites

There is one option in wpsolr, just to do that. Define, for each site, if it belongs to a network, and if it is a local search site, or a global search site.

How does that work ?

Remember first that wpsolr search is powered by Solr indexes. Now, what if all sites in a network could share that index, but be able to filter out their own results (local search site), or not (global search site).

Well, that is exactly what wpsolr does!

Solr index shared between local and global sites to perform a domain search

Solr index shared between local and global sites to perform a domain search

Simple enough, then:

  • For all the sites of the network, use the same  Solr index configuration in wpsolr’s index definitions.
  • For each site showing their own results only (the blog and magazine), select wpsolr option ‘Local search’
  • For each site showing results from the whole network sites (the newspaper), including all local sites and their own results, select wpsolr option ‘Global search’

Not bad.

Can we define several networks?

Yes, we can. Just repeat the same setup, but with a different Solr index for each network.

Solr can search in several networks of sites, by sharing different indexes

Solr can search in several networks of sites, by sharing different indexes

Can we define networks with multi-language sites?

Yes, we can, with wpsolr multilingual packs (wpml, polylang). Just share one index by language on the network.

Solr can search in several languages for several sites by sharing one Solr index by language

Solr can search in several languages for several sites by sharing one Solr index by language

For instance, if all my sites are written in English, and French, I will use 2 Solr indexes for the whole network, and share them on each site.
You can also have the German language on the magazine site. In that case, you need to add German to your global site also (global sites must have all languages of the network installed).

Does it work in a WordPress multisite network installation ?

Yes, it does.

Does it work in a non WordPress multisite network installation ?

Yes, it does. Your sites does not need to be related.

Known limitations

Cross-domain search does not support:
– Suggestions
– The current theme search.php template. Only the shortcode Ajax template.

Was this helpful?

Leave A Comment
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.