-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Issue at Hand
To accommodate for multiple searches (i.e. one for docs, one for tutorials), we'll need a way to filter a search query's results to only include one particular source.
Proposed Solution
- Update Algolia docsearch Config File
- Filter by Tags in Search Component
1. Update Algolia docsearch Config File
Our current config file currently includes an entry point for each project's doc section, each with a tags property:
{
"start_urls": [
{
"url": "https://docs.colony.io/colonynetwork/docs-colony/",
"tags": [
"colonynetwork"
]
},
{
"url": "https://docs.colony.io/colonynetwork/",
"tags": [
"colonynetwork"
]
},
...
],
...
}With tutorials added, it may be good to add a docs tag to each relevant docs url, and a tuts or tutorials tag to each relevant project's tutorials url:
{
"start_urls": [
{
"url": "https://docs.colony.io/colonynetwork/docs-colony/",
"tags": [
"colonynetwork",
"docs"
]
},
{
"url": "https://docs.colony.io/colonynetwork/tutorial-first-steps/",
"tags": [
"colonynetwork",
"tutorials"
]
},
{
"url": "https://docs.colony.io/colonynetwork/",
"tags": [
"colonynetwork",
]
},
...
],
...
}2. Filter by Tags in Search Component
Algolia's docsearch accepts an algoliaOptions object which you can learn more about here. It accepts these API parameters.
Ideally, the filters should be Search component props, but in it's simplest form, this could look something like:
// Search tutorials only
docsearch({
algoliaOptions: {
filters: 'tags:tutorials',
},
...
});
// Search only colonyNetwork docs
docsearch({
algoliaOptions: {
filters: 'tags:colonynetwork AND tags:docs',
},
...
});Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request