Skip to content

docs(plugin-meilisearch): add guidelines about auto recraw #434

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

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f5b77d7
feat(plugin-meilisearch): add code to repo
JQiue Mar 31, 2025
9c9e523
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 1, 2025
2885d19
feat: rebuild
Mister-Hope Apr 1, 2025
d245da0
chore: tweaks
Mister-Hope Apr 1, 2025
6a989ec
chore: tweaks
Mister-Hope Apr 1, 2025
906d524
chore: fix lockfile
Mister-Hope Apr 1, 2025
2fb5800
chore: tweaks
Mister-Hope Apr 1, 2025
dec171e
chore: tweaks
Mister-Hope Apr 1, 2025
457cc8d
feat(plugin-meilisearch): add prerender for button
JQiue Apr 1, 2025
fd24404
chore: rename export function name
JQiue Apr 1, 2025
eba85f6
docs: add meilisearch docs
JQiue Apr 1, 2025
318ed0e
docs: update meilisearch ico and sidebar config
JQiue Apr 1, 2025
709338b
docs: update meilisearch docs
JQiue Apr 1, 2025
fb54621
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 1, 2025
2b05d4b
chore: update words
Mister-Hope Apr 2, 2025
9e57b57
feat: add built-in translation
Mister-Hope Apr 2, 2025
84c083a
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 2, 2025
a65a2b0
chore: tweaks
Mister-Hope Apr 2, 2025
edfd72c
feat: add missing locales
Mister-Hope Apr 2, 2025
5aa47ef
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 2, 2025
ef86220
chore: revert
Mister-Hope Apr 2, 2025
3099787
docs: update docs
Mister-Hope Apr 2, 2025
423cfc9
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 2, 2025
314ad29
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 7, 2025
5f05095
fix: fix types
Mister-Hope Apr 7, 2025
649bb40
docs: correct docs
Mister-Hope Apr 7, 2025
8e52bc8
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 7, 2025
27a4ef0
docs: update docs
JQiue Apr 7, 2025
46c2ef9
docs: update docs
JQiue Apr 7, 2025
dcd5732
docs: update docs
JQiue Apr 7, 2025
634d024
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 9, 2025
c90e161
chore: fix broken lockfile
Mister-Hope Apr 9, 2025
5fa2a2d
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 9, 2025
598a850
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 12, 2025
3ce90a5
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 12, 2025
c94c893
style: fix linter
Mister-Hope Apr 12, 2025
599bb80
chore: tweaks
Mister-Hope Apr 12, 2025
b4a5ca0
fix: fix bundle issue
Mister-Hope Apr 12, 2025
c52045b
chore: tweaks
Mister-Hope Apr 12, 2025
43a36d6
fix: watch routeLocale
Mister-Hope Apr 12, 2025
5f1c3d8
ci: fix lockfile
Mister-Hope Apr 12, 2025
98e543d
fix: fix bugs
Mister-Hope Apr 12, 2025
d993c7c
fix: fix vite pack issue
Mister-Hope Apr 12, 2025
399409e
chore: tweaks
Mister-Hope Apr 12, 2025
029b937
fix: fix webpack ssg
Mister-Hope Apr 12, 2025
36877cb
docs: update docs
Mister-Hope Apr 12, 2025
8d37fd7
chore: tweaks
Mister-Hope Apr 12, 2025
8738528
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 12, 2025
71ed814
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 13, 2025
72c8f40
feat: filter results based on page locale
JQiue Apr 14, 2025
fa9a319
docs: update docs
JQiue Apr 14, 2025
11dedde
docs: update docs
JQiue Apr 14, 2025
5ed8ec7
fix: fixed an issue where filters could not be passed to options
JQiue Apr 14, 2025
bbc481d
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 14, 2025
f8fd164
docs: update docs
Mister-Hope Apr 14, 2025
d7f4c87
docs: update docs
Mister-Hope Apr 14, 2025
c5766d8
docs: tweaks
Mister-Hope Apr 14, 2025
7857601
docs: tweaks
Mister-Hope Apr 14, 2025
47ff3cf
docs: update docs
JQiue Apr 14, 2025
00f9646
docs: update docs
JQiue Apr 14, 2025
855d9e0
Merge branch 'main' into feat/plugin-meilisearch
JQiue Apr 14, 2025
4e095d3
Merge branch 'main' into feat/plugin-meilisearch
Mister-Hope Apr 15, 2025
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
36 changes: 36 additions & 0 deletions docs/plugins/search/meilisearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,42 @@ When the crawl is complete, MeiliSearch stores the crawled document in the speci

> See <https://www.meilisearch.com/docs/guides/front_end/search_bar_for_docs#scrape-your-content>

### Using Github Action for Automatic Scraping

In the Github repository, go to `Settings` -> `Secrets and variables` -> `Actions` -> `New repository secret` to set `MEILISEARCH_API_KEY` and `MEILISEARCH_HOST_URL`. And name your scraper configuration file `meilisearch-scraper.json` and place it in the root directory of your project.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the Github repository, go to `Settings` -> `Secrets and variables` -> `Actions` -> `New repository secret` to set `MEILISEARCH_API_KEY` and `MEILISEARCH_HOST_URL`. And name your scraper configuration file `meilisearch-scraper.json` and place it in the root directory of your project.
Place your scraper config file somewhere in your project.
Then go to `Settings` -> `Secrets and variables` -> `Actions` in your Github repository. Click `New repository secret` and set `MEILISEARCH_HOST_URL` and `MEILISEARCH_API_KEY` with your meilisearch server address and client key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change MEILISEARCH_HOST_URL to env instead of secret


```yml
name: Deploy and Scrape

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
# ....
scrapy:
needs: deploy
runs-on: ubuntu-latest
name: scrape and push content on Meilisearch instance
steps:
- uses: actions/checkout@v4
- name: Run scraper
env:
HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }}
API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
CONFIG_FILE_PATH: ${{ github.workspace }}/meilisearch-scraper.json
run: |
docker run -t --rm \
-e MEILISEARCH_HOST_URL=$HOST_URL \
-e MEILISEARCH_API_KEY=$API_KEY \
-v $CONFIG_FILE_PATH:/docs-scraper/config.json \
getmeili/docs-scraper:latest pipenv run ./docs_scraper config.json
```

## Get search index and api key

To create an access key that only allows search operations, use the following request. The `indexes` array specifies which indexes this key can access, and `expiresAt` sets the key's expiration date.
Expand Down
36 changes: 36 additions & 0 deletions docs/zh/plugins/search/meilisearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,42 @@ docker run -t --rm \

> 参考 <https://www.meilisearch.com/docs/guides/front_end/search_bar_for_docs#scrape-your-content>

### 使用 Github Action 自动抓取

在 Github 仓库的`Settings` -> `Secrets and variables` -> `Actions` -> `New repository secret`设置`MEILISEARCH_API_KEY`和`MEILISEARCH_HOST_URL`,并将你的爬虫配置文件命名为 `melisearch_scraper.json` 放到项目根目录下。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
在 Github 仓库的`Settings` -> `Secrets and variables` -> `Actions` -> `New repository secret`设置`MEILISEARCH_API_KEY``MEILISEARCH_HOST_URL`,并将你的爬虫配置文件命名为 `melisearch_scraper.json` 放到项目根目录下
将你的爬虫配置文件放到项目目录下
之后,在你的 Github 仓库前往 `Settings` -> `Secrets and variables` -> `Actions`。点击 `New repository secret` 并将 `MEILISEARCH_HOST_URL``MEILISEARCH_API_KEY` 设置为你的 Meilisearch 服务器地址和客户端密钥。


```yml
name: Deploy and Scrape

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
# ....
scrapy:
needs: deploy
runs-on: ubuntu-latest
name: scrape and push content on Meilisearch instance
steps:
- uses: actions/checkout@v4
- name: Run scraper
env:
HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }}
API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
CONFIG_FILE_PATH: ${{ github.workspace }}/meilisearch-scraper.json
run: |
docker run -t --rm \
-e MEILISEARCH_HOST_URL=$HOST_URL \
-e MEILISEARCH_API_KEY=$API_KEY \
-v $CONFIG_FILE_PATH:/docs-scraper/config.json \
getmeili/docs-scraper:latest pipenv run ./docs_scraper config.json
```

## 获取搜索索引和 API 密钥

要创建只允许搜索操作的访问密钥,请使用以下请求。`indexes` 数组指定该密钥可以访问哪些索引,`expiresAt` 设置密钥的过期时间。
Expand Down
Loading