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

Update docsearch guide with key concepts for config.json #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs-site/content/guide/docsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In fact, the search bar you see on Typesense's own documentation site is built w
Typesense's customized version of DocSearch is made up of two components:

1. [typesense-docsearch-scraper](https://github.com/typesense/typesense-docsearch-scraper) - Scraper that scans your documentation site and indexes the content in Typesense.
1. [typesense-docsearch.js](https://github.com/typesense/typesense-docsearch.js) - Javascript library that adds a search bar to your documentation site, that uses the index built by the DocSearch scraper.
2. [typesense-docsearch.js](https://github.com/typesense/typesense-docsearch.js) - Javascript library that adds a search bar to your documentation site, that uses the index built by the DocSearch scraper.

## Step 1: Set up DocSearch Scraper

Expand All @@ -22,6 +22,12 @@ Follow the official [DocSearch documentation](https://docsearch.algolia.com/docs

You can use one of those as templates to create your own `config.js`, pointing to your documentation site.

#### Key Concepts

- Your main text content, which is usually within a `<main>` or an `<article>` HTML element, should be identifiable with a class such as `.main`
ArsalaBangash marked this conversation as resolved.
Show resolved Hide resolved
- Docsearch organizes the scraped information's hierarchy using variables called `lvl0`, `lvl1`, `lvl2`..., which usually map to the `h1`, `h2`, `h3`... tags within an article
- `lvlX` selectors can also be queried with CSS classes or xpath queries

### Run the Scraper

The easiest way to run the scraper is using Docker.
Expand Down