From 9bf5d43f10c50fdeba4b0c3dad740879b484257d Mon Sep 17 00:00:00 2001 From: Arsala Grey Date: Fri, 12 Nov 2021 00:47:24 +0500 Subject: [PATCH 1/2] update guide/docsearch with config.json concepts --- docs-site/content/guide/docsearch.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs-site/content/guide/docsearch.md b/docs-site/content/guide/docsearch.md index 02dff382..f2b26dda 100644 --- a/docs-site/content/guide/docsearch.md +++ b/docs-site/content/guide/docsearch.md @@ -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 @@ -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 `
` or an `
` HTML element, should be identifiable with a class such as `.main` +- 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. From b8d5e777dc9de61503205be6458c942a626a400f Mon Sep 17 00:00:00 2001 From: Arsala Grey Date: Sun, 20 Feb 2022 19:02:15 +0500 Subject: [PATCH 2/2] docs: rewrote key concepts --- docs-site/content/guide/docsearch.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs-site/content/guide/docsearch.md b/docs-site/content/guide/docsearch.md index f2b26dda..9cef8ad3 100644 --- a/docs-site/content/guide/docsearch.md +++ b/docs-site/content/guide/docsearch.md @@ -24,9 +24,8 @@ You can use one of those as templates to create your own `config.js`, pointing t #### Key Concepts -- Your main text content, which is usually within a `
` or an `
` HTML element, should be identifiable with a class such as `.main` -- 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 +- Docsearch organizes the scraped information using records called `text`, `lvl0`, `lvl1`, `lvl2`...`lvl6`, which usually map to the main content and and header elements within most web articles. +- `text` and `lvlX` records can be queried using CSS selectors or xpath queries. ### Run the Scraper