Merge pull request #33 from cbcoutinho/feature/search
Limit search results to notes with score > 0.5
This commit is contained in:
@@ -41,10 +41,6 @@ jobs:
|
|||||||
done
|
done
|
||||||
echo "Service is ready (returned 401)."
|
echo "Service is ready (returned 401)."
|
||||||
|
|
||||||
- name: Install notes app
|
|
||||||
run: |
|
|
||||||
docker compose exec app php occ app:enable notes
|
|
||||||
|
|
||||||
# Add subsequent steps here, e.g., running tests
|
# Add subsequent steps here, e.g., running tests
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
env:
|
env:
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
php /var/www/html/occ app:enable notes
|
||||||
@@ -34,6 +34,7 @@ services:
|
|||||||
- db
|
- db
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
- ./app-hooks/post-installation:/docker-entrypoint-hooks.d/post-installation:ro
|
||||||
environment:
|
environment:
|
||||||
- NEXTCLOUD_TRUSTED_DOMAINS=app
|
- NEXTCLOUD_TRUSTED_DOMAINS=app
|
||||||
- NEXTCLOUD_ADMIN_USER=admin
|
- NEXTCLOUD_ADMIN_USER=admin
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class NextcloudClient:
|
|||||||
score = self.calculate_score(query_tokens, title_tokens, content_tokens)
|
score = self.calculate_score(query_tokens, title_tokens, content_tokens)
|
||||||
|
|
||||||
# Only include notes with a non-zero score
|
# Only include notes with a non-zero score
|
||||||
if score > 0:
|
if score >= 0.5:
|
||||||
search_results.append({
|
search_results.append({
|
||||||
"id": note.get("id"),
|
"id": note.get("id"),
|
||||||
"title": note.get("title"),
|
"title": note.get("title"),
|
||||||
|
|||||||
Reference in New Issue
Block a user