Skip to content

Commit 4cab958

Browse files
authored
Merge branch 'meilisearch:main' into main
2 parents e6a6fe6 + 5b452af commit 4cab958

File tree

7 files changed

+295
-259
lines changed

7 files changed

+295
-259
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Install dependencies for production only
6868
run: pipenv install
6969
- name: Meilisearch setup with Docker
70-
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --no-analytics --master-key=masterKey
70+
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest meilisearch --no-analytics --master-key=masterKey
7171
- name: Run the scraper with basic config
7272
run: pipenv run ./docs_scraper $CONFIG_FILE
7373
env:

Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
FROM python:3.8.4-buster
22

3-
WORKDIR /docs-scraper
4-
5-
COPY . .
6-
73
ENV LC_ALL C.UTF-8
84
ENV LANG C.UTF-8
95

6+
WORKDIR /docs-scraper
7+
108
RUN apt-get update -y \
11-
&& apt-get install -y python3-pip libnss3
9+
&& apt-get install -y python3-pip libnss3 \
10+
&& apt-get install -y chromium-driver
1211

1312
RUN pip3 install pipenv
13+
14+
15+
COPY Pipfile Pipfile
16+
COPY Pipfile.lock Pipfile.lock
17+
1418
RUN pipenv --python 3.8 install
19+
20+
21+
COPY . .

Pipfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ name = "pypi"
55

66
[packages]
77
Scrapy = "==2.6.1"
8-
selenium = "==4.1.3"
9-
pytest = "==7.0.0"
10-
meilisearch = "==0.18.1"
8+
selenium = "==4.1.5"
9+
pytest = "==7.1.2"
10+
meilisearch = "==0.19.1"
1111
requests-iap = "==0.2.0"
1212
python-keycloak-client = "==0.2.3"
1313

1414
[dev-packages]
1515
pylint = "==2.8.2"
16-
tox = "==3.24.5"
16+
tox = "==3.25.0"
1717
tox-pipenv = "==1.10.1"

Pipfile.lock

Lines changed: 272 additions & 247 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ Websites that need JavaScript for rendering are passed through ChromeDriver.<br>
530530

531531
## 🤖 Compatibility with Meilisearch
532532

533-
This package only guarantees the compatibility with the [version v0.26.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.26.0).
533+
This package only guarantees the compatibility with the [version v0.28.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.28.0).
534534

535535
## ⚙️ Development Workflow and Contributing
536536

scraper/src/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def run_config(config):
7777
client_secret=os.getenv("KC_CLIENT_SECRET"))
7878
token_response = oidc_client.client_credentials()
7979
token = token_response["access_token"]
80-
headers.update({"Authorization": 'bearer ' + token})
80+
headers.update({"Authorization": 'Bearer ' + token})
8181

8282
DEFAULT_REQUEST_HEADERS = headers
8383

scraper/src/meilisearch_helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ class MeiliSearchHelper:
101101
def __init__(self, host_url, api_key, index_uid, custom_settings):
102102
self.meilisearch_client = meilisearch.Client(host_url, api_key)
103103
self.meilisearch_index = self.meilisearch_client.index(index_uid)
104+
self.delete_index()
104105
self.add_settings(MeiliSearchHelper.SETTINGS, custom_settings)
105106

106107
def add_settings(self, default_settings, custom_settings):
107108
settings = {**default_settings, **custom_settings}
108109
self.meilisearch_index.update_settings(settings)
109110

111+
def delete_index(self):
112+
self.meilisearch_index.delete()
113+
110114
def add_records(self, records, url, from_sitemap):
111115
"""Add new records to the index"""
112116

0 commit comments

Comments
 (0)