Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search across multiple Jekyll sites #163

Open
jasonriley opened this issue Nov 28, 2020 · 2 comments
Open

Search across multiple Jekyll sites #163

jasonriley opened this issue Nov 28, 2020 · 2 comments

Comments

@jasonriley
Copy link

I want to suggest a feature (or see if anyone has a creative workaround):

Support for searching across multiple, distinct Jekyll sites

What is your use case for such a feature?

Why? We have a WWW site that has lots of blog content, and a separate site for software developers that has API reference information, how to articles etc. I'd like searches on either site to show matches on both. Both sites are driven by Jekyll, and this plugin works well for indexing and searching when there is one site per index.

What is your proposed API? Is this a new option? A new behavior?

How?
a) use one index for all the sites, but use a website property to scope the update to the index so that when a site is indexed, it only updates those records with that website. In other words it doesn't update or delete object from a different website.
b) website could be a facet that allows for searching one site or all sites, and also allows the building of the full URL to the search result on a different site.

Perhaps there is a way to put a hook or callout either on the query of existing object IDs or the determining of which ones to remove.

@Haroenv
Copy link
Contributor

Haroenv commented Nov 28, 2020

forking the plugin to add configuration of a certain attribute in this list here https://github.com/algolia/jekyll-algolia/blob/develop/lib/jekyll/algolia/indexer.rb#L205 should be a good start. I'd advise you to fork the plugin and having a look at how that works first, but once you've got something working, I'll gladly review it

@Krinkle
Copy link

Krinkle commented Dec 31, 2020

This can be accomplished today using multiple indexes under the same "application", which I believe is actually a feature specifically for this purpose. Where each related group of sites/indexes together are one application that one or more account holders can manage.

For an example of this, see qunit:/docs and qunitjs.com which are published at api.qunitjs.com and qunitjs.com respectively. Each uses jekyll-algolia to index its own "site", which the Amethyst theme's both specifies in autocomplete query, which also has built-in support already for mutiple indexes and showing their results together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants