Repository navigation
feat: manage Algolia attributesForFaceting as code / Algoliaのattributesforfacetingをコードで管理 - #603
Merged
zigzagdev merged 6 commits intoOct 25, 2026
Conversation
2 tasks
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/algolia-search-adapter-design-gaps #603 +/- ##
============================================================================
+ Coverage 67.75% 68.05% +0.29%
- Complexity 1713 1731 +18
============================================================================
Files 149 153 +4
Lines 9072 9159 +87
============================================================================
+ Hits 6147 6233 +86
- Misses 2925 2926 +1
🚀 New features to boost your workflow:
|
zigzagdev
merged commit Oct 25, 2026
84b835d
into
fix/algolia-search-adapter-design-gaps
27 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / 目的
attributesForFaceting (the Algolia index settings that control which attributes can be
filtered/faceted) were only ever configured manually in the Algolia dashboard. Nothing in
this repo could reproduce or verify them.
attributesForFaceting(Algoliaのインデックス設定のうち、どの属性をfilter/facetできるかを決める設定)は
ダッシュボードで手動設定されたままで、このリポジトリのどこにも再現・検証する手段がありませんでした。
Investigated whether this currently causes real filtering errors (the issue's stated
"Current Problem"): it does not. Every attribute
AlgoliaWorldHeritageSearchAdapteractuallyuses in
$filters/$optionalFiltersis already declared live (confirmed viagetSettings()against the real index), and the numeric
year_inscribedrange filter does not requireattributesForFacetingat all (confirmed by running it against the real index). The remaining,real gap is that these settings exist only in the dashboard, not as code.
これが実際にフィルタエラーを起こしているか(Issueの"Current Problem")を調査した結果、起きていません。
Adapterが
$filters/$optionalFiltersで実際に使っている属性はすべて既にライブ環境に登録済みで(
getSettings()で確認)、数値範囲フィルタのyear_inscribedはそもそもattributesForFacetingを必要とせず動作することも実際のインデックスへの呼び出しで確認しました。残っている実際の問題は、設定がコードとして
存在していないことだけです。
What I have done / 実施内容
App\Console\Commands\AlgoliaSyncIndexSettings(algolia:sync-index-settings,supports
--dry-run) that appliesattributesForFacetingfrom a code constant(
AlgoliaSyncIndexSettings::ATTRIBUTES_FOR_FACETING) to the Algolia indexin production
app/Packages/Domains/README.md, including thatcountry_names_jp/region/study_regionsare candidates forfilterOnly()since theAdapter does not filter on them, but this is deliberately deferred pending confirmation of
whether the frontend relies on their facet counts
code+test stage)
Test Results / テスト結果
AlgoliaSyncIndexSettingsTest: 2 passedtest_dry_run_prints_attributes_for_faceting_without_calling_algoliatest_attributes_for_faceting_covers_every_attribute_the_adapter_filters_onphp artisan test(full suite): 222 passed, no regressionsCloses #598
Part of #592