Skip to content

Commit

Permalink
fix: 検索のインデックス条件が間違っていたのを修正 (#151)
Browse files Browse the repository at this point in the history
* Update .gitignore

* dev

* fix: 検索のスコープの考慮がローカル設定時に連合先のみになる

* chore: APIキーがダミーであることをわかりやすく
  • Loading branch information
kanarikanaru authored Dec 1, 2024
1 parent 6994355 commit 600369a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ services:
image: getmeili/meilisearch:latest
environment:
- MEILI_NO_ANALYTICS=true
- MEILI_ENV=production
- MEILI_ENV=development
env_file:
- .config/meilisearch.env
- ./meilisearch.env
networks:
- internal_network
volumes:
Expand All @@ -63,9 +63,9 @@ services:
image: getmeili/meilisearch:latest
environment:
- MEILI_NO_ANALYTICS=true
- MEILI_ENV=production
- MEILI_ENV=development
env_file:
- .config/hanamisearch.env
- ./hanamisearch.env
networks:
- internal_network
volumes:
Expand Down
12 changes: 8 additions & 4 deletions .devcontainer/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,26 @@ redis:
# ┌───────────────────────────┐
#───┘ MeiliSearch configuration └─────────────────────────────

# This API key is dummy. Please replace it with your own.
meilisearch:
host: meilisearch
port: 7700
apiKey: ''
apiKey: 'hanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskey'
ssl: false
index: ''
index: 'meili'
scope: global

# ┌────────────────────────────┐
#───┘ HanamiSearch configuration └─────────────────────────────

# This API key is dummy. Please replace it with your own.
hanamisearch:
host: hanamisearch
port: 7700
apiKey: ''
apiKey: 'hanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskey'
ssl: false
index: ''
index: 'hanami'
scope: global

# ┌───────────────┐
#───┘ ID generation └───────────────────────────────────────────
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/hanamisearch.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MEILI_MASTER_KEY="hanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskey"
1 change: 1 addition & 0 deletions .devcontainer/meilisearch.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MEILI_MASTER_KEY="hanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskeyhanamisskey"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ vite.config.local-dev.ts.timestamp-*

# VSCode addon
.favorites.json
/.devcontainer/hanami_data
/.devcontainer/meili_data
5 changes: 1 addition & 4 deletions packages/backend/src/core/SearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ export class SearchService {

const shouldIndex = (scope: string | string[], userHost: string | null): boolean => {
if (scope === 'global') return true;
if (scope === 'local') return userHost != null;
if (Array.isArray(scope)) {
return userHost != null && scope.includes(userHost);
}
if (scope === 'local') return userHost === null;

return false;
};
Expand Down

0 comments on commit 600369a

Please sign in to comment.